Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     score  = -1;
     isDead = false;
     player = GetComponent <Transform>();
     DiamondTextController.Initialize();
     direc = Vector3.zero;
 }
Example #2
0
 //for collecting diamonds
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Diamond")
     {
         DiamondTextController.createFloatingText(other.transform);
         other.gameObject.SetActive(false);                        //deactivating the diamond
         Instantiate(ps, transform.position, Quaternion.identity); //particle effect on hitting the diamond
         score += 2;
     }
 }