protected override void Playback(float time)
        {
            Vector3?position = positionKey.SampleCurves(time);

            if (position.HasValue)
            {
                if (useLocalCoordinates)
                {
                    this.transform.localPosition = position.Value;
                }
                else
                {
                    this.transform.position = position.Value;
                }
            }

            Quaternion?rotation = rotationKey.SampleCurves(time);

            if (rotation.HasValue)
            {
                if (useLocalCoordinates)
                {
                    this.transform.localRotation = rotation.Value;
                }
                else
                {
                    this.transform.rotation = rotation.Value;
                }
            }
        }
示例#2
0
	void SampleTime( float time )
	{
		//position
		if( recordPosition == true )
		{
			this.transform.position = positionKey.SampleCurves( time );
		}

		//rotation
		if( recordRotation == true )
		{
			this.transform.rotation = rotationKey.SampleCurves( time );
		}

		//scale
		if( recordScale == true )
		{
			this.transform.localScale = scaleKey.SampleCurves( time );
		}
	}