public void MoveUp(GameObject p_obj) { ObjCmdManager.NewCmd <ObjMover, Vector3>(p_obj, new Vector3(0, 10, 0), true, 1f); // ObjCmdManager.NewCmd<ObjActiver,bool>(p_obj,false,false,2f); // ObjCmdManager.NewCmd<ObjActiver,bool>(p_obj,true,false,3f); // ObjCmdManager.NewCmd<ObjDeleter>(p_obj,false,4f); }
/// <summary> /// 依預設參數,在[延遲時間]後執行 /// </summary> /// <param name="p_arg">延遲時間,-1 時使用預設值</param> public bool DoCmd(float p_time = -1) { if (p_time < 0) { if (delayTime < 0) { Debug.LogError(gameObject.name + " ObjCmd delayTime : " + delayTime + " less than 0"); return(DoCmd(0)); } return(DoCmd(delayTime)); } else if (p_time > 0) { coroutine = ObjCmdManager.DoCmdDefaultLater(p_time, this); return(true); } return(CheckCmdResult(CmdDefault())); }
/// <summary> /// 依[命令參數],在[延遲時間]後執行 /// </summary> /// <param name="p_arg">命令參數</param> /// <param name="p_arg">延遲時間,-1 時使用預設值</param> public bool DoCmd(T p_arg, float p_time = -1) { if (p_time < 0) { if (delayTime < 0) { Debug.LogWarning(gameObject.name + " ObjCmd delayTime : " + delayTime + " less than 0"); delayTime = 0; } return(DoCmd(p_arg, delayTime)); } else if (p_time > 0) { coroutine = ObjCmdManager.DoCmdLater(p_time, this, p_arg); return(false); } return(CheckCmdResult(Cmd(p_arg))); }