Beispiel #1
0
    private void ResumeGame()
    {
        blackImage.SetActive(false);
        Time.timeScale = 1.0f;

        playDelegate = RestartMatch;
    }
Beispiel #2
0
    private void ConfirmTeam()
    {
        if (lastPlayerTeam != null)
        {
            if (playerTurnPick)
            {
                playerTurnPick     = false;
                playerLabel.sprite = otherSprites[0];
                AILabel.sprite     = otherSprites[1];
            }
            else
            {
                if (lastAITeam != null)
                {
                    readyForGame   = true;
                    playBtn.sprite = play;
                    playBtn.SetNativeSize();

                    playDelegate = ShowCharacter;

                    SetCharacterForAI();
                    ShowCharacters();
                }
            }
        }
    }
Beispiel #3
0
    private void RestartMatch()
    {
        GameController.Instance.RestartMatch();
        Time.timeScale = 0.0f;

        blackImage.SetActive(true);

        playDelegate = ResumeGame;
    }
Beispiel #4
0
    private void ShowCharacter()
    {
        teamsBoard.SetActive(false);
        team.SetActive(true);

        playDelegate = StartGame;
        backDelegate = ShowBoard;

        GameController.Instance.ChangeSkyColor();
    }
Beispiel #5
0
    private void PlayGame()
    {
        opening.SetActive(false);
        teamsBoard.SetActive(true);

        playDelegate = ConfirmTeam;
        backDelegate = RemoveTeams;

        GameController.Instance.ChangeSkyColor();
    }
Beispiel #6
0
    private void StartGame()
    {
        team.SetActive(false);
        inGame.SetActive(true);
        blackImage.SetActive(true);

        playDelegate = ResumeGame;
        backDelegate = ShowBoard;

        GameController.Instance.ChangeSkyColor();
        GameController.Instance.StartGame();

        Time.timeScale = 0.0f;
    }
Beispiel #7
0
    private void ShowBoard()
    {
        team.SetActive(false);
        inGameButtons.SetActive(false);
        inGame.SetActive(false);
        teamsBoard.SetActive(true);

        GameController.Instance.SetObjectsInMatch(false);
        RemoveTeams();

        playDelegate = ConfirmTeam;
        backDelegate = RemoveTeams;

        GameController.Instance.ChangeSkyColor();
    }
Beispiel #8
0
    private void RemoveTeams()
    {
        playerTurnPick = true;
        readyForGame   = false;

        if (lastPlayerTeam != null)
        {
            lastPlayerTeam.sprite = off;
            lastPlayerTeam        = null;
        }

        if (lastAITeam != null)
        {
            lastAITeam.sprite = off;
            lastAITeam        = null;
        }

        playerLabel.sprite      = otherSprites[1];
        AILabel.sprite          = otherSprites[0];
        chosenPlayerTeam.sprite = teamEmpty;
        chosenAITeam.sprite     = teamEmpty;
        playBtn.sprite          = check;
        playBtn.SetNativeSize();

        playDelegate = ConfirmTeam;

        // Deactivate characters
        for (var i = 7; i >= 0; i--)
        {
            characters[i].body.transform.parent.gameObject.SetActive(false);
        }

        if (lastCheckMark != null)
        {
            lastCheckMark.SetActive(false);
        }
    }
Beispiel #9
0
 static extern void InitNative(PosDelegate cb, RotDelegate cb2, PlayDelegate cb3, BroadDelegate cb4);
Beispiel #10
0
        /// <summary>
        /// Binds the class instance methods to the dll functions.
        /// </summary>
        /// <param name="hDll">A dll to bind to.</param>
        private void BindToDll(IntPtr hDll)
        {
            IntPtr pProcPtr = GetProcAddress(hDll, "Initialize");
            _initialize =
                (InitializeDelegate)Marshal.GetDelegateForFunctionPointer(pProcPtr, typeof(InitializeDelegate));

            pProcPtr = GetProcAddress(hDll, "Open");
            _open =
                (OpenDelegate)Marshal.GetDelegateForFunctionPointer(pProcPtr, typeof(OpenDelegate));

            pProcPtr = GetProcAddress(hDll, "Play");
            _play =
                (PlayDelegate)Marshal.GetDelegateForFunctionPointer(pProcPtr, typeof(PlayDelegate));

            pProcPtr = GetProcAddress(hDll, "GetCurrentFrame");
            _getCurrentFrame =
                (GetCurrentFrameDelegate)Marshal.GetDelegateForFunctionPointer(pProcPtr,
                typeof(GetCurrentFrameDelegate));

            pProcPtr = GetProcAddress(hDll, "GetFrameSize");
            _getFrameSize =
                (GetFrameSizeDelegate)Marshal.GetDelegateForFunctionPointer(pProcPtr,
                typeof(GetFrameSizeDelegate));

            pProcPtr = GetProcAddress(hDll, "Stop");
            _stop =
                (StopDelegate)Marshal.GetDelegateForFunctionPointer(pProcPtr, typeof(StopDelegate));

            pProcPtr = GetProcAddress(hDll, "Uninitialize");
            _uninitialize = (UninitializeDelegate)Marshal.GetDelegateForFunctionPointer(pProcPtr, typeof(UninitializeDelegate));
        }
Beispiel #11
0
 static extern void InitNative(int rate, string assets, PosDelegate cb, CreateRoleDelegate cb2, PlayDelegate cb3, LogDelegate cb4);