Exemple #1
0
    // Start is called before the first frame update
    void Start()
    {
        GenerateBoard();
        GenerateValues();
        Button mov1    = Move1.GetComponent <Button>();
        Button mov2    = Move2.GetComponent <Button>();
        Button back    = BackUp.GetComponent <Button>();
        Button left    = TurnLeft.GetComponent <Button>();
        Button right   = TurnRight.GetComponent <Button>();
        Button turn180 = UTurn.GetComponent <Button>();

        mov1.onClick.AddListener(MovePlayer1);
        mov2.onClick.AddListener(MovePlayer2);
        back.onClick.AddListener(BackPlayerUp);
        left.onClick.AddListener(TurnPlayerLeft);
        right.onClick.AddListener(TurnPlayerRight);
        turn180.onClick.AddListener(TurnPlayerU);

        player.GetComponent <PlayerManager>().ai = ai;
        ai.GetComponent <AIManager>().player     = player;

        endCanvas.SetActive(false);
        normalCanvas.SetActive(true);
    }