override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { tower = GameObject.FindWithTag("tower").GetComponent <HumanWatchTower>(); enemyDamage = 10; tower.currentHealth -= enemyDamage; }
override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { tower = GameObject.FindWithTag("tower").GetComponent <HumanWatchTower>(); if (tower == null) { Debug.Log("tower reference is null"); } enemyDamage = 100; tower.currentHealth -= enemyDamage; Debug.Log(tower.currentHealth); }
void Awake() { nvrPlayer = GameObject.FindWithTag("Player").GetComponent <NVRPlayer>(); tower = GameObject.FindWithTag("tower").GetComponent <HumanWatchTower>(); gestureGameManager = GetComponent <GestureGameManager>(); gestureGameManager.nvrPlayer = nvrPlayer; gestureGameManager.masterGameManager = this; assembledSpellQuickBar = GetComponent <AssembledSpellQuickBar>(); spellEngine = GetComponent <SpellEngine>(); spellEngine.masterGameManager = this; }
void Awake() { int[] levelOne = new int[5] { 3, 0, 0, 0, 0 }; //small, medium, flyer, speed, large int[] levelTwo = new int[5] { 5, 2, 0, 0, 0 }; int[] levelThree = new int[5] { 10, 5, 1, 0, 0 }; int[] levelFour = new int[5] { 13, 10, 5, 3, 0 }; int[] levelFive = new int[5] { 10, 13, 0, 7, 3 }; levelPopulation = new int[][] { levelOne, levelTwo, levelThree, levelFour, levelFive }; nvrPlayer = GameObject.FindWithTag("Player").GetComponent <NVRPlayer>(); gestureGameManager = GetComponent <GestureGameManager>(); gestureGameManager.nvrPlayer = nvrPlayer; if (GameObject.FindWithTag("tower") != null) { tower = GameObject.FindWithTag("tower").GetComponent <HumanWatchTower>(); } if (GameObject.FindWithTag("GameController").GetComponentInChildren <PortalSpawning>() != null) { portalSpawning = GameObject.FindWithTag("GameController").GetComponentInChildren <PortalSpawning>(); Debug.Log("Portal Spawning object has been found"); } else { Debug.Log("Portal Spawning object has not been found."); } gestureGameManager.masterGameManager = this; assembledSpellQuickBar = GetComponent <AssembledSpellQuickBar>(); spellEngine = GetComponent <SpellEngine>(); spellEngine.masterGameManager = this; }
public void gameOverButtonOnClick() { tower = GameObject.FindWithTag("tower").GetComponent <HumanWatchTower>(); tower.currentHealth = tower.maximumHealth; SceneManager.LoadScene("Wizard's Lab"); }