Ejemplo n.º 1
0
 public override void OnCreate()
 {
     leftPlatform  = SceneManager.currentScene.FindGameObject("leftPlatform").GetComponent <Pong>();
     rightPlatform = SceneManager.currentScene.FindGameObject("rightPlatform").GetComponent <Pong>();
     score         = SceneManager.currentScene.FindGameObject("score").GetComponent <PongScore>();
     shape         = gameObject.GetComponent <TextShape>();
     //         SetPosition();
 }
Ejemplo n.º 2
0
 public override void OnCreate()
 {
     ball  = SceneManager.currentScene.FindGameObject("ball");
     shape = gameObject.GetComponent <TextShape>();
     if (isLeftPlayer)
     {
         gameObject.position = new Vector2(0, GraphicsManager.height / 2);
     }
     else
     {
         gameObject.position = new Vector2(GraphicsManager.width - 1, GraphicsManager.height / 2);
     }
 }
Ejemplo n.º 3
0
 public override void OnCreate()
 {
     gameObject.position = new Vector2(GraphicsManager.width / 2, GraphicsManager.height / 2);
     if (gameObject.GetComponent <TextShape>() == null)
     {
         scoreShape = gameObject.AddComponent <TextShape>();
         SetShapeNumber();
     }
     else
     {
         scoreShape = gameObject.GetComponent <TextShape>();
     }
 }