public GrimoireToken AddToken(RoleData roleData) { GameObject tokenObj = Instantiate(RoleTokenPrefab); tokenObj.transform.SetParent(RoleTokenAttach.transform); tokenObj.GetComponent <RectTransform>().anchoredPosition = Vector2.zero; GrimoireToken grimoireToken = tokenObj.GetComponentInChildren <GrimoireToken>(); grimoireToken.name = "RoleToken:" + roleData.RoleName; grimoireToken.SetRoleData(roleData); if (roleData.AddToGrimoire) { RoleTokens.Add(grimoireToken); } else { HiddenTokens.Add(grimoireToken); } UpdateGrimoire(); UpdateRoleCounts(); return(grimoireToken); }
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); }