Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (Vector3.SqrMagnitude(transform.position - squirrel.transform.position) < TREE_SIZE)
     {
         squirrel.ReportTreeContact(this);
     }
     if (wobbleTimer > 0)
     {
         wobbleTimer -= Time.deltaTime * 3;
         if (wobbleTimer < 0)
         {
             wobbleTimer = 0;
         }
         transform.rotation = Quaternion.Euler(0, 0, Mathf.Sin(wobbleTimer * 20) * (wobbleTimer * 10));
     }
     if (Time.frameCount % 8 < 4)
     {
         priceText.color = Color.yellow;
     }
     else
     {
         priceText.color = Color.red;
     }
 }