Beispiel #1
0
 private void Refresh()
 {
     this.implementation  = this._implementation;
     this._implementation = null;
     this.act             = this.implementation as IActivatable;
     this.canAct          = this.act != null;
     if (!this.canAct)
     {
         Debug.LogWarning("implementation is null or does not implement IActivatable", this);
     }
     else
     {
         this.actToggle = this.implementation as IActivatableToggle;
         this.canToggle = this.actToggle != null;
         IActivatableFill activatableFill = this.implementation as IActivatableFill;
         if (activatableFill != null)
         {
             activatableFill.ActivatableChanged(this, true);
         }
         IActivatableInfo activatableInfo = this.implementation as IActivatableInfo;
         if (activatableInfo != null)
         {
             activatableInfo.ActInfo(out this.info);
         }
     }
 }
Beispiel #2
0
 private void OnDestroy()
 {
     if (this.implementation)
     {
         IActivatableFill activatableFill = this.implementation as IActivatableFill;
         if (activatableFill != null)
         {
             activatableFill.ActivatableChanged(this, false);
         }
     }
     this.implementation = null;
     this.canAct         = false;
     this.canToggle      = false;
     this.act            = null;
     this.actToggle      = null;
     this.info           = new ActivatableInfo();
 }