/* Call this function from other objects that damage this object */ public void damaged(GameObject obj, GameEnums.Team tm, float dg) { if (tm != team && isAlive) { health -= dg; checkHealth(obj.name); } }
/*Set team and a reference to the game manager * Load all Prefabs needed to init a ship*/ public Player(GameManager man, GameEnums.Team t) { team = t; gameManager = man; playerUI = Resources.Load("Prefabs/UI/PlayerUI") as GameObject; abilityIcon = Resources.Load("Prefabs/UI/AbilityIcon") as GameObject; playerPrefab = Resources.Load("Prefabs/Player/Player") as GameObject; abilitiesPrefab = Resources.Load("Prefabs/UI/Abilities") as GameObject; ships = Resources.LoadAll("Prefabs/Ships"); }
/* Initilize AI script with team * Initlize all data to be use in AI calculations */ public void init(GameEnums.Team t) { team = t; isAlive = true; detectionRadius = 100f; nextDecision = 1f; fov = 60f; minDistanceDetect = new Vector3(10, 10, 10); shComps = new ShipComponents(gameObject); th = new Throttle(7, 14); state = GameEnums.AIState.OnSearch; notSeenTarget = 20.0f; nextMoveDecision = 2.0f; }
// Use this for initialization public Enemy(GameManager man, GameEnums.Team t) { team = t; gameManager = man; ships = Resources.LoadAll("Prefabs/Ships"); }
public void changeTeams(GameEnums.Team tm) { this.team = tm; }
public void setTeam(GameEnums.Team tm) { team = tm; }