Ejemplo n.º 1
0
 void OnCollisionEnter(Collision other)
 {
     if (other.gameObject.tag == "Player")
     {
         if (isTouched)
         {
             //Debug.Log("****************** BEEN TOUCHED ALREADY!");
             return;
         }
         else
         {
             if (padNumber == gm.nextPad)
             {
                 // In here I need to put a variable that I'm on the pad, which is sent to an update loop that times down. When done, sets isTouched = true. If false,
                 isTouched = true;
                 Debug.LogWarning(" **** TOUCHED PAD " + padNumber);
                 gm.Advance();
                 Debug.LogWarning(" **** MOVING ON to pad " + gm.nextPad);
             }
             else
             {
                 isTouched = false;
                 Debug.LogWarning("THIS IS NOT THE TARGET PAD! Try again! Target is " + gm.nextPad + " but this is pad " + padNumber);
             }
         }
     }
     else
     {
         //Debug.LogWarning("Uh-oh. Something hit me, but I didn't recognize it as player.");
     }
 }
Ejemplo n.º 2
0
    void FixedUpdate()
    {
        if (isTouching && taxiRb.velocity.magnitude < 0.01f)
        {
            landingTime = landingTime - (int)(Time.deltaTime * landingTimeMax); // Later turn this into seconds, instead of an arbitrary int

            //Debug.Log("<color=red>************************* </color> Landing Time: " + landingTime + ", Max Time: " + landingTimeMax + ", and divide: " + (float)((float)landingTime / (float)landingTimeMax));

            revealOffset = 1.0f - (((float)landingTime / (float)landingTimeMax) * .9f);
            //Debug.Log("<color=blue>************************* </color> revealOffset = " + revealOffset);

            gaugeMesh.material.SetFloat("_Cutoff", revealOffset);

            if (landingTime < 0)
            {
                isTouching = false;
                isTouched  = true;
                Debug.LogWarning(" **** TOUCHED PAD " + padNumber);
                gm.Advance();
                Debug.LogWarning(" **** MOVING ON to pad " + gm.nextPad);
            }
        }
    }