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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using Lean.Pool;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -10,8 +11,24 @@ namespace Continentis.MainGame.UI
|
||||
public Image titleBackground, contentBackground;
|
||||
public TMP_Text titleText, contentText;
|
||||
|
||||
public static InformationBox Create(RectTransform parent, ref InformationBox exclusivity)
|
||||
{
|
||||
GameObject infoBoxPrefab = MainGameManager.Instance.basePrefabs.informationBox;
|
||||
exclusivity ??= LeanPool.Spawn(infoBoxPrefab, parent).GetComponent<InformationBox>();
|
||||
return exclusivity;
|
||||
}
|
||||
|
||||
public static void Despawn(ref InformationBox infoBox)
|
||||
{
|
||||
if (infoBox != null)
|
||||
{
|
||||
LeanPool.Despawn(infoBox.gameObject);
|
||||
infoBox = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 卡牌的关键词和描述
|
||||
/// 处于LayoutGroup中时的初始化
|
||||
/// </summary>
|
||||
public void Initialize(string title, string content)
|
||||
{
|
||||
@@ -21,7 +38,7 @@ namespace Continentis.MainGame.UI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Buff的名称和描述
|
||||
/// 非LayoutGroup中时的初始化
|
||||
/// </summary>
|
||||
public void Initialize(string title, string content, Vector2 basePosition)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user