示例#1
0
        public virtual void OnClientUpdateHero(CCharacterData clientData)
        {
            if (this.m_UserManager.IsConnected() == false)
            {
                return;
            }
            if (clientData == null)
            {
                return;
            }
            var dictData = new Dictionary <string, string> ();

            dictData ["hhealth"] = clientData.characterHealthPoint.ToString();
            var jsonSend = JSONObject.Create(dictData);

            this.m_UserManager.Emit("clientUpdateHero", jsonSend);
        }
示例#2
0
        private IEnumerator HandleSpawnBlockGuest(CBlockController parent, CCharacterData data)
        {
            if (parent.enemyPoint != null && data != null)
            {
                var characterGO = Instantiate(Resources.Load <CCharacterController> ("CharacterPrefabs/" + data.objectModel));
                yield return(characterGO != null);

                parent.blockGuest = characterGO;
                characterGO.transform.SetParent(parent.enemyPoint.transform);
                characterGO.transform.localPosition = Vector3.zero;
                characterGO.transform.localRotation = Quaternion.identity;
                characterGO.SetData(data);
                characterGO.SetActive(true);
                characterGO.currentBlock = parent;
                characterGO.targetBlock  = parent;
                characterGO.Init();
                CUIGameManager.Instance.OnLoadCharacterInfo(characterGO, true);
            }
            yield return(null);
        }
        public override void SetData(CObjectData value)
        {
            base.SetData(value);
            this.m_CharacterData = value as CCharacterData;
            // BASE LEVEL
            var baseLevel = this.m_CharacterData.characterLevel - 1 < 0
                                ? 0
                                : this.m_CharacterData.characterLevel - 1 >= this.m_CharacterData.maxLevel
                                ? this.m_CharacterData.maxLevel
                                : this.m_CharacterData.characterLevel - 1;

            // ATTACK POINT BASE LEVEL
            this.m_CharacterData.characterAttackPoint += baseLevel * this.m_CharacterData.dataPerLevel.characterAttackPoint;
            // ATTACK SPEED BASE LEVEL
            this.m_CharacterData.characterAttackSpeed += baseLevel * this.m_CharacterData.dataPerLevel.characterAttackSpeed;
            // DEFEND POINT BASE LEVEL
            this.m_CharacterData.characterDefendPoint += baseLevel * this.m_CharacterData.dataPerLevel.characterDefendPoint;
            // MAX HEALTH BASE LEVEL
            this.m_CharacterData.characterMaxHealthPoint += baseLevel * this.m_CharacterData.dataPerLevel.characterMaxHealthPoint;
            // FSM ACTIVE
            this.m_FSMComponent.ActiveFSM(true);
        }