Example #1
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 #2
0
 public NativeCharacterController(ScriptCharacterControllerData initData)
 {
     Internal_CreateInstance(this, ref initData);
 }
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();
        }
 public NativeCharacterController(ScriptCharacterControllerData initData)
 {
     Internal_CreateInstance(this, ref initData);
 }
 private static extern void Internal_CreateInstance(NativeCharacterController instance, 
     ref ScriptCharacterControllerData initData);