Exemple #1
0
        protected void CreateNativeTransformCollections()
        {
            _nativeTweenStates = new NativeArray <TweenTransformState>(_tweenStates.Length, Allocator.TempJob);
            JTweenTools.CopyTweenStateDirectlyToNativeArray(_tweenStates.buffer, _nativeTweenStates, _tweenStates.Length);

            _nativeTweenPositions = new NativeArray <TweenFloat3>(_tweenPositions.Length, Allocator.TempJob);
            JTweenTools.CopyTween3DirectlyToNativeArray(_tweenPositions.buffer, _nativeTweenPositions, _tweenPositions.Length);

            _nativeTweenRotations = new NativeArray <TweenRotation>(_tweenRotations.Length, Allocator.TempJob);
            JTweenTools.CopyTweenRotationDirectlyToNativeArray(_tweenRotations.buffer, _nativeTweenRotations, _tweenRotations.Length);

            _nativeTweenScales = new NativeArray <TweenFloat3>(_tweenScales.Length, Allocator.TempJob);
            JTweenTools.CopyTween3DirectlyToNativeArray(_tweenScales.buffer, _nativeTweenScales, _tweenScales.Length);

            _nativePositionLifetimes = new NativeArray <TweenLifetime>(_tweenPositionLifetimes.Length, Allocator.TempJob);
            JTweenTools.CopyTweenLifetimeDirectlyToNativeArray(_tweenPositionLifetimes.buffer, _nativePositionLifetimes, _tweenPositionLifetimes.Length);

            _nativeRotationLifetimes = new NativeArray <TweenLifetime>(_tweenRotationLifetimes.Length, Allocator.TempJob);
            JTweenTools.CopyTweenLifetimeDirectlyToNativeArray(_tweenRotationLifetimes.buffer, _nativeRotationLifetimes, _tweenRotationLifetimes.Length);

            _nativeScaleLifetimes = new NativeArray <TweenLifetime>(_tweenScaleLifetimes.Length, Allocator.TempJob);
            JTweenTools.CopyTweenLifetimeDirectlyToNativeArray(_tweenScaleLifetimes.buffer, _nativeScaleLifetimes, _tweenScaleLifetimes.Length);

            _nativePositions = new NativeArray <float3>(_tweenPositions.Length, Allocator.TempJob);
            _nativeRotations = new NativeArray <quaternion>(_tweenRotations.Length, Allocator.TempJob);
            _nativeScales    = new NativeArray <float3>(_tweenScales.Length, Allocator.TempJob);
        }