コード例 #1
0
        public static STransform GetTransformStruct(Transform transform)
        {
            STransform result = new STransform();

            result.Position = transform.position;
            result.Rotation = transform.rotation;
            result.Scale    = transform.localScale;
            return(result);
        }
コード例 #2
0
        public override void StartAnimation()
        {
            if (StartValue == null)
            {
                return;
            }

            if (EndValue == null)
            {
                return;
            }

            if (AnimatedTransform == null)
            {
                AnimatedTransform = transform;
            }

            if (StartFromCurrentTransform)
            {
                if (PlayInReverse == false)
                {
                    startTransform = BUtils.GetTransformStruct(transform);
                    endTransform   = BUtils.GetTransformStruct(EndValue);
                }
                else
                {
                    startTransform = BUtils.GetTransformStruct(StartValue);
                    endTransform   = BUtils.GetTransformStruct(transform);
                }
            }
            else
            {
                startTransform = BUtils.GetTransformStruct(StartValue);
                endTransform   = BUtils.GetTransformStruct(EndValue);
            }

            base.StartAnimation();
        }