protected virtual void FormatData() { if (photonView.isMine) { SceneManager.AddMy_TowerList(this); if (originalTurretData.ATK_Level != TurretData.myTowerAtkLevel || originalTurretData.DEF_Level != TurretData.myTowerDefLevel) { originalTurretData = TurretData.instance.getTowerData(DataName); } } else { SceneManager.AddEnemy_TowerList(this); if (originalTurretData.ATK_Level != TurretData.enemyTowerAtkLevel || originalTurretData.DEF_Level != TurretData.enemyTowerDefLevel) { originalTurretData = TurretData.instance.getEnemyTowerData(DataName); } } turretData = originalTurretData; deadManager.ifDead(false); turretData.UI_Hp = turretData.UI_maxHp; turretData.Fad_thermalEnergy = 0; healthBar.fillAmount = 1; Fad_energyBar.fillAmount = 0.0f; }
void Death() { //被破壞特效(未寫)----------------- originalObj.enabled = false; destoryObj.enabled = true; deadManager.ifDead(true); MatchTimeManager.SetCountDownNoCancel(ReBorn, delayToReBorn); MatchTimeManager.ClearThisTask(modifyIndex); closeHpBar(); }
void FormatData() { if (photonView.isMine) { SceneManager.AddMy_SoldierList(this); if (originalData.ATK_Level != MyEnemyData.mySoldierAtkLevel || originalData.DEF_Level != MyEnemyData.mySoldierDefLevel) { originalData = MyEnemyData.instance.getMySoldierData(DataName); } } else { SceneManager.AddEnemy_SoldierList(this); if (originalData.ATK_Level != MyEnemyData.enemySoldierAtkLevel || originalData.DEF_Level != MyEnemyData.enemySoldierDefLevel) { originalData = MyEnemyData.instance.getEnemySoldierData(DataName); } } enemyData = originalData; deadManager.ifDead(false); nav.speed = enemyData.moveSpeed; if (ani.GetBool(aniHashValue[1])) { Net.RPC("TP_stopAni", PhotonTargets.All, false); } if (myCollider != null) { myCollider.enabled = true; } if (photonView.isMine) { nowPoint = Find_PathPoint; if (nav != null) { nav.enabled = true; } stopDetect = false; nowGoAtkCore = false; InvokeRepeating("FindMyTarget", 0.3f, 0.6f); } }
public void takeDamage(float _damage, Vector3 _dir, bool ifHit) { if (deadManager.noDamage) { Debug.Log("產生無敵時被攻擊特效"); return; } if (deadManager.checkDead) { return; } float tureDamage = CalculatorDamage(_damage); if (playerData.Hp_original > 0) { playerData.Hp_original -= tureDamage; //打擊音效 //AudioScript.PlayAppointAudio(myAudio, 8); BeHitChangeColor(); ani.SetBool(AniControll.aniHashValue[8], true); openPopupObject(tureDamage); if (playerData.Hp_original <= 0) { deadManager.ifDead(true); ani.SetBool(AniControll.aniHashValue[15], true); Death(); } if (ifHit && !deadManager.checkDead && !deadManager.notFeedBack && !NowCC) { CancelNowSkill(); ani.SetTrigger(AniControll.aniHashValue[14]); beHit(_dir); } } }