示例#1
0
 void SendRPC()
 {
     proxy.RPC(rpc.name, RpcTarget.All, rpc.@params); rpc = null;
     if (pauseWhenDone)
     {
         Debug.LogError("Done: " + GetType().Name);
     }
     ExecPostAction();
 }
示例#2
0
                   // Note: in general, an action such as attacking, grabbing, etc... has a
                   // duration which can be affected by a number of factors. Here the
                   // implementation is taking a shortcut by directly calling into an ad-hoc
                   // animation handler, and matching the action length to the animation
                   // length. For dependencies to be well formed:
                   // - message an event to indicate that the activity is starting.
                   // - retrieve the action duration from a dedicated delegate, which usually
                   // is (but needn't be) the animation handler.
                   protected void RPC(string m, params object[] p)
                   {
                       if (rpc != null)
                       {
                           return;
                       }
                       var   activity = m.Substring(2).ToLower();
                       var   handler  = this.Get <BasicAnimationHandler>();
                       float duration = 0;

                       if (handler)
                       {
                           duration = this.Get <BasicAnimationHandler>().Play(activity);
                       }
                       if (duration <= 0)
                       {
                           duration = defaultDuration;
                       }
                       rpc = new RPCParams(m, p);
                       Invoke("SendRPC", duration);
                   }
示例#3
0
 void OnDisable()
 {
     rpc = null; CancelInvoke(); postAction = null;
 }