/* * public void AddAlien(string alien){ * Object alienPrefab = PrefabManager.PrefabAliens[alien]; * * if(!GameSession.Instance.isDefender){ * GameSession.Instance.credits -= ((GameObject) alienPrefab).GetComponent<Alien>().Cost; * } * * AlienBuilder.QueueAlien(alienPrefab, this); * }*/ // Use this for initialization void Start() { spawnLocation = transform.position; //Spawn a selection ring GameObject obj = (GameObject)Instantiate(PrefabManager.PrefabUIRing, transform.position, Quaternion.identity); UIRing uiRing = obj.GetComponent <UIRing>(); uiRing.obj = this; ring = uiRing; uiRing.toInit = true; }
void Start() { if (toInit) { //Spawn a selection ring GameObject obj = (GameObject)Instantiate(PrefabManager.PrefabUIRing, transform.position + new Vector3(0, -10, 0), Quaternion.identity); UIRing uiRing = obj.GetComponent <UIRing>(); uiRing.obj = this; ring = uiRing; uiRing.toInit = true; //Spawn a firing radius obj = (GameObject)Instantiate(PrefabManager.PrefabFiringRadius, transform.position + new Vector3(0, -30, 0), Quaternion.identity); firingRadius = obj.transform; } if (firingRadius != null) { firingRadius.position = new Vector3(transform.position.x, firingRadius.position.y, transform.position.z); firingRadius.renderer.enabled = false; } }