public void StopMining() { ExcavatorServerEffects.SetMining(false); CancelInvoke(ProduceResources); if (HasFlag(Flags.On)) { Facepunch.Rust.Analytics.ExcavatorStopped(GetNetworkTime() - excavatorStartTime); } SetFlag(Flags.On, false); Interface.CallHook("OnExcavatorMiningToggled", this); }
public void BeginMining() { if (IsPowered()) { SetFlag(Flags.On, true); InvokeRepeating(ProduceResources, resourceProductionTickRate, resourceProductionTickRate); ExcavatorServerEffects.SetMining(true); Facepunch.Rust.Analytics.ExcavatorStarted(); excavatorStartTime = GetNetworkTime(); Interface.CallHook("OnExcavatorMiningToggled", this); } }
public void Awake() { instance = this; SetMining(false, true); }
public void OnDestroy() { instance = null; }