Ejemplo n.º 1
0
        /// <summary>
        /// Set the scale value or animate scale
        /// </summary>
        /// <param Name="index"></param>
        public override void SetIndex(int index)
        {
            base.SetIndex(index);

            Vector3 item = Current;

            if (mScaler != null)
            {
                mScaler.TargetValue = item;
                mScaler.StartRunning();
            }
            else
            {
                TargetObject.transform.localScale = item;
            }
        }
Ejemplo n.º 2
0
        public override void SetIndex(int index)
        {
            base.SetIndex(index);

            if (isFirstCall)
            {
                StartScale  = TargetObject.transform.localScale;
                isFirstCall = false;
            }

            float item = Current;

            if (mScaler != null)
            {
                mScaler.TargetValue = item * StartScale;
                mScaler.StartRunning();
            }
            else
            {
                TargetObject.transform.localScale = item * StartScale;
            }
        }
Ejemplo n.º 3
0
        public override void SetIndex(int index)
        {
            base.SetIndex(index);
            Transform item = Array[Index];

            Quaternion rotation = Quaternion.identity; rotation.eulerAngles = item.eulerAngles;
            Vector3    position = item.position;
            Vector3    scale    = item.localScale;

            //Use Move To Position
            if (mMoveTranslator != null)
            {
                mMoveTranslator.ToLocalTransform = UseLocalPosition;
                mMoveTranslator.TargetValue      = position;
                mMoveTranslator.StartRunning();
            }
            else
            {
                if (UseLocalPosition)
                {
                    TargetObject.transform.localPosition = position;
                }
                else
                {
                    TargetObject.transform.position = position;
                }
            }

            //Set The Rotation
            if (mRotation != null)
            {
                mRotation.ToLocalTransform = UseLocalRotation;
                mRotation.TargetValue      = rotation;
                mRotation.StartRunning();
            }
            else
            {
                if (UseLocalRotation)
                {
                    TargetObject.transform.localRotation = rotation;
                }
                else
                {
                    TargetObject.transform.rotation = rotation;
                }
            }

            //Set Scale
            if (isFirstCall)
            {
                StartScale  = TargetObject.transform.localScale;
                isFirstCall = false;
            }

            //item = Current;

            if (mScaler != null)
            {
                mScaler.TargetValue = scale;
                mScaler.StartRunning();
            }
            else
            {
                TargetObject.transform.localScale = scale;
            }
        }