public void GetLoot() { Loot loot = coordinates.loot.GetComponentInChildren <Loot>(); if (!loot) { Debug.Log("No loot!"); } else { if (!loot.collected) { loot.Collect(); GameObject lootTextInstance = Instantiate(lootText); TextMesh textMesh = lootTextInstance.GetComponent <TextMesh>(); textMesh.text = loot.GetText(); Destroy(lootBrackets); } } }
private void OnReachedDestination() { if (m_IsMovingTowardsLootObject && m_currentLootTarget != null) { m_Thief.currentLoot += 1; m_Thief.currentNoise += 0.12f; m_IsMovingTowardsLootObject = false; // Collect loot m_currentLootTarget.Collect(); m_currentLootTarget = null; } else if (m_IsMovingTowardsExit) { m_Thief.atExit = true; m_IsMovingTowardsExit = false; m_GameTimer.EndPrematurely(); } if (m_IsMoving) { m_IsMoving = false; } }