Ejemplo n.º 1
0
 void CrashBike()
 {
     foreach (GameObject comp in bikeComponents)
     {
         BoxCollider boxCol = comp.GetComponent <BoxCollider>();
         Rigidbody   rigby  = comp.GetComponent <Rigidbody>();
         if (boxCol == null)
         {
             comp.AddComponent <BoxCollider>();
         }
         if (rigby == null)
         {
             comp.AddComponent <Rigidbody>();
         }
     }
     //disable dust particles && move controls
     try{
         GameObject dust = GameObject.Find("Dust");
         dust.SetActive(false);
         catMove kitty = this.GetComponent <catMove>();
         kitty.enabled = !kitty.enabled;
     }
     catch (NullReferenceException e) { Debug.Log("-"); }
     invisibleGround.SetActive(true);
     if (crashAnimationPlayed == 0)
     {
         camAnim.SetTrigger("bikeCrash");
     }
     crashAnimationPlayed = 1;
     Oof();
 }
Ejemplo n.º 2
0
 //float groundValue = 0f;
 // Start is called before the first frame update
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player");
     cat    = GameObject.FindObjectOfType <catMove>();
 }
Ejemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     animator      = GetComponent <Animator>();
     bikeReference = GameObject.FindObjectOfType <catMove>();
 }