// Start is called before the first frame update void Start() { //eastEdge = eastWall.GetComponent<BoxCollider>().center - eastWall.GetComponent<BoxCollider>().size; //westEdge = westWall.GetComponent<BoxCollider>().center + westWall.GetComponent<BoxCollider>().size; //Debug.Log("Bounds are " + westEdge + " and " + eastEdge + "."); leftBound = -2.24f; rightBound = 2.23f; size = PaddleSize.Large; }
/// /// Makes the paddle wider by switching to a bigger sprite. /// public void MakeBigger() { if (size == PaddleSize.Small) { texture = NormalTexture; size = PaddleSize.Normal; } else if (size == PaddleSize.Normal) { texture = BigTexture; size = PaddleSize.Big; } }
/// /// Makes the paddle smaller by switching to a smaller sprite. /// public void MakeSmaller() { if (size == PaddleSize.Big) { texture = NormalTexture; size = PaddleSize.Normal; } else if (size == PaddleSize.Normal) { texture = SmallTexture; size = PaddleSize.Small; } }
public void ResizePaddle(PaddleSize pSize) { if (pSize.Equals(PaddleSize.Large)) { leftBound = -2.24f; rightBound = 2.23f; this.transform.localScale = new Vector3(6.210636f, 0.1491342f, 0.5984464f); } if (pSize.Equals(PaddleSize.Medium)) { leftBound = -3.57f; rightBound = 3.56f; this.transform.localScale = new Vector3(3.530974f, 0.1491342f, 0.5984464f); } if (pSize.Equals(PaddleSize.Small)) { leftBound = -4.38f; rightBound = 4.39f; this.transform.localScale = new Vector3(1.92535f, 0.1491342f, 0.5984464f); } }