void Awake() { if (instance == null) { instance = this; } }
void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Ethan")) { CaveChefGameController.GetController().AddPoints(-5); } }
// Update is called once per frame void Update() { if (cooking) { cookDuration += Time.deltaTime; } if (cookDuration > cookTime + burnTime) { CaveChefGameController.GetController().showMessage(burnMsg); if (Time.time > lastBurned + damageInterval) { if (!smokeGenerated) { smokeEffect = (GameObject)Instantiate(smokeEffectPrefab, cookedObject.transform.position, smokeEffectPrefab.transform.rotation); smokeGenerated = true; } lastBurned = Time.time; CaveChefGameController.GetController().AddPoints(damage); } } else if (cookDuration > cookTime) { if (!cooked) { objectReadySound.Play(); cooked = true; Destroy(duringCooking); cookedObject.SetActive(true); CaveChefGameController.GetController().showMessage(readyMsg); } } }
// public LegMover legMover; // Update is called once per frame void Update() { if (!getRealUpdater) { getRealUpdater = getRealCamera.GetComponent <getRealCameraUpdater>(); } if (CAVE2Manager.GetButtonDown(1, CAVE2Manager.Button.Button3)) { bodyMover.SetTrigger(); hipMover.SetTrigger(); //hipScaler.ScaleUpperBody(); bodyScaler.ScaleBody(); if (ethanTutorial != null) { Destroy(ethanTutorial); CaveChefGameController.GetController().StartGame(); } //legMover.SetTrigger(); } if (CAVE2Manager.GetButtonDown(1, CAVE2Manager.Button.Button2)) { SceneManager.LoadScene(0); } }
IEnumerator ExecuteAfterTime(float time) { yield return(new WaitForSeconds(time)); CaveChefGameController.GetController().AddPoints(5); CaveChefGameController.GetController().nextLevel(); // Code to execute after the delay }
void OnTriggerExit(Collider other) { if (other.gameObject == cookedObject) { CaveChefGameController.GetController().nextLevel(); Destroy(smokeEffect); Destroy(flameEffect); Destroy(this); } }
// Use this for initialization void Start() { CaveChefGameController.GetController().showMessage(startGameDialog); foreach (GameObject g in obstacles) { g.SetActive(true); } objectToBeBrought.SetActive(true); objectToBeBrought.GetComponent <MovableObject>().enabled = true; }
void OnTriggerEnter(Collider other) { if (other.gameObject == target) { newPan.SetActive(true); target.SetActive(false); CaveChefGameController.GetController().AddPoints(10); CaveChefGameController.GetController().GameEnded(); } }
void OnTriggerEnter(Collider other) { if (other.gameObject == objectToBeBrought) { //Goal Reached; Destroy(objectToBeBrought); Destroy(before); after.SetActive(true); CaveChefGameController.GetController().showMessage(endGameDialog); StartCoroutine(ExecuteAfterTime(1)); } }
void OnTriggerEnter(Collider other) { if (other.gameObject == objectToKick) { Destroy(objectToKick); cabinetRotator.rotation = Quaternion.Euler(closedRot); CaveChefGameController.GetController().showMessage(endGameDialog); CaveChefGameController.GetController().AddPoints(10); gameObject.SetActive(false); CaveChefGameController.GetController().nextLevel(); } }
void OnTriggerEnter(Collider other) { if (other.gameObject == objectToBeBrought) { //Stove Reached; Destroy(objectToBeBrought); duringCooking.SetActive(true); CaveChefGameController.GetController().showMessage(onStoveDialog + Mathf.Floor(cookTime / 1) + " sec"); cooking = true; cookDuration = 0; CaveChefGameController.GetController().AddPoints(damage * -1); stoveSound.Play(); flameEffect.SetActive(true); } }
private void OnTriggerEnter(Collider other) { Debug.Log(other.gameObject.tag); if (other.gameObject.CompareTag("FootPadPresser")) { stepCount++; if (stepCount > nOfSteps) { CaveChefGameController.GetController().nextLevel(); CaveChefGameController.GetController().AddPoints(10); Destroy(gameObject); } else { currentState.OnTriggerEnter(other); } } }
// Use this for initialization void Start() { currentState = leftState; rightLegNext = true; CaveChefGameController.GetController().showMessage(startGameDialog); }
// Use this for initialization void Start() { CaveChefGameController.GetController().showMessage(startGameDialog); objectToBeBrought.GetComponent <MovableObject>().enabled = true; }
// Use this for initialization void Start() { objectToKick.SetActive(true); cabinetRotator.rotation = Quaternion.Euler(openRot); CaveChefGameController.GetController().showMessage(startGameDialog); }