// Start is called before the first frame update
 void Start()
 {
     sphere = GameObject.FindWithTag("Sphere");
     cube   = GameObject.FindWithTag("Cube");
     //cube.SetActive(false);
     spInfo = sphere.GetComponent <BallRoller>();
     cube.transform.localScale = new Vector3(0.0f, 0.0f, 0.0f);
     respawn = false;
 }
Exemple #2
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if ((collision.CompareTag(ballTag)) && (lastMoveRight.HasValue))
     {
         BallRoller roller = collision.GetComponent <BallRoller>();
         if (roller)
         {
             roller.MoveRight = lastMoveRight.Value;
             lastMoveRight    = null;
         }
     }
 }
Exemple #3
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag(ballTag))
     {
         BallRoller roller = collision.GetComponent <BallRoller>();
         if (roller)
         {
             lastMoveRight    = roller.MoveRight;
             roller.MoveRight = moveRight;
         }
     }
 }