Toggle navigation
Toggle navigation
This project
Loading...
Sign in
范川铭
/
UnityFrameWork
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
王琪诚
2025-06-25 17:18:14 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4d4b63690e8c48740c453d5f1624b3e72066958b
4d4b6369
1 parent
e9c8adcc
【任务】TAPD#
功能详情 朋友圈 配置文件 否 提交作者 QiCheng.Wang 评审人员
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
5 additions
and
10 deletions
Assets/LocalImage/likeIcon.png
Assets/Scripts/FriendCircle/MomentData.cs
Assets/Scripts/FriendCircle/MomentItem.cs
Assets/Scripts/FriendCircle/MomentManager.cs
Assets/resources/Jsons/friend_data.json
Assets/resources/Prefab/MomentItem.prefab
Assets/LocalImage/likeIcon.png
View file @
4d4b636
4.35 KB
|
W:
|
H:
3.32 KB
|
W:
|
H:
2-up
Swipe
Onion skin
Assets/Scripts/FriendCircle/MomentData.cs
View file @
4d4b636
...
...
@@ -12,8 +12,7 @@ public class MomentList
//封面图url
public
String
cover
;
public
String
bottom
;
//点赞图标
public
string
likeIcon
;
//大图右下角的小logo
public
String
logo
;
...
...
Assets/Scripts/FriendCircle/MomentItem.cs
View file @
4d4b636
...
...
@@ -31,7 +31,6 @@ public class MomentItem : MonoBehaviour
public
TextMeshProUGUI
from
;
public
TextMeshProUGUI
time
;
public
Image
likeIconImage
;
private
string
originLikeIcon
;
public
Transform
likeGrid
;
// 父对象,用于点赞emjoi排列
public
GameObject
likePrefab
;
// 点赞emjoi预制体
...
...
@@ -77,7 +76,6 @@ public class MomentItem : MonoBehaviour
bool
isOver
=
IsUIOverlapping
(
checkRectTransform
,
scrollViewRectTransform
);
if
(!
isOver
)
{
StartCoroutine
(
ImageLoader
.
LoadImage
(
originLikeIcon
,
likeIconImage
));
likesText
.
text
=
originLikesText
;
likeIconImage
.
gameObject
.
SetActive
(
true
);
likedEmoji
.
gameObject
.
SetActive
(
false
);
...
...
@@ -131,7 +129,7 @@ public class MomentItem : MonoBehaviour
public
int
Setup
(
Moment
moment
,
List
<
Like
>
likeList
,
string
l
ikeIcon
,
string
l
ogo
,
int
momentCount
)
public
int
Setup
(
Moment
moment
,
List
<
Like
>
likeList
,
string
logo
,
int
momentCount
)
{
//计算单条朋友圈所占高度
//每行字50
...
...
@@ -150,8 +148,7 @@ public class MomentItem : MonoBehaviour
from
.
text
=
moment
.
from
;
time
.
text
=
moment
.
time
;
StartCoroutine
(
ImageLoader
.
LoadImage
(
likeIcon
,
likeIconImage
));
originLikeIcon
=
likeIcon
;
momentHeight
+=
line
;
//单条朋友圈面板点击事件
...
...
Assets/Scripts/FriendCircle/MomentManager.cs
View file @
4d4b636
...
...
@@ -41,7 +41,7 @@ public class MomentManager : MonoBehaviour
{
GameObject
item
=
Instantiate
(
momentPrefab
,
contentParent
);
int
momentHeight
=
item
.
GetComponent
<
MomentItem
>().
Setup
(
moment
,
data
.
likeList
,
data
.
l
ikeIcon
,
data
.
l
ogo
,++
momentCount
);
int
momentHeight
=
item
.
GetComponent
<
MomentItem
>().
Setup
(
moment
,
data
.
likeList
,
data
.
logo
,++
momentCount
);
RectTransform
momentRt
=
item
.
GetComponent
<
RectTransform
>();
momentRt
.
sizeDelta
=
new
Vector2
(
momentRt
.
sizeDelta
.
x
,
momentHeight
);
...
...
Assets/resources/Jsons/friend_data.json
View file @
4d4b636
...
...
@@ -2,7 +2,6 @@
"cover"
:
"https://h5.edcc.cn/FriendCircle/image/cover.png"
,
"bottom"
:
"https://h5.edcc.cn/FriendCircle/image/bottom.png"
,
"logo"
:
"https://h5.edcc.cn/FriendCircle/image/logo.png"
,
"likeIcon"
:
"https://h5.edcc.cn/FriendCircle/image/likeIcon.png?a=2"
,
"likeList"
:[
{
"icon"
:
"<sprite name=\"Smile\">"
,
"bullet"
:
"加油加油!"
,
"name"
:
"Smile"
},
{
"icon"
:
"<sprite name=\"LaughCry\">"
,
"bullet"
:
"哈哈哈哈哈"
,
"name"
:
"LaughCry"
},
...
...
Assets/resources/Prefab/MomentItem.prefab
View file @
4d4b636
...
...
@@ -2235,7 +2235,7 @@ MonoBehaviour:
m_OnCullStateChanged
:
m_PersistentCalls
:
m_Calls
:
[]
m_Sprite
:
{
fileID
:
0
}
m_Sprite
:
{
fileID
:
21300000
,
guid
:
8b4345a2f9fc6463cab99c888ff1f358
,
type
:
3
}
m_Type
:
0
m_PreserveAspect
:
0
m_FillCenter
:
1
...
...
Please
register
or
login
to post a comment