예제 #1
0
 public void editedStart()
 {
     CardLogicParent    = transform.parent.GetComponent <cardLogic>();
     CardLogicParent.CM = this;
     AlertImg           = CardLogicParent.AlertImg;
     VotedImg           = CardLogicParent.VotedImg;
 }
예제 #2
0
    private void setDeadCard(GameObject card, cardLogic cl)
    {
        Debug.Log("set dead card working here");
        card.GetComponent <Button>().interactable = false;
        var colorBlock = card.GetComponent <Button>().colors;

        colorBlock.disabledColor = Color.gray;
        cl.DeadImg.enabled       = true;
        cl.startBlockPanel();
    }
예제 #3
0
    // Start is called before the first frame update
    void Start()
    {
        pv = GetComponent <PhotonView>();

        _allPlayerManagers = new List <newPlayerManager>();
        playersGameObjects = GameObject.FindGameObjectsWithTag("Player");



        foreach (var p in playersGameObjects)
        {
            _allPlayerManagers.Add(p.GetComponent <newPlayerManager>());
            var card = Instantiate(PlayerCardPrefab, Vector3.zero, Quaternion.identity, PlayesGrid);
            // var card = PhotonNetwork.Instantiate("PlayerVoteCard", new Vector3(0, 0, 0), Quaternion.identity);

            cardLogic        cl = card.GetComponent <cardLogic>();
            newPlayerManager pm = p.GetComponent <newPlayerManager>();
            pm.voteManager        = this;
            cl.characterImg.color = pm.myAvatarSprite.color;
            cl.ChaNameTxt.text    = pm.playerNameText.text;
            cl.thisPlayer         = pm;
            cl.VM         = this;
            cl.BlockPanel = BlockPanel;
            cl.startBlockPanel();
            pm.CardLogic = cl;

            if (pm.report)
            {
                cl.AlertImg.enabled = true;
            }

            allCardsList.Add(cl);

            // setting the right of vote
            if (pm.isDead)
            {
                setDeadCard(card, cl);
            }
            else
            {
                CanVoteNbr++;
            }
        }
        pv.RPC("cardsCountUpdate", RpcTarget.All);
    }