Ejemplo n.º 1
0
 void NPC_AI_Died(GameObject deadUnit, UnitDiedEventArgs e)
 {
     Destroy(this);
     if (deadUnit)
     {
         Util.Destroy(deadUnit.GetComponents<NPC_BehaviorState>());
         currentState = null;
     }
 }
Ejemplo n.º 2
0
 void PlayerStatTracker_Died(GameObject deadUnit, UnitDiedEventArgs e)
 {
     deaths++;
 }
Ejemplo n.º 3
0
 void NPCStats_Died(GameObject deadUnit, UnitDiedEventArgs e)
 {
     Destroy(this.gameObject, 4.0f);
 }
Ejemplo n.º 4
0
 private void OnDeath(UnitDiedEventArgs unitDiedEventArgs)
 {
     if (Network.isServer)
     {
         networkView.RPC("NotifyDeath", RPCMode.All, unitDiedEventArgs.deathPosition, unitDiedEventArgs.killer.GetNetworkViewID(), unitDiedEventArgs.reward.experience, unitDiedEventArgs.reward.gold);
     }
 }
Ejemplo n.º 5
0
 private void Died_RewardPlayers(GameObject deadUnit, UnitDiedEventArgs e)
 {
     RewardPlayersInArea(e.deathPosition, e.killer, e.reward);
 }
Ejemplo n.º 6
0
    protected virtual void NotifyDeath(Vector3 deathPosition, NetworkViewID killer, int experience, int gold)
    {
        var e = new UnitDiedEventArgs() { reward = new KillReward(experience, gold), killer = killer.GetGameObject(), deathPosition = deathPosition };
        if (Died != null)
        {
            Died(gameObject, e);
        }

        killer.GetGameObject().GetCharacterStats().OnKilledUnit(new UnitKilledEventArgs() { deadUnit = this.gameObject, deathPosition = deathPosition });
    }
Ejemplo n.º 7
0
 void RelicHolder_Died(GameObject deadUnit, UnitDiedEventArgs e)
 {
     networkView.RPC("CommitDropRelic", RPCMode.All);
 }
Ejemplo n.º 8
0
 void GuardStats_Died(GameObject deadUnit, UnitDiedEventArgs e)
 {
     ShowDyingAnimation();
     Destroy(this.gameObject, 10f);
 }
Ejemplo n.º 9
0
 void NPC_Died(GameObject sender, UnitDiedEventArgs e)
 {
     NPCs.Remove(FindRecord(sender));
 }
 void NPCGenericAnimation_Died(GameObject deadUnit, UnitDiedEventArgs e)
 {
     StartDyingAnimation();
 }
Ejemplo n.º 11
0
 void EnemySearcher_Died(GameObject deadUnit, UnitDiedEventArgs e)
 {
     if (enemiesNearby.Contains(deadUnit.gameObject))
         enemiesNearby.Remove(deadUnit.gameObject);
 }
Ejemplo n.º 12
0
    void PlayerDied(GameObject sender, UnitDiedEventArgs e)
    {
        SetRespawnTimer();
        StartCoroutine(TimedDeathAnimation());

        if (gameObject.IsMyLocalPlayer())
        {
            PopupMessage.Display("You were killed by " + e.killer.name);
            gameObject.DisableControls();
            Camera.main.gameObject.GetComponent<BlurEffect>().enabled = true;
            Invoke("EnableRespawnCamera", 6.0f);
            return;
        }
        else
        {
            transform.FindChild("Name Label").GetComponent<CharacterLabel>().DisableLabels();
            if (Util.MyLocalPlayerObject.GetCharacterStats().TeamNumber != this.teamNumber)
            {
                PopupMessage.LocalDisplay(gameObject.name + " has been killed by " + e.killer.name + "!", 2.5f, 0, 1, 0);
            }
            else
            {
                PopupMessage.LocalDisplay(gameObject.name + " has been killed by " + e.killer.name + "!", 2.5f, 1, 0, 0);
            }
        }
    }
Ejemplo n.º 13
0
 void DeathEvent_Died(GameObject deadUnit, UnitDiedEventArgs e)
 {
     DeathEvent();
 }
Ejemplo n.º 14
0
 void characterStats_Died(GameObject deadUnit, UnitDiedEventArgs e)
 {
     this.enabled = false;
 }