// Use this for initialization void Start() { NinjaScript.minDistance = minDistanceBetweenNinjas; NinjaScript.attackDistance = ninjaAttackDistance; NinjaScript.updateNinjasOnScreen(); NinjaScript.initSpawns(); DroneScript.initSpawns(); DroneCannonScript.initRockets(); DroneCannonScript.timeBetweenRockets = 5.0f; RocketScript.rocketSpeed = 2.5f; RocketScript.hiddenLocation = new Vector3(100, 100, 100); RocketScript.explosionForce = 500.0f; RocketScript.explosionRadius = 1.0f; RocketScript.initRbs(); RocketScript.initExplosions(explosion); compilators = GameObject.FindObjectsOfType <CompilatorScript>(); lastCompilatorActive = Random.Range(0, compilators.Length); compilators[lastCompilatorActive].Init(); compilators[lastCompilatorActive].active = true; compilatorsUsed = new HashSet <int>(); compilatorsUsed.Add(lastCompilatorActive); maxFillComp = compilationBar.sizeDelta.x; minFillComp = 0; maxFillDamage = damageBar.sizeDelta.x; minFillDamage = 0; compilatorsLife = compilationTotalDamage; }
public static void instantiateNinja() { GameObject ninja = (GameObject.FindObjectOfType <NinjaScript>()).gameObject; GameObject newNinja = Instantiate(ninja, new Vector3(100, 100, 100), Quaternion.identity); newNinja.GetComponent <NinjaScript>().dead = true; NinjaScript.updateNinjasOnScreen(); }