// 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; }
private void OnTriggerExit2D(Collider2D collision) { if ((collision.CompareTag(ballTag)) && (lastMoveRight.HasValue)) { BallRoller roller = collision.GetComponent <BallRoller>(); if (roller) { roller.MoveRight = lastMoveRight.Value; lastMoveRight = null; } } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag(ballTag)) { BallRoller roller = collision.GetComponent <BallRoller>(); if (roller) { lastMoveRight = roller.MoveRight; roller.MoveRight = moveRight; } } }