Example #1
0
 /// <summary>
 /// Destroys the internal character controller representation.
 /// </summary>
 private void DestroyNative()
 {
     if (native != null)
     {
         native.Destroy();
         native = null;
     }
 }
Example #2
0
        /// <summary>
        /// Restores the internal character controller representation and initializes it with data stored by the component.
        /// </summary>
        private void RestoreNative()
        {
            ScriptCharacterControllerData initData = new ScriptCharacterControllerData();

            initData.position        = SceneObject.Position;
            initData.contactOffset   = serializableData.contactOffset;
            initData.stepOffset      = serializableData.stepOffset;
            initData.slopeLimit      = serializableData.slopeLimit;
            initData.minMoveDistance = serializableData.minMoveDistance;
            initData.height          = serializableData.height;
            initData.radius          = serializableData.radius;
            initData.up              = serializableData.up;
            initData.climbingMode    = serializableData.climbingMode;
            initData.nonWalkableMode = serializableData.nonWalkableMode;

            native           = new NativeCharacterController(initData);
            native.Component = this;
            native.Layer     = serializableData.layer;

            UpdateDimensions();
        }
Example #3
0
 private static extern void Internal_CreateInstance(NativeCharacterController instance,
                                                    ref ScriptCharacterControllerData initData);
        /// <summary>
        /// Restores the internal character controller representation and initializes it with data stored by the component.
        /// </summary>
        private void RestoreNative()
        {
            ScriptCharacterControllerData initData = new ScriptCharacterControllerData();
            initData.position = SceneObject.Position;
            initData.contactOffset = serializableData.contactOffset;
            initData.stepOffset = serializableData.stepOffset;
            initData.slopeLimit = serializableData.slopeLimit;
            initData.minMoveDistance = serializableData.minMoveDistance;
            initData.height = serializableData.height;
            initData.radius = serializableData.radius;
            initData.up = serializableData.up;
            initData.climbingMode = serializableData.climbingMode;
            initData.nonWalkableMode = serializableData.nonWalkableMode;

            native = new NativeCharacterController(initData);
            native.Component = this;
            native.Layer = serializableData.layer;

            UpdateDimensions();
        }
 /// <summary>
 /// Destroys the internal character controller representation.
 /// </summary>
 private void DestroyNative()
 {
     if (native != null)
     {
         native.Destroy();
         native = null;
     }
 }
 private static extern void Internal_CreateInstance(NativeCharacterController instance, 
     ref ScriptCharacterControllerData initData);