TweenOrthoSize.Begin C# (CSharp) Method

Begin() static public method

Start the tweening operation.
static public Begin ( GameObject go, float duration, float to ) : TweenOrthoSize,
go GameObject
duration float
to float
return TweenOrthoSize,
	static public TweenOrthoSize Begin (GameObject go, float duration, float to)
	{
		TweenOrthoSize comp = UITweener.Begin<TweenOrthoSize>(go, duration);
		comp.from = comp.orthoSize;
		comp.to = to;

		if (duration <= 0f)
		{
			comp.Sample(1f, true);
			comp.enabled = false;
		}
		return comp;
	}
}

Usage Example

Ejemplo n.º 1
0
    void OnMapBackgroundScrolled(GameObject go, float delta)
    {
        UIStretch theStretch = background.GetComponent <UIStretch>();

        if (delta > 0)
        {
            if (zoomLevel > -numZoomLevels && !isZooming)
            {
                zoomLevel--;
                isZooming = true;
                float          orthoSize = Mathf.Pow(zoomFactor, zoomLevel);
                TweenOrthoSize tos       = TweenOrthoSize.Begin(UICamera.currentCamera.gameObject, zoomSpeed, orthoSize);
                theStretch.relativeSize.x = orthoSize;
                theStretch.relativeSize.y = orthoSize;
                tos.callWhenFinished      = "endZooming";
                tos.eventReceiver         = this.gameObject;
            }
        }
        else
        {
            if (zoomLevel < numZoomLevels && !isZooming)
            {
                zoomLevel++;
                isZooming = true;
                float          orthoSize = Mathf.Pow(zoomFactor, zoomLevel);
                TweenOrthoSize tos       = TweenOrthoSize.Begin(UICamera.currentCamera.gameObject, zoomSpeed, orthoSize);
                tos.callWhenFinished = "endZoomUpdateBackground";
                tos.eventReceiver    = this.gameObject;
            }
        }
    }
All Usage Examples Of TweenOrthoSize::Begin
TweenOrthoSize