コード例 #1
0
 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);
     }
 }
コード例 #2
0
 public void Cleanup()
 {
     this.shield         = null;
     this.shieldMaterial = null;
     this.onComplete     = null;
     this.info           = null;
     Service.Get <ViewTimeEngine>().UnregisterFrameTimeObserver(this);
 }
コード例 #3
0
 public void PlayShieldDisolveEffect(bool turnOn, DissolveCompleteDelegate OnCompleteCallback)
 {
     this.ShieldDisolveEffect.Play(this.Shield, this.ShieldMaterial, turnOn, OnCompleteCallback, this);
 }