EnergyPulsePower

using UnityEngine;
using System.Collections;

public class EnergyPulsePower : MonoBehaviour
{
  public float pulseDuration = 1f;
  
  public Transform goodOrb;
  
  void Update()
  {
    pulseDuration -= Time.deltaTime;
    
    if(pulseDuration <= 0)
      Destroy(gameObject);
  }
  
  void OnTriggerEnter(Collider other)
  {
    if(other.gameObject.tag == "BadOrb")
    {
      Instantiate(goodOrb, other.transform.position,           other.transform.rotation);
      GameObject.Find("GameManager).
        GetComponent<GameDate>().playerLives += 1;
      Destroy(other.gameObject);
      Destroy(gameObject);
    }
    else
      Destroy(gameObject);
  }
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.181.57