示例#1
0
    private void Start()
    {
        if (hasAuthority)
        {
            InventoryUI        inventory    = GetGameObjectInRoot("Canvas").GetComponent <InventoryUI>();
            BuildInterfaceUI   build        = GetGameObjectInRoot("Canvas").GetComponent <BuildInterfaceUI>();
            ResurrectionMenuUI resurrection = GetGameObjectInRoot("Canvas").GetComponent <ResurrectionMenuUI>();
            inventory.InitializeInventoryUI(this.gameObject);
            build.InitializeInventoryUI(this.gameObject);
            resurrection.InizializeInventoryUI(this.gameObject);

            //CmdSetTeam();
        }
        SetSpriteColor();
    }
示例#2
0
    public override void ClientPreInteract(PlayerChestManager p)
    {
        Color              team             = p.gameObject.GetComponent <PlayerManager>().GetTeam();
        List <PlayerInfo>  deadAlly         = MatchManager._instance.DeadPlayerList(team);
        ResurrectionMenuUI resurrectionMenu = GetGameObjectInRoot("Canvas").GetComponentInChildren <ResurrectionMenuUI>(true);

        p.waitingUser = true;

        resurrectionMenu.Open();

        if (!IsInteractable(p)) // No dead ally
        {
            resurrectionMenu.SetSubTitle("No dead ally to resurrect");
        }
        else
        {
            resurrectionMenu.SetSubTitle("Select one ally to resurrect");
        }

        foreach (PlayerInfo ally in deadAlly)
        {
            resurrectionMenu.AddResurrectButton(ally.pname);
        }
    }