// Called when the state is enabled void OnEnable() { navMeshAgent = GetComponent <NavMeshAgent>(); navMeshAgent.speed = 3.5f; textObject.GetComponent <TextToUI>().SetText(textObject.s_limping); }
void DoneEating() { gameObject.GetComponent <Gollum_Hunger>().hunger += 1; textObject.GetComponent <TextToUI>().SetText(textObject.g_catching); SendEvent("AteButterfly"); }
// Called when the state is enabled void OnEnable() { textObject.GetComponent <TextToUI>().SetText(textObject.s_waiting); navMeshAgent = GetComponent <NavMeshAgent>(); navMeshAgent.speed = 8f; Food.SetActive(true); gameObject.GetComponent <Sam_Health>().health = 5f; }
// Update is called once per frame void Update() { PlaceWaypoint(); if (gameObject.tag == "Gollum") { textObject.GetComponent<TextToUI>().SetText("Yes?"); } }
private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Butterfly") { other.gameObject.SetActive(false); textObject.GetComponent <TextToUI>().SetText(textObject.g_catching); SendEvent("CaughtButterfly"); } }
// Update is called once per frame void Update() { gameObject.transform.position = Pot.transform.position; gameObject.transform.rotation = Pot.transform.rotation; textObject.GetComponent <TextToUI>().SetText(textObject.s_cooking); timer += Time.deltaTime; if (timer > 3f) { SendEvent("DoneCooking"); } }
void Update() { if (gameObject.tag == "Sam") { SendEvent("MoveToPlayer"); } if (gameObject.tag == "Gollum") { if (gameObject.GetComponent <Gollum_Hunger>().hungry) { textObject.GetComponent <TextToUI>().SetText("Gollum is hungry!"); SendEvent("Hungry"); } if (!gameObject.GetComponent <Gollum_Hunger>().hungry) { textObject.GetComponent <TextToUI>().SetText("heehee"); SendEvent("NotHungry"); } } }
private void OnCollisionEnter(Collision collision) { if (gameObject.tag == "Sam") { if (collision.gameObject.tag == "Pot") { SendEvent("CookingPot"); } } if (gameObject.tag == "Gollum") { if (collision.gameObject.tag == "Artifact") { textObject.GetComponent <TextToUI>().SetText(textObject.g_artifact); SendEvent("GotArtifact"); } } }
// Called when the state is enabled void OnEnable() { textObject.GetComponent <TextToUI>().SetText(textObject.g_bargaining); }
// Called when the state is enabled void OnEnable() { textObject.GetComponent <TextToUI>().SetText("Let's go Mr Frodo"); }
// Called when the state is enabled void OnEnable() { gameObject.transform.position = Pot.transform.position; gameObject.transform.rotation = Pot.transform.rotation; textObject.GetComponent <TextToUI>().SetText(textObject.s_resting); }
void OnEnable() { reached = false; timer = 0f; textObject = textObject.GetComponent <TextToUI>(); }
// Called when the state is enabled void OnEnable() { vision = vision.GetComponent <Vision>(); Waypoint.transform.position = ButterflyWaypoint.transform.position; textObject.GetComponent <TextToUI>().SetText(textObject.g_chasing); }
// Called when the state is enabled void OnEnable() { textObject.GetComponent <TextToUI>().SetText(textObject.g_satisfied); gameObject.GetComponent <Gollum_Hunger>().cookedFood = true; }
// Called when the state is enabled void OnEnable() { textObject.GetComponent <TextToUI>().SetText("The Artifact is mine!"); }