示例#1
0
 public override void Reset()
 {
     base.Reset();
     id = new FsmString
     {
         UseVariable = true
     };
     time     = 1f;
     delay    = 0f;
     loopType = iTween.LoopType.none;
     vector   = new FsmVector3
     {
         UseVariable = true
     };
     speed = new FsmFloat
     {
         UseVariable = true
     };
     space        = Space.World;
     orientToPath = false;
     lookAtObject = new FsmGameObject
     {
         UseVariable = true
     };
     lookAtVector = new FsmVector3
     {
         UseVariable = true
     };
     lookTime = 0f;
     axis     = AxisRestriction.none;
 }
            public override void KeyDown(KeyEventArgs e)
            {
                AxisRestriction old = axisRestriction;

                switch (e.KeyCode)
                {
                case Keys.X:
                    axisRestriction = e.Shift ? AxisRestriction.YZ : AxisRestriction.X;
                    break;

                case Keys.Y:
                    axisRestriction = e.Shift ? AxisRestriction.XZ : AxisRestriction.Y;
                    break;

                case Keys.Z:
                    axisRestriction = e.Shift ? AxisRestriction.XY : AxisRestriction.Z;
                    break;

                default:
                    return;
                }

                if (axisRestriction == old)
                {
                    axisRestriction = AxisRestriction.NONE;
                }
            }
            public override void KeyDown(KeyEventArgs e)
            {
                Vector3 vec;

                if (e.Shift && e.KeyCode == Keys.S)
                {
                    absoluteSnapping = !absoluteSnapping;
                }

                AxisRestriction old = axisRestriction;

                switch (e.KeyCode)
                {
                case Keys.X:
                    axisRestriction = e.Shift ? AxisRestriction.YZ : AxisRestriction.X;
                    break;

                case Keys.Y:
                    axisRestriction = e.Shift ? AxisRestriction.XZ : AxisRestriction.Y;
                    break;

                case Keys.Z:
                    axisRestriction = e.Shift ? AxisRestriction.XY : AxisRestriction.Z;
                    break;

                default:
                    return;
                }

                if (axisRestriction == old)
                {
                    axisRestriction = AxisRestriction.NONE;
                }


                vec = control.InvertedRotationMatrix.Row2;

                //determine weithert scrolling should be allowed based on the current axisRestriction and camera orientation
                if (axisRestriction == AxisRestriction.NONE ||
                    (axisRestriction == AxisRestriction.X && (Math.Round(vec.X, 7) == 1 || Math.Round(vec.X, 7) == -1)) || //camera facing left/right
                    (axisRestriction == AxisRestriction.Y && (Math.Round(vec.Y, 7) == 1 || Math.Round(vec.Y, 7) == -1)) || //camera facing up/down
                    (axisRestriction == AxisRestriction.Z && (Math.Round(vec.Z, 7) == 1 || Math.Round(vec.Z, 7) == -1)) || //camera facing forward/backward
                    (axisRestriction == AxisRestriction.YZ && Math.Round(vec.X, 7) == 0) ||                                //camera facing up/down/forward/backward
                    (axisRestriction == AxisRestriction.XZ && Math.Round(vec.Y, 7) == 0) ||                                //camera facing left/right/forward/backward
                    (axisRestriction == AxisRestriction.YZ && Math.Round(vec.Z, 7) == 0)                                   //camera facing left/right/up/down
                    )
                {
                    allowScrolling = true;
                }
                else
                {
                    allowScrolling = false;
                    scrolling      = 0;
                }
            }
 public override void Reset()
 {
     base.Reset();
     id = new FsmString
     {
         UseVariable = true
     };
     time     = 1f;
     delay    = 0f;
     loopType = iTween.LoopType.none;
     vector   = new FsmVector3
     {
         UseVariable = true
     };
     space = Space.World;
     axis  = AxisRestriction.none;
 }
示例#5
0
 public override void Reset()
 {
     base.Reset();
     id = new FsmString
     {
         UseVariable = true
     };
     transformTarget = new FsmGameObject
     {
         UseVariable = true
     };
     vectorTarget = new FsmVector3
     {
         UseVariable = true
     };
     time     = 1f;
     delay    = 0f;
     loopType = iTween.LoopType.none;
     speed    = new FsmFloat
     {
         UseVariable = true
     };
     axis = AxisRestriction.none;
 }