Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix full constume preview #6394

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions nekoyume/Assets/_Scripts/Game/Character/CharacterAppearance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,29 @@ public void SetForPrologue(
UpdateHitPoint();
}

public void SetForCostumes(
CharacterAnimator animator,
HudContainer hudContainer,
List<Costume> costumes)
{
_animator = animator;
_hudContainer = hudContainer;
Destroy(_cachedCharacterTitle);

var fullCostume =
costumes.FirstOrDefault(x => x.ItemSubType == ItemSubType.FullCostume);
if (fullCostume is not null)
{
UpdateFullCostume(fullCostume);
}

var title = costumes.FirstOrDefault(x => x.ItemSubType == ItemSubType.Title);
if (title is not null)
{
UpdateTitle(title);
}
}

private async void UpdateAvatar(
Address avatarAddress,
CharacterAnimator animator,
Expand Down
10 changes: 10 additions & 0 deletions nekoyume/Assets/_Scripts/Game/Character/FriendCharacter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,15 @@ public void Set(
avatarState.tail,
true);
}

public void SetForCostumes(List<Costume> costumes)
{
_hudContainer ??= Widget.Create<HudContainer>(true);
_hudContainer.transform.localPosition = Vector3.left * 200000;
sonohoshi marked this conversation as resolved.
Show resolved Hide resolved
appearance.SetForCostumes(
Animator,
_hudContainer,
costumes);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@ private void SetCharacter(Costume costume)
_cachedCharacterTitle = Instantiate(clone, titleSocket);
}

var avatarState = Game.Game.instance.States.CurrentAvatarState;
var equipments = new List<Equipment>();
var costumes = new List<Costume> { costume, };
Game.Game.instance.Lobby.FriendCharacter.Set(avatarState, costumes, equipments);
Game.Game.instance.Lobby.FriendCharacter.SetForCostumes(costumes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이걸 손대는게 로비에 있는 캐릭터에 영향이 가는걸까요?
로비에 있는 캐릭터는 기존 코스튬 착용 규칙을 따라가야 할 것 같습니다

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LobbyCharacter, FriendCharacter는 클래스하고 오브젝트, 렌더 텍스쳐가 분리되어있습니당
그래서 로비 캐릭터는 본인 아바타 입은거 보여줄 때 (로비, 인벤토리, 전투 준비화면)에서만 쓰고, 칭구 캐릭터는 다른 유저 보여줄 때 쓰려고 만들었는데 그냥 UI에서 아바타 보여줄때 여기저기 써요. 보통 사용할 때마다 Set하기 때문에 같은 캐릭터 끼리도 문제는 없을겁니당.

}
}
}
Loading