// private bool AIDead; // private int AIhealth; void Start() { characterController = GetComponent <RPGCharacterControllerFREE>(); characterMovementController = GetComponent <RPGCharacterMovementControllerFREE>(); GameOverPanel.SetActive(false); Health = 100; }
// Start is called before the first frame update void Start() { characterController = GetComponent <RPGCharacterControllerFREE>(); characterMovementController = GetComponent <RPGCharacterMovementControllerFREE>(); health = 50; AIDead = false; }
void Start() { characterController = GetComponent <RPGCharacterControllerFREE>(); characterMovementController = GetComponent <RPGCharacterMovementControllerFREE>(); parseNum = 0; GenAttacks(); distanceVector = new Vector3(0, 0, 2); }
void OnTriggerEnter(Collider col) { //Attach key to player back if (col.gameObject.tag == "Player") { hpScript = col.GetComponentInChildren <HealthBarScript>(); animScript = col.GetComponentInChildren <RPGCharacterControllerFREE>(); //remove heart from player if (hpScript.health >= 0) { hpScript.RemoveHearth(hpScript.health); hpScript.health--; } //play hit animation animScript.GetHit(); //play sound //stop firing new projectiles if health is lower than 0 if (hpScript.health > 0) { enemyScript.playerAlive = false; Destroy(gameObject); } //destroy gameobject Destroy(gameObject); } if (col.gameObject.tag == "Obstacle") { if (col.name == "Mirror") { gameObject.transform.Rotate(new Vector3(180f, 0, 0)); speed = speed * -1; bounced = true; } else { Destroy(gameObject); } } if (col.gameObject.tag == "EnemyT1") { Destroy(gameObject); } }
public void gameOver() { if (canvas.gameObject.activeInHierarchy == false) { RPGCCF = GameObject.FindGameObjectWithTag("Player").GetComponent <RPGCharacterControllerFREE>(); if (RPGCCF.score < 10) { canvasL.gameObject.SetActive(true); Time.timeScale = 0; } else { canvas.gameObject.SetActive(true); Time.timeScale = 0; } } else { canvas.gameObject.SetActive(false); Time.timeScale = 1; } }
// Use this for initialization void Start() { playerScript = GameObject.Find("RPG-Character").GetComponent <RPGCharacterControllerFREE>(); door = GameObject.Find("CloseDoorFirstEnemy").GetComponent <OpenDoor>(); }
void Start() { rpgCharacter = GetComponent <RPGCharacterControllerFREE>(); }