示例#1
0
 public override void TriggerSkill()
 {
     if (skillStatus == 0)
     {
         skillStatus       = 1;
         space4Transform1  = Instantiate(prefabSpace4, playerTransform.position + Vector3.right * Mathf.Sign(playerTransform.localScale.x) * 8f, Quaternion.identity);
         space4_1          = space4Transform1.GetComponent <Space4>();
         player.aiming     = true;
         player.myVelocity = Vector3.zero;
     }
     else if (skillStatus == 1)
     {
         space4Transform1.position += new Vector3(player.h, player.v, 0).normalized *speed;
     }
     else
     {
         space4Transform2       = Instantiate(prefabSpace4, playerTransform.position, Quaternion.identity);
         space4_2               = space4Transform2.GetComponent <Space4>();
         space4_1.anotherSpace4 = space4Transform2;
         space4_2.anotherSpace4 = space4Transform1;
         space4_1.RemoveLater(skillTime);
         space4_2.RemoveLater(skillTime);
         player.aiming = false;
         skillStatus   = 0;
     }
 }
示例#2
0
 private void HideSpaces()
 {
     Space1.GetComponent <BoardSpace>().Deactivate();
     Space2.GetComponent <BoardSpace>().Deactivate();
     Space3.GetComponent <BoardSpace>().Deactivate();
     Space4.GetComponent <BoardSpace>().Deactivate();
 }
示例#3
0
        public void TestNormalise010()
        {
            var space = new Space4 {
                Min = Vector4.zero, Max = Vector4.one * 10, Normalised = Normalisation.Zero_one_
            };

            Assert.That(Vector4.Distance(space.Project(6 * Vector4.one), Vector4.one * 0.6f) <= float.Epsilon,
                        Is.True);
        }
示例#4
0
        public void TestDenormaliseMinus11()
        {
            var space = new Space4 {
                Min = Vector4.one * -1, Max = Vector4.one * 1, Normalised = Normalisation.Zero_one_
            };

            Assert.That(Vector4.Distance(space.Reproject(0.75f * Vector4.one), Vector4.one * 0.5f)
                        <= float.Epsilon,
                        Is.True);
        }
示例#5
0
        /// <summary>
        /// Translate this transform in given space orientation.
        /// </summary>
        public void Translate(Vector4 value, Space4 space)
        {
            switch (space)
            {
            case Space4.Self:
                localPosition += value;
                break;

            case Space4.World:
                position += value;
                break;

            case Space4.View:
                position += Viewer4.main.viewerToWorldMatrix.rotation * value;
                break;

            default:
                break;
            }
        }
示例#6
0
        /// <summary>
        /// Rotate this transform (in matrix) in given space orientation.
        /// </summary>
        public void Rotate(Matrix4 value, Space4 space)
        {
            switch (space)
            {
            case Space4.Self:
                localRotation *= value;
                break;

            case Space4.World:
                rotation = value * rotation;     // order matter!
                break;

            case Space4.View:
                rotation = Matrix4.Transform(Viewer4.main.worldToViewerMatrix.rotation, value) * rotation;     // order matter!
                break;

            default:
                break;
            }
        }
示例#7
0
 public SampleSpace4(string unused = null)
 {
     this._space = Space4.ZeroOne;
     this._distribution_sampler = new DistributionSampler();
 }
示例#8
0
 /// <summary>
 /// Rotate this transform (in euler) in given space orientation.
 /// </summary>
 public void Rotate(Euler4 value, Space4 space)
 {
     Rotate(Matrix4.Euler(value), space);
 }
示例#9
0
 /// <summary>
 /// Rotate this transform (in 3D quaternion) in given space orientation.
 /// </summary>
 public void Rotate(Quaternion value, Space4 space)
 {
     Rotate(Matrix4x4.TRS(Vector3.zero, value, Vector3.one), space);
 }