コード例 #1
0
ファイル: DeathTransfer.cs プロジェクト: sknchan/LegacyRust
    private void Client_OnKilledShared(bool killedBy, Character attacker, ref uLink.NetworkMessageInfo info)
    {
        Controllable   controllable;
        bool           flag;
        AudioClipArray trait = base.GetTrait <CharacterSoundsTrait>().death;
        AudioClip      item  = trait[UnityEngine.Random.Range(0, trait.Length)];

        item.Play(base.transform.position, 1f, 1f, 10f);
        bool flag1 = base.localControlled;

        if (flag1)
        {
            base.rposLimitFlags = RPOSLimitFlags.KeepOff | RPOSLimitFlags.HideInventory | RPOSLimitFlags.HideContext | RPOSLimitFlags.HideSprites;
            DeathScreen.Show();
        }
        BaseHitBox remote = base.idMain.GetRemote <BaseHitBox>();

        if (remote)
        {
            remote.collider.enabled = false;
        }
        if (!killedBy || !attacker)
        {
            controllable = null;
            flag         = false;
        }
        else
        {
            controllable = attacker.controllable;
            flag         = (!controllable ? false : controllable.localPlayerControlled);
        }
        base.AdjustClientSideHealth(0f);
        if (flag1 || flag)
        {
            InterpTimedEvent.Queue(this, "ClientLocalDeath", ref info);
            if (!flag1)
            {
                InterpTimedEvent.Remove(this, true);
            }
            else
            {
                InterpTimedEvent.Clear(true);
            }
        }
        else
        {
            Collider[] componentsInChildren = base.GetComponentsInChildren <Collider>();
            for (int i = 0; i < (int)componentsInChildren.Length; i++)
            {
                Collider collider = componentsInChildren[i];
                if (collider)
                {
                    collider.enabled = false;
                }
            }
            InterpTimedEvent.Queue(this, "RAG", ref info);
            NetCull.DontDestroyWithNetwork(this);
        }
    }
コード例 #2
0
ファイル: DeathTransfer.cs プロジェクト: salvadj1/RustSource
    private void Client_OnKilledShared(bool killedBy, Character attacker, ref NetworkMessageInfo info)
    {
        Controllable   controllable;
        bool           flag2;
        AudioClipArray death = base.GetTrait <CharacterSoundsTrait>().death;

        death[Random.Range(0, death.Length)].Play(base.transform.position, (float)1f, (float)1f, (float)10f);
        bool localControlled = base.localControlled;

        if (localControlled)
        {
            base.rposLimitFlags = RPOSLimitFlags.HideSprites | RPOSLimitFlags.HideContext | RPOSLimitFlags.HideInventory | RPOSLimitFlags.KeepOff;
            DeathScreen.Show();
        }
        BaseHitBox remote = base.idMain.GetRemote <BaseHitBox>();

        if (remote != null)
        {
            remote.collider.enabled = false;
        }
        if (killedBy && (attacker != null))
        {
            controllable = attacker.controllable;
            flag2        = (controllable != null) && controllable.localPlayerControlled;
        }
        else
        {
            controllable = null;
            flag2        = false;
        }
        base.AdjustClientSideHealth(0f);
        if (!localControlled && !flag2)
        {
            foreach (Collider collider in base.GetComponentsInChildren <Collider>())
            {
                if (collider != null)
                {
                    collider.enabled = false;
                }
            }
            InterpTimedEvent.Queue(this, "RAG", ref info);
            NetCull.DontDestroyWithNetwork((MonoBehaviour)this);
        }
        else
        {
            InterpTimedEvent.Queue(this, "ClientLocalDeath", ref info);
            if (localControlled)
            {
                InterpTimedEvent.Clear(true);
            }
            else
            {
                InterpTimedEvent.Remove(this, true);
            }
        }
    }
コード例 #3
0
 protected void InterpDestroy(uLink.NetworkMessageInfo info)
 {
     if ((base.networkView != null) && base.networkView.isMine)
     {
         InterpTimedEvent.Remove(this, true);
     }
     else
     {
         InterpTimedEvent.Queue(this, "InterpDestroy", ref info);
         NetCull.DontDestroyWithNetwork((Facepunch.MonoBehaviour) this);
     }
 }
コード例 #4
0
 protected void InterpDestroy(uLink.NetworkMessageInfo info)
 {
     if (!base.networkView || !base.networkView.isMine)
     {
         InterpTimedEvent.Queue(this, "InterpDestroy", ref info);
         NetCull.DontDestroyWithNetwork(this);
     }
     else
     {
         InterpTimedEvent.Remove(this, true);
     }
 }
コード例 #5
0
 protected void OnDestroy()
 {
     try
     {
         InterpTimedEvent.Remove(this, true);
         this.ClearMods();
     }
     finally
     {
         this._parentViewID = uLink.NetworkViewID.unassigned;
         this.ClearSignals();
         base.OnDestroy();
     }
 }
コード例 #6
0
ファイル: BasicWildLifeAI.cs プロジェクト: Virobeast2/RCLIENT
 protected void OnDestroy()
 {
     InterpTimedEvent.Remove(this);
 }
コード例 #7
0
 public static void Remove(UnityEngine.MonoBehaviour receiver)
 {
     InterpTimedEvent.Remove(receiver, false);
 }