public void Interact(PlayerChestManager p) { if (IsInteractable(p)) { if (DoSomething(p)) { RpcDestroy(); } } }
public virtual bool IsInteractable(PlayerChestManager p) { Color team = p.gameObject.GetComponent <PlayerManager>().GetTeam(); if (NumberOfPlayerIntheRay(team) >= level) { return(true); } return(false); }
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); }
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); } }
internal void InizializeInventoryUI(GameObject player) { p = player.GetComponent <PlayerChestManager>(); }
internal bool DoSomething(PlayerChestManager p) { p.gameObject.GetComponent <PlayerWeaponManager_Inventory>().CmdAddWeapon(Weapon, p.gameObject); return(true); }
internal bool DoSomething(PlayerChestManager p) { p.LifeChest(25); return(true); }
public virtual void ClientPreInteract(PlayerChestManager p) { p.waitingUser = false; return; }
internal abstract bool DoSomething(PlayerChestManager p);
public override bool IsInteractable(PlayerChestManager p) { Color team = p.gameObject.GetComponent <PlayerManager>().GetTeam(); return(base.IsInteractable(p) && (MatchManager._instance.PlayerDeadNumber(team) > 0)); }