void Start() { // cheater!!! // following loop gives max ammo for each shot type // disable to allow lootbox system to be worthwile /* * for(int i = 0; i < System.Enum.GetValues(typeof(ProjectileKind)).Length; i++){ * shotInventory.Modify((ProjectileKind) i, int.MaxValue); * } */ // link health onDeath event var health = GetComponent <Health>(); if (health != null) { health.onDeathEvent.AddListener(OnDeath); } // Debug.Log("TankController Start: isServer: " + isServer + " isLocalPlayer: " + isLocalPlayer); // copy state to model model.tankBaseKind = tankBaseKind; model.turretBaseKind = turretBaseKind; model.turretKind = turretKind; model.hatKind = hatKind; model.UpdateAvatar(); savedPowerModifier = shotPowerModifier; theNuke = GameObject.FindGameObjectWithTag("nuke").GetComponent <NukeScript>(); }
private void Start() { nukeIsReady = new UnityEvent(); nukeIsReady.AddListener(TurnManager.singleton.NukeIsReady); terrain = Terrain.activeTerrain; theNuke = GameObject.FindWithTag("nuke").GetComponent <NukeScript>(); health.onDeathEvent.AddListener(OnDeath); scaleTo = transform.localScale * 2; StartCoroutine(GrowTheShroom()); startingTurn = TurnManager.singleton.numberOfTurns; }
// Use this for initialization void Start() { // link to health var health = GetComponent <Health>(); if (health != null) { health.onDeathEvent.AddListener(OnDeath); } // rotation setup, // apply random initial rotation // randomize rotation direction transform.Rotate(0, UnityEngine.Random.Range(0, 90), 0); if (UnityEngine.Random.Range(0, 2) > 0) { rotationSpeed *= -1f; } theNuke = GameObject.FindWithTag("nuke").GetComponent <NukeScript>(); }
private void Awake() { control = transform.GetComponentInParent <NukeScript>(); }