예제 #1
0
    public void FlipPiece(int x, int y, int newPlayerCode)
    {
        Debug.Assert(pieces[x, y] != null);

        PlayerPiece p = pieces[x, y];

        var punchTween = p.transform.DOScale(new Vector3(0, 1.5f, 1f), 0.15f);

        // //After the punch make sure it resets to the original scale.
        punchTween.OnComplete(() =>
        {
            if (newPlayerCode == 0)
            {
                p.mainSprite.color    = playerOneColor;
                p.outlineSprite.color = playerOneAccent;
            }
            else
            {
                p.mainSprite.color    = playerTwoColor;
                p.outlineSprite.color = playerTwoAccent;
            }
            p.SetShape(newPlayerCode);

            p.transform.DOScale(Vector3.one, 0.15f);
        });
    }
예제 #2
0
    public void FlipPiece(int x, int y, int newPlayerCode)
    {
        Debug.Assert(pieces[x, y] != null);

        PlayerPiece p = pieces[x, y];

        p.transform.DOPunchScale(new Vector3(0.5f, 0.5f, 1f), 0.2f);

        if (newPlayerCode == 0)
        {
            p.mainSprite.color    = playerOneColor;
            p.outlineSprite.color = playerOneAccent;
        }
        else
        {
            p.mainSprite.color    = playerTwoColor;
            p.outlineSprite.color = playerTwoAccent;
        }
        p.SetShape(newPlayerCode);
    }
예제 #3
0
    public void AddPiece(int x, int y, int player)
    {
        Debug.Log("adding: " + x + "," + y);
        PlayerPiece p = Instantiate(templatePlayerPiece);

        if (player == 0)
        {
            p.mainSprite.color    = playerOneColor;
            p.outlineSprite.color = playerOneAccent;
        }
        else
        {
            p.mainSprite.color    = playerTwoColor;
            p.outlineSprite.color = playerTwoAccent;
        }

        pieces[x, y] = p;

        p.transform.position = new Vector3(x, y, 1);

        p.SetShape(player);
    }
예제 #4
0
    public void AddPiece(int x, int y, int player)
    {
        Debug.Log("adding: " + x + "," + y);
        PlayerPiece p = Instantiate(templatePlayerPiece);

        if (player == 0)
        {
            p.mainSprite.color    = playerOneColor;
            p.outlineSprite.color = playerOneAccent;
        }
        else
        {
            p.mainSprite.color    = playerTwoColor;
            p.outlineSprite.color = playerTwoAccent;
        }

        pieces[x, y] = p;

        p.transform.position = new Vector3(x, y, 1);

        p.SetShape(player);
        //GFEE.Instance.TriggerCustomEvent("AddPiece"+Player.id, gameObject, pos, direction);
    }