// Catch this collectible void HandleCatch(APCharacterController character) { if (!m_catched) { m_catched = true; // update player data APSamplePlayer player = character.GetComponent <APSamplePlayer>(); if (player != null) { player.AddLife(m_lifePoints); player.AddScore(m_scorePoints); player.AddAmmo(m_ammoPoints, m_rangedAttackIndex); } // destroy me Object.Destroy(gameObject); } }
// Catch this collectible void HandleCatch(APCharacterController character) { if (!m_catched) { m_catched = true; // update player data APSamplePlayer player = character.GetComponent <APSamplePlayer>(); if (player != null) { player.AddLife(m_lifePoints); player.AddScore(m_scorePoints); if (m_ammoBox != null) { m_ammoBox.AddAmmo(m_ammoPoints); } } StartCoroutine(wait()); } }