コード例 #1
0
 public void Interact(PlayerChestManager p)
 {
     if (IsInteractable(p))
     {
         if (DoSomething(p))
         {
             RpcDestroy();
         }
     }
 }
コード例 #2
0
    public virtual bool IsInteractable(PlayerChestManager p)
    {
        Color team = p.gameObject.GetComponent <PlayerManager>().GetTeam();

        if (NumberOfPlayerIntheRay(team) >= level)
        {
            return(true);
        }
        return(false);
    }
コード例 #3
0
    internal override bool DoSomething(PlayerChestManager p)
    {
        Color             team     = p.gameObject.GetComponent <PlayerManager>().GetTeam();
        List <PlayerInfo> deadAlly = MatchManager._instance.DeadPlayerList(team);

        foreach (PlayerInfo ally in deadAlly)
        {
            if (ally.pname == p.allyToResurrect)
            {
                ally.status             = PlayerInfo.Status.alive;
                ally.transform.position = gameObject.transform.position;
                ally.CmdResurrect(gameObject.transform.position);
                p.allyToResurrect = null;
                p.gameObject.GetComponent <PlayerManager>().controller.GetComponent <PlayerInfo>().resurrectedAlly += 1;
                return(true);
            }
        }
        return(false);
    }
コード例 #4
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);
        }
    }
コード例 #5
0
 internal void InizializeInventoryUI(GameObject player)
 {
     p = player.GetComponent <PlayerChestManager>();
 }
コード例 #6
0
 internal bool DoSomething(PlayerChestManager p)
 {
     p.gameObject.GetComponent <PlayerWeaponManager_Inventory>().CmdAddWeapon(Weapon, p.gameObject);
     return(true);
 }
コード例 #7
0
ファイル: LifeChest.cs プロジェクト: mauu95/WeaponsBrawl
 internal bool DoSomething(PlayerChestManager p)
 {
     p.LifeChest(25);
     return(true);
 }
コード例 #8
0
 public virtual void ClientPreInteract(PlayerChestManager p)
 {
     p.waitingUser = false;
     return;
 }
コード例 #9
0
 internal abstract bool DoSomething(PlayerChestManager p);
コード例 #10
0
    public override bool IsInteractable(PlayerChestManager p)
    {
        Color team = p.gameObject.GetComponent <PlayerManager>().GetTeam();

        return(base.IsInteractable(p) && (MatchManager._instance.PlayerDeadNumber(team) > 0));
    }