51 lines
1.2 KiB
C#
51 lines
1.2 KiB
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
|
|||
|
public class ChildHeadIcon : MonoBehaviour {
|
|||
|
|
|||
|
public enum ChildSex
|
|||
|
{
|
|||
|
Boy = 0,
|
|||
|
Girl = 1,
|
|||
|
}
|
|||
|
|
|||
|
public GameObject _ChildBoyHeadIcon;
|
|||
|
public GameObject _ChildGirlHeadIcon;
|
|||
|
public GameObject _WaitBornHeadIcon;
|
|||
|
public GameObject _Mark;
|
|||
|
|
|||
|
//当前下标,最多两个,可以写死在UI上
|
|||
|
public int _Index;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 这边只处理头像Icon
|
|||
|
/// </summary>
|
|||
|
/// <param name="gender">性别 0.男 1.女</param>
|
|||
|
public void InitChildHeadIcon(int gender, bool isWaitBorn = false)
|
|||
|
{
|
|||
|
if(isWaitBorn)
|
|||
|
{
|
|||
|
_ChildBoyHeadIcon.SetActive(false);
|
|||
|
_ChildGirlHeadIcon.SetActive(false);
|
|||
|
_WaitBornHeadIcon.SetActive(true);
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
_ChildBoyHeadIcon.SetActive(gender == (int)ChildSex.Boy);
|
|||
|
_ChildGirlHeadIcon.SetActive(gender == (int)ChildSex.Girl);
|
|||
|
}
|
|||
|
|
|||
|
public void OnHeadIconClick()
|
|||
|
{
|
|||
|
if (ChildStudyPanel.Instance)
|
|||
|
ChildStudyPanel.Instance.OnChildHeadIcon(_Index);
|
|||
|
}
|
|||
|
|
|||
|
public void ShowMark(bool isShow)
|
|||
|
{
|
|||
|
_Mark.SetActive(isShow);
|
|||
|
}
|
|||
|
}
|