示例#1
0
    // Use this for initialization
    void Start()
    {
        if (stream != null)
        {
            Debug.Log("Stream opened");
            stream.Write("4");
            receivedData = stream.ReadLine();

            leftPaddlePosLastFrame  = (System.Convert.ToInt32(receivedData.Substring(18, 4), 16) - 2048f) / 2048f;
            rightPaddlePosLastFrame = (System.Convert.ToInt32(receivedData.Substring(13, 4), 16) - 2048) / 2048f;
        }

        pongLogic = Camera.main.GetComponent <PongLogic>();
    }
    private void LaunchGame()
    {
        OT.Print("MiniGameLaunch Button Clicked");

        if (gameToLaunch == "Pong")
        {
            // To be triggered to become dynamic for next step
            PongLogic logic = GameObject.Find(gameToLaunch).GetComponent <PongLogic>();

            logic.gameEndCallback = onGameEnd;
            logic.StartGame();

            gameLaunchSprite.visible = false;
            Constants.stageLocked    = true;
        }
    }