Exemplo n.º 1
0
        //a method called when the faction entity's health has been updated:
        public virtual void OnHealthUpdated(int value, FactionEntity source)
        {
            if (value < 0.0)
            {
                //if this is the local player's faction ID and the attack warning manager is active:
                if (factionEntity.FactionID == GameManager.PlayerFactionID)
                {
                    gameMgr.AttackWarningMgr?.Add(transform.position); //show attack warning on minimap
                }
            }

            CustomEvents.OnFactionEntityHealthUpdated(factionEntity, value, source); //trigger custom event
        }