private void ToggleInteractable() { if (!GameManager.instance.MatchStarted) { return; } Ui.SendLimitText.text = _sendLimit.ToString(); //while (_sendLimit > 0) //{ // if (_sendLimit == 0 || !CanAffordItem(_player.GetComponent<PlayerMatchData>().PlayerGold, _creepCost)) // { // Button.interactable = false; // continue; // } // Button.interactable = true; //} if (GameManager.instance.MatchEnd) { return; } if (_sendLimit == 0 || !CanAffordItem(_player.GetComponent <PlayerMatchData>().PlayerGold, _creepCost)) { Button.interactable = false; } else { Button.interactable = true; } }
/// <summary> /// This can be called with KillFeed.ReportMurder(GameObject, DeathMode) /// This will set all variables for the coroutine to actually update the UI/HUD with the correct kill feed report /// </summary> /// <param name="Killer">The gameObject who killed the other player</param> /// <param name="method">The method of killing the player used against the other player</param> public static void ReportMurder(PhotonPlayer Killer, DeathMethod method) { bool isYou = Killer != PhotonNetwork.player; //"killer" is player who got killed killer = isYou ? "You" : Killer.nickname; action = method.ToString(); target = !isYou ? "You" : Killer.nickname; //this would be modified to however you store your weapon logic. This is how I store mine instrument = Killer.GetComponent <WeaponManager>().weapon.icon; //NOTE: You can take this logic and modify it in a way to only use 1 UI Text and death method, to create //funny scenarios such as games like Fortnite "Player spantaniously combusted", "Player got absolutely rekt", etc }
private IEnumerator GetOwnerMatchData() { yield return(new WaitUntil(() => Owner != null)); _ownerMatchData = Owner.GetComponent <PlayerMatchData>(); }
private void ToggleInteractable() { Button.interactable = CanAffordItem(Owner.GetComponent <PlayerMatchData>().PlayerGold, _towerCost); }
public void BuyTower(int towerCost) { Owner.GetComponent <PlayerMatchData>().PlayerGold -= towerCost; Owner.GetComponent <PlayerMatchData>().TowersBuilt++; }