public void Play(GameObject shield, Material material, bool turnOn, DissolveCompleteDelegate OnCompleteCallback, ShieldBuildingInfo info) { if (this.done && this.turnOn == turnOn) { return; } this.shield = shield; this.shieldMaterial = material; this.turnOn = turnOn; this.info = info; this.onComplete = OnCompleteCallback; if (this.done && this.shieldMaterial != null) { this.done = false; if (turnOn) { this.dissolveTime = 0f; this.delayActive = true; this.delayTime = 0.25f; this.shieldMaterial.SetFloat("_Dissolve", 1f); } else { this.dissolveTime = 0.75f; this.shieldMaterial.SetFloat("_Dissolve", 0f); } Service.Get <ViewTimeEngine>().RegisterFrameTimeObserver(this); } }
public void Cleanup() { this.shield = null; this.shieldMaterial = null; this.onComplete = null; this.info = null; Service.Get <ViewTimeEngine>().UnregisterFrameTimeObserver(this); }
public void PlayShieldDisolveEffect(bool turnOn, DissolveCompleteDelegate OnCompleteCallback) { this.ShieldDisolveEffect.Play(this.Shield, this.ShieldMaterial, turnOn, OnCompleteCallback, this); }