コード例 #1
0
        /// <summary>
        /// 追加Action,会在下一帧进行同步处理
        /// </summary>
        /// <param name="action"></param>
        public void PostTransformAction(SFTransformDelegateAction <float> action)
        {
            //create the six actions
            mgr.PostDelegateAction((TransformAction.PosX), () => {
                Transform trans = action.TransSelector();
                return((float)(Math.Round((trans.position.x), 4)));
            });

            mgr.PostDelegateAction((TransformAction.PosY), () => {
                Transform trans = action.TransSelector();
                return((float)(Math.Round((trans.position.y), 4)));
            });

            mgr.PostDelegateAction((TransformAction.PosZ), () => {
                Transform trans = action.TransSelector();
                return((float)(Math.Round((trans.position.z), 4)));
            });

            mgr.PostDelegateAction((TransformAction.RotX), () => {
                Transform trans = action.TransSelector();
                return((float)(Math.Round((trans.rotation.eulerAngles.x), 4)));
            });

            mgr.PostDelegateAction((TransformAction.RotY), () => {
                Transform trans = action.TransSelector();
                return((float)(Math.Round((trans.rotation.eulerAngles.y), 4)));
            });

            mgr.PostDelegateAction((TransformAction.RotZ), () => {
                Transform trans = action.TransSelector();
                return((float)(Math.Round((trans.rotation.eulerAngles.z), 4)));
            });
            //action.FrameID = curFrameID + 1;
            //tempActions.Add(action);
        }
コード例 #2
0
        /// <summary>
        /// Posts the transform action.
        /// </summary>
        /// <param name="transSelector">Trans selector.</param>
        public void PostTransformAction(Func <Transform> transSelector)
        {
            SFTransformDelegateAction <float> action = new SFTransformDelegateAction <float> (transSelector);

            PostTransformAction(action);
        }