Пример #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == Global.tag_Player)
     {
         shipEntity.GainOres(this, Global.OresTypes.FinalKey, 1.0f);
         finalKeyEvent.PlayerGetFinalKey(this);
         Debug.Log("Player Getting Final Key");
     }
 }
Пример #2
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == Global.tag_Player && isCollectable && shipEntity.CurrentWeight < shipEntity.MaximalWeight)
        {
            shipEntity.GainOres(this, oresType, 1); // Pick up the ore to the ship

            if (oresType == Global.OresTypes.Special_Ore)
            {
                Destroy(gameObject.transform.parent.parent.gameObject);
            }
            else
            {
                float rotation = Random.Range(0.0f, 360.0f);

                GameObject tempGameObject = Instantiate(gainEffect, transform.position, new Quaternion(0.0f, rotation, 0.0f, 0.0f)); // Create a boom effect
                Destroy(tempGameObject, 0.1f);                                                                                       // Destroy the boom effect after 10 second
                Destroy(gameObject);
            }
        }
    }