Пример #1
0
    private void Update()
    {
        for (int i = 0; i < m_StatusBuffs.Count; i++)
        {
            m_StatusBuffs[i].BuffUpdate();
            if (m_StatusBuffs[i].Over)
            {
                // StateUIMgr.Instance.RemoveBuff(m_StatusBuffs[i]);
                OnStatusBuffRemove.Invoke(m_StatusBuffs[i]);
                RemoveStatuBuff(m_StatusBuffs[i]);
            }
        }

        // stoic 霸体  移除所有负面状态
        if (isStoic)
        {
        }

        // 测试使用
        if (Input.GetKeyDown(KeyCode.F11))
        {
            if (StatusType == CharacterType.Player)
            {
                maxHp = 99999999;
                hp    = 99999999;
            }
        }
    }
Пример #2
0
 //  current if player has type of this buff of his status buffs, add false
 public void AddStatusBuff(IBuff _buff)
 {
     //if (!StatusBuffs.Contains(_buff))
     {
         m_StatusBuffs.Add(_buff);
         _buff.BuffOnEnter(gameObject);
         OnStatusBuffAdd.Invoke(_buff);
     }
 }
Пример #3
0
    private void Update()
    {
        //回复 护盾值
        attributes.SheildPoint += attributes.SPRegenerationRate.Value * Time.deltaTime;

        if (attributes.data.IsCaster)
        {
            //回复 魔法值 和 当前技能冷却(应当是全体技能冷却,同时技能初始精确度未设置)
            attributes.ManaPoint.Value += attributes.MPRegenerationRate.Value * Time.deltaTime;
            skillTable.CurrentSkill.AccuracyCooldown(Time.deltaTime);
        }

        //触发buff效果
        BuffEvent?.Invoke();

        if (GameCtrl.IsOnlineGame && IsLocal)
        {
            if (Gamef.SystemTimeInMillisecond - lastSyncUnitStateInstant >= GameDB.SYNC_TRANSFORM_INTERVAL)
            {
                Debug.Log("Send Hp = " + attributes.SheildPoint + ", Mp = " + attributes.ManaPoint.Value);
                lastSyncUnitStateInstant = Gamef.SystemTimeInMillisecond;
                DataSync.SyncHP(this, lastSyncUnitStateInstant, attributes.SheildPoint);
                DataSync.SyncMP(this, lastSyncUnitStateInstant, attributes.ManaPoint.Value);
            }
        }

        ////单位画布面对摄像机
        //if (unitCanvas != null)
        //    unitCanvas.transform.forward = unitCamera.position - unitCanvas.transform.position;
    }
Пример #4
0
 public void AddAttackCarryingBuff(IBuff _buff)
 {
     if (!AttackCarryingBuffs.Contains(_buff))
     {
         m_AttackCarryingBuffs.Add(_buff);
         //_buff.BuffOnEnter(gameObject);
         OnAttackCarryingBuffAdd.Invoke(_buff);
     }
 }
Пример #5
0
    private void Update()
    {
        //回复 护盾值
        attributes.SheildPoint += attributes.SPRegenerationRate.Value * Time.deltaTime;

        if (attributes.data.IsCaster)
        {
            //回复 魔法值 和 当前技能冷却(应当是全体技能冷却,同时技能初始精确度未设置)
            attributes.ManaPoint.Value += attributes.MPRegenerationRate.Value * Time.deltaTime;
            skillTable.CurrentSkill.AccuracyCooldown(Time.deltaTime);
        }

        //触发buff效果
        BuffEvent?.Invoke();

        ////单位画布面对摄像机
        //if (unitCanvas != null)
        //    unitCanvas.transform.forward = unitCamera.position - unitCanvas.transform.position;
    }