예제 #1
0
    public void UpdateGrimoire()
    {
        Vector2 pos2d         = RoleTokenAttach.GetComponent <RectTransform>().anchoredPosition;
        int     townSize      = RoleTokens.Count;
        float   angleDivision = (2.0f * Mathf.PI) / townSize;

        for (int i = 0; i < townSize; ++i)
        {
            Vector2       dir   = RotateVector(Vector2.up, -angleDivision * i);
            GrimoireToken token = RoleTokens[i].GetComponentInChildren <GrimoireToken>();
            token.SetTargetPos(pos2d + (dir * TownRadius));
        }

        SetPlayerNamesVisible(PlayerNamesVisible);
    }
예제 #2
0
    public void AddBluffToken(RoleData roleData)
    {
        GameObject tokenObj = Instantiate(RoleTokenPrefab);

        tokenObj.transform.SetParent(BluffTokenAttach.transform);
        tokenObj.GetComponent <RectTransform>().anchoredPosition = Vector2.zero;

        GrimoireToken grimoireToken = tokenObj.GetComponentInChildren <GrimoireToken>();

        grimoireToken.name = "BluffToken:" + roleData.RoleName;
        grimoireToken.SetUseTargetPos(false);
        grimoireToken.SetRoleData(roleData);
        grimoireToken.SetTargetPos(grimoireToken.transform.position);
        grimoireToken.transform.localScale = Vector3.one * 0.75f;
        grimoireToken.SetIsBluffToken();
        BluffTokens.Add(grimoireToken);
    }