示例#1
0
 protected virtual void Awake()
 {
     // check to see if the model variable is empty
     if (!model)
     {
         // if it is then get the model attached to the current GameObject
         model = this.gameObject.GetComponent <AimProxyModel>();
     }
 }
示例#2
0
 protected virtual void Awake()
 {
     // check to see if the model variable is empty
     if (!model)
     {
         // if it is then get the model attached to the current GameObject
         model = this.gameObject.GetComponent <AimProxyModel>();
     }
     // subscribe to even that updates
     model.onProgressUpdated += ChangePosition;
 }
 protected virtual void Awake()
 {
     // check to see if the model variable is empty
     if (!model)
     {
         // if it is then get the model attached to the current GameObject
         model = this.gameObject.GetComponent <AimProxyModel>();
     }
     KeyboardInputObserver.onKeyDown += (KeyboardInputParameters param) => {
         if (param.keyCode == KeyCode.I)
         {
             model.StartProgressUpdateLoop();
         }
     };
     KeyboardInputObserver.onKeyUp += (KeyboardInputParameters param) => {
         if (param.keyCode == KeyCode.I)
         {
             model.EndProgressUpdateLoop();
         }
     };
 }