public virtual void Start() { PathFinding = FindObjectOfType(typeof(A_Star_Script)) as A_Star_Script; Map = FindObjectOfType(typeof(MapGeneration)) as MapGeneration; if (IMplayer) { health = 5; attack = 5; defence = 5; myName = "player"; LivingType = Type.Player; } else { myName = generateName(); tier = randomTier(); LivingType = randomType(); attack = randomAttack(tier, LivingType); defence = randomDef(tier, LivingType); health = caculaHeath(tier); } Vector3 temp = Map.PositionToCoord(transform.position); CurrentTileID.Set(Mathf.FloorToInt(temp.x), Mathf.FloorToInt(temp.y)); dead = false; Battle = false; MyTurn = false; MaxDefence = defence; currentTurn = 0; }