예제 #1
0
 public virtual void OnLoadCharacterInfo(CCharacterController parent, bool isEnemy)
 {
     this.m_CurrentCharacterInfo = GameObject.Instantiate(this.m_CharacterInfoPrefab);
     this.m_CurrentCharacterInfo.SetupInfo(parent, isEnemy);
     this.m_CurrentCharacterInfo.transform.SetParent(this.m_CharacterInfoRoot.transform);
     this.m_CurrentCharacterInfo.gameObject.SetActive(true);
 }
예제 #2
0
        public virtual void SetupInfo(CCharacterController parent, bool isEnemy)
        {
            var data = parent.GetData() as CCharacterData;

            this.characterNameText.text  = data.objectName;
            this.characterNameText.color = isEnemy ? Color.red : Color.green;
            this.characterLevelText.text = "lv: " + data.characterLevel;
            var fitHealth = (float)data.characterHealthPoint / data.characterMaxHealthPoint;

            this.characterHealthBarImage.fillAmount = fitHealth;
            this.characterParent = parent;
            this.m_Except        = !isEnemy;
            parent.AddAction("UpdateHealth", this.OnUpdateHealth);
        }
예제 #3
0
 public FSMCharacterInactiveState(IContext context) : base(context)
 {
     this.m_Controller = context as CCharacterController;
 }