示例#1
0
    private void onCellOwnerChanged(int row, int col, BoardGame.Cell.EOwner owner)
    {
        if (null == _player)
        {
            return;
        }

        BoardGamePlayer p = Manager.Instance.DT.BoardGamePlayer[_player.Id];

        setImage(p.idle);
    }
示例#2
0
    private Color getOwnerColor(BoardGame.Cell.EOwner owner)
    {
        switch (owner)
        {
        case BoardGame.Cell.EOwner.User:
            return(USER_COLOR);

        case BoardGame.Cell.EOwner.AI:
            return(AI_COLOR);

        case BoardGame.Cell.EOwner.Empty:
            return(EMPTY_COLOR);

        default:
            return(Color.clear);
        }
    }
示例#3
0
    private IEnumerator coloring(float waitSeconds, BoardGame.Cell.EOwner owner)
    {
        Color targetColor = getOwnerColor(owner);

        for (float alpha = 0.0f; alpha <= 1.0f; alpha += 0.3f)
        {
            Color c = new Color(targetColor.r, targetColor.g, targetColor.b, alpha);
            setColor(c);

            yield return(_waitForSeconds);
        }

        setColor(targetColor);

        // except case : initialize because of bingo
        if (owner != BoardGame.Cell.EOwner.Empty)
        {
            Manager.Instance.Object.BoardGameMode.JudgeIter();
        }
    }
示例#4
0
    private void onBoardUnitOwnerChanged(int row, int col, BoardGame.Cell.EOwner owner)
    {
        if (null == _cell)
        {
            return;
        }

        if ((_cell.Row != row) || (_cell.Col != col))
        {
            return;
        }

        if (gameObject.activeInHierarchy)
        {
            StartCoroutine(coloring(WAIT_SECONDS, owner));
        }
        else
        {
            Color c = getOwnerColor(owner);
            setColor(c);
        }
    }