private ReferenceCountedCoroutine(Facepunch.Load.Utility.ReferenceCountedCoroutine.Runner runner, Facepunch.Load.Utility.ReferenceCountedCoroutine.Callback callback, object yieldInstruction, object tag, bool skipOnce) { this.runner = runner; this.callback = callback; this.yieldInstruction = yieldInstruction; this.tag = tag; this.skipOnce = skipOnce; }
public void Retain() { Facepunch.Load.Utility.ReferenceCountedCoroutine.Runner runner = this; int num = runner.refCount; int num1 = num; runner.refCount = num + 1; if (num1 == 0) { this.go = new GameObject(this.gameObjectName, new Type[] { typeof(Facepunch.MonoBehaviour) }); UnityEngine.Object.DontDestroyOnLoad(this.go); this.script = this.go.GetComponent <Facepunch.MonoBehaviour>(); } }
public void Release() { Facepunch.Load.Utility.ReferenceCountedCoroutine.Runner runner = this; int num = runner.refCount - 1; int num1 = num; runner.refCount = num; if (num1 == 0) { UnityEngine.Object.Destroy(this.go); UnityEngine.Object.Destroy(this.script); this.go = null; this.script = null; } }