コード例 #1
0
        /// <summary>
        /// Creates the internal representation of the Joint and restores the values saved by the Component.
        /// </summary>
        private void RestoreNative()
        {
            // Make sure to always create a new instance of this array, as IntPtrs don't get serialized
            [email protected] = new [] { IntPtr.Zero, IntPtr.Zero };

            if (commonData.bodies[0] != null)
            {
                NativeRigidbody nativeBody = commonData.bodies[0].native;
                if (nativeBody != null)
                {
                    [email protected][0] = nativeBody.GetCachedPtr();
                }
            }

            if (commonData.bodies[1] != null)
            {
                NativeRigidbody nativeBody = commonData.bodies[1].native;
                if (nativeBody != null)
                {
                    [email protected][1] = nativeBody.GetCachedPtr();
                }
            }

            GetLocalTransform(JointBody.Target, out [email protected][0], out [email protected][0]);
            GetLocalTransform(JointBody.Anchor, out [email protected][1], out [email protected][1]);

            native           = CreateNative();
            native.Component = this;
        }
コード例 #2
0
 /// <summary>
 /// Destroys the internal joint representation.
 /// </summary>
 private void DestroyNative()
 {
     if (native != null)
     {
         native.Destroy();
         native = null;
     }
 }
コード例 #3
0
ファイル: Joint.cs プロジェクト: BearishSun/BansheeEngine
 /// <summary>
 /// Destroys the internal joint representation.
 /// </summary>
 private void DestroyNative()
 {
     if (native != null)
     {
         native.Destroy();
         native = null;
     }
 }
コード例 #4
0
ファイル: Joint.cs プロジェクト: BearishSun/BansheeEngine
        /// <summary>
        /// Creates the internal representation of the Joint and restores the values saved by the Component.
        /// </summary>
        private void RestoreNative()
        {
            // Make sure to always create a new instance of this array, as IntPtrs don't get serialized
            [email protected] = new []{ IntPtr.Zero, IntPtr.Zero };

            if (commonData.bodies[0] != null)
            {
                NativeRigidbody nativeBody = commonData.bodies[0].native;
                if (nativeBody != null)
                    [email protected][0] = nativeBody.GetCachedPtr();
            }

            if (commonData.bodies[1] != null)
            {
                NativeRigidbody nativeBody = commonData.bodies[1].native;
                if (nativeBody != null)
                    [email protected][1] = nativeBody.GetCachedPtr();
            }

            GetLocalTransform(JointBody.Target, out [email protected][0], out [email protected][0]);
            GetLocalTransform(JointBody.Anchor, out [email protected][1], out [email protected][1]);

            native = CreateNative();
            native.Component = this;
        }