private void Start() { currentHealth = totalHealth; Mummy = GetComponent <Rigidbody>(); MummyCollider = GetComponent <Collider>(); GameObject myRpgGameObject = GameObject.FindGameObjectWithTag("Player"); myRpg = myRpgGameObject.GetComponent <MyRpgController>(); //多人游戏版本 /*GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); * for(int i = 0;i< players.Length;i++) * { * rpgPlayers[i] = players[i].GetComponent<MyRpgController>(); * }*/ //单人与多队友 }
public static float CalculatePlayerBaseAttackSpeed(MyRpgController myRpgController) { float baseAttackSpeed = myRpgController.agility * 0.02f; return(baseAttackSpeed); }
//基础攻击模块 public static float CalculatePlayerBaseAttackDamage(MyRpgController myRpgController) { float baseDamage = myRpgController.strength + Mathf.Floor(myRpgController.strength / 10) * 3; return(baseDamage); }