/**
         * @private
         */
        protected override void _OnClear()
        {
            base._OnClear();

            foreach (var constraint in this.constraints)
            {
                constraint.ReturnToPool();
            }

            this.offsetMode = OffsetMode.Additive;
            this.animationPose.Identity();
            this.constraints.Clear();
            this.boneData = null; //

            this._transformDirty         = false;
            this._childrenTransformDirty = false;
            this._blendDirty             = false;
            this._localDirty             = true;
            this._visible          = true;
            this._cachedFrameIndex = -1;
            this._blendLayer       = 0;
            this._blendLeftWeight  = 1.0f;
            this._blendLayerWeight = 0.0f;
            this._bones.Clear();
            this._slots.Clear();
            this._cachedFrameIndices = null;
        }
Exemple #2
0
        /// <inheritDoc/>
        protected override void _OnClear()
        {
            base._OnClear();

            this.offsetMode = OffsetMode.Additive;
            this.animationPose.Identity();

            this._transformDirty         = false;
            this._childrenTransformDirty = false;
            this._localDirty             = true;
            this._hasConstraint          = false;
            this._visible          = true;
            this._cachedFrameIndex = -1;
            this._blendState.Clear();
            this._boneData           = null; //
            this._cachedFrameIndices = null;
        }
Exemple #3
0
            private HeightMapData(Texture2D heightMap, float maxHeight, float valueScale, ScaleMode scaleMode, float valueOffset, OffsetMode offsetMode, bool applyEdgeLerp)
            {
                if (!heightMap.isReadable)
                {
                    Debug.LogError("You have to enable Read/Write on heightMap texture!");
                }

                HeightMap          = heightMap;
                this.maxHeight     = maxHeight;
                this.valueScale    = valueScale;
                this.scaleMode     = scaleMode;
                this.valueOffset   = valueOffset;
                this.offsetMode    = offsetMode;
                this.applyEdgeLerp = applyEdgeLerp;

                values = new NativeArray <float>(2, Allocator.Persistent, NativeArrayOptions.UninitializedMemory);
                values[ValueScaleIndex]  = valueScale;
                values[ValueOffsetIndex] = valueOffset;
            }
 /// <summary>
 /// Creates a new <see cref="SKRect"/> of the same size and shape as the original, but which is offset by the specified amount
 /// </summary>
 /// <param name="rect"></param>
 /// <param name="delta">The difference between the new <see cref="SKRect"/> and the original</param>
 /// <param name="mode"></param>
 /// <returns></returns>
 public static SKRect OffsetClone(this SKRect rect, SKPoint delta, OffsetMode mode = OffsetMode.Add)
 {
     if (mode == OffsetMode.Add)
     {
         return(new SKRect(
                    rect.Left + delta.X,
                    rect.Top + delta.Y,
                    rect.Right + delta.X,
                    rect.Bottom + delta.Y
                    ));
     }
     else
     {
         return(new SKRect(
                    rect.Left - delta.X,
                    rect.Top - delta.Y,
                    rect.Right - delta.X,
                    rect.Bottom - delta.Y
                    ));
     }
 }