private void RemoveCrate(LockedByEntCrate crate) { if (crate == null || (crate?.IsDestroyed ?? true)) { return; } crate.Kill(); }
private void UnlockCrate(LockedByEntCrate crate) { if (crate == null || (crate?.IsDestroyed ?? true)) { return; } var lockingEnt = (crate?.lockingEnt != null) ? crate.lockingEnt.GetComponent <FireBall>() : null; if (lockingEnt != null && !(lockingEnt?.IsDestroyed ?? true)) { lockingEnt.enableSaving = false; //again trying to fix issue with savelist lockingEnt.CancelInvoke(lockingEnt.Extinguish); lockingEnt.Invoke(lockingEnt.Extinguish, 30.0f); } crate.CancelInvoke(crate.Think); crate.SetLocked(false); crate.lockingEnt = null; }