12.10 进度 基本完成
This commit is contained in:
@@ -6,18 +6,36 @@ namespace Continentis.MainGame.UI
|
||||
{
|
||||
public class CharacterAvatar : MonoBehaviour
|
||||
{
|
||||
public CharacterBase character;
|
||||
public Image characterImage;
|
||||
public Image frame;
|
||||
|
||||
public Sprite normalFrame;
|
||||
public Sprite actionFrame;
|
||||
|
||||
public void Initialize(CharacterBase character)
|
||||
{
|
||||
this.character = character;
|
||||
characterImage.sprite = character.data.avatar;
|
||||
normalFrame = MainGameManager.Instance.basePrefabs.fractionFrames[character.fraction][0];
|
||||
actionFrame = MainGameManager.Instance.basePrefabs.fractionFrames[character.fraction][1];
|
||||
frame.sprite = normalFrame;
|
||||
frame.color = MainGameManager.Instance.basePrefabs.fractionColors[character.fraction];
|
||||
frame.material = Instantiate(frame.material);
|
||||
Highlight(false);
|
||||
}
|
||||
|
||||
public void Highlight(bool isHighlighted)
|
||||
{
|
||||
Debug.Log($"Highlighting {character.data.displayName}: {isHighlighted}");
|
||||
|
||||
if (isHighlighted)
|
||||
{
|
||||
frame.material.SetFloat("_SineGlowFade", 1);
|
||||
frame.material.SetColor("_SineGlowColor", frame.color * 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
frame.material.SetFloat("_SineGlowFade", 0);
|
||||
frame.material.SetColor("_SineGlowColor", Color.white);
|
||||
}
|
||||
|
||||
Mask mask = CombatUIManager.Instance.combatMainPage.actionOrderDisplayer.avatarContainer.GetComponent<Mask>();
|
||||
MaskUtilities.NotifyStencilStateChanged(mask);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user