public void Clear() { if (splat != null) { AudioEventManager.Get().ClearNoiseSplat(splat); splat.Clear(); splat = null; } }
public void SetActive(bool active = true) { if (!active && splat != null) { AudioEventManager.Get().ClearNoiseSplat(splat); splat.Clear(); } this.active = active; }
public void SetSplat(NoiseSplat new_splat) { if (new_splat == null && splat != null) { Clear(); } splat = new_splat; if (splat != null) { AudioEventManager.Get().AddSplat(splat); } }
public void Refresh() { if (active) { if (splat != null) { AudioEventManager.Get().ClearNoiseSplat(splat); splat.Clear(); } KSelectable component = GetComponent <KSelectable>(); string name = (!((UnityEngine.Object)component != (UnityEngine.Object)null)) ? base.name : component.GetName(); GameObject gameObject = GetComponent <KMonoBehaviour>().gameObject; splat = AudioEventManager.Get().CreateNoiseSplat(GetPosition(), noise, radius, name, gameObject); } }
protected override void OnCleanUp() { base.OnCleanUp(); if (base.isSpawned) { if (dB != null) { AttributeInstance attributeInstance = dB; attributeInstance.OnDirty = (System.Action)Delegate.Remove(attributeInstance.OnDirty, refreshCallback); AttributeInstance attributeInstance2 = dBRadius; attributeInstance2.OnDirty = (System.Action)Delegate.Remove(attributeInstance2.OnDirty, refreshCallback); } if (isMovable) { Singleton <CellChangeMonitor> .Instance.UnregisterCellChangedHandler(base.transform, OnCellChange); } } if (splat != null) { AudioEventManager.Get().ClearNoiseSplat(splat); splat.Clear(); } }