IEnumerator Spawn_async(FighterAI AI) { _penalty += 0.2f; yield return(new WaitForSeconds(_penalty)); AI.transform.position = new Vector3(transform.position.x + Random.Range(100, 400), transform.position.y + Random.Range(100, 400), transform.position.z + Random.Range(100, 400)); AI.gameObject.SetActive(true); AI.Initialize(_bc, this); // _hitPoints -= 100; OnHit(1000); }
public FighterAI Create() { GameObject go; if (_faction == Faction.ALLY) { go = ObjectFactory.instance.MakeObject(ObjectFactory.PrefabType.AllyFighter); } else { go = ObjectFactory.instance.MakeObject(ObjectFactory.PrefabType.Fighter); } go.transform.position = new Vector3(transform.position.x + Random.Range(-900, 900), transform.position.y + Random.Range(-900, 900), transform.position.z + Random.Range(-900, 900)); FighterAI AI = go.GetComponent <FighterAI> (); AI.Initialize(_bc, this); return(AI); }