示例#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;
            }
        }
    }
    public override void OnInspectorGUI()
    {
        GUILayout.Space(6f);
        NGUIEditorTools.SetLabelWidth(120f);

        TweenOrthoSize tw = target as TweenOrthoSize;

        GUI.changed = false;

        float from = EditorGUILayout.FloatField("From", tw.from);
        float to   = EditorGUILayout.FloatField("To", tw.to);

        if (from < 0f)
        {
            from = 0f;
        }
        if (to < 0f)
        {
            to = 0f;
        }

        if (GUI.changed)
        {
            NGUIEditorTools.RegisterUndo("Tween Change", tw);
            tw.from = from;
            tw.to   = to;
            NGUITools.SetDirty(tw);
        }

        DrawCommonProperties();
    }
示例#3
0
 // Use this for initialization
 void Start()
 {
     tweenOrthoSize = GetComponent<TweenOrthoSize>();
     tweenPosition = GetComponent<TweenPosition>();
     TouchUI = GameObject.Find("TouchUI");
     skeletonAnimation = GameObject.Find("title").GetComponent<SkeletonAnimation>();
 }
示例#4
0
 static public int get_to(IntPtr l)
 {
     try {
         TweenOrthoSize self = (TweenOrthoSize)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.to);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#5
0
 static public int SetEndToCurrentValue(IntPtr l)
 {
     try {
         TweenOrthoSize self = (TweenOrthoSize)checkSelf(l);
         self.SetEndToCurrentValue();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#6
0
    public static TweenOrthoSize Begin(GameObject go, float duration, float to)
    {
        TweenOrthoSize size = UITweener.Begin <TweenOrthoSize>(go, duration);

        size.from = size.orthoSize;
        size.to   = to;
        if (duration <= 0f)
        {
            size.Sample(1f, true);
            size.enabled = false;
        }
        return(size);
    }
    public static TweenOrthoSize Begin(GameObject go, float duration, float to)
    {
        TweenOrthoSize tweenOrthoSize = UITweener.Begin <TweenOrthoSize>(go, duration);

        tweenOrthoSize.from = tweenOrthoSize.value;
        tweenOrthoSize.to   = to;
        if (duration <= 0f)
        {
            tweenOrthoSize.Sample(1f, isFinished: true);
            tweenOrthoSize.enabled = false;
        }
        return(tweenOrthoSize);
    }
示例#8
0
 static public int constructor(IntPtr l)
 {
     try {
         TweenOrthoSize o;
         o = new TweenOrthoSize();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#9
0
    /// <summary>
    /// Start the tweening operation.
    /// </summary>

    static public TweenOrthoSize Begin(GameObject go, float duration, float to)
    {
        TweenOrthoSize comp = UITweener.Begin <TweenOrthoSize>(go, duration);

        comp.from = comp.value;
        comp.to   = to;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }
示例#10
0
 static public int set_from(IntPtr l)
 {
     try {
         TweenOrthoSize self = (TweenOrthoSize)checkSelf(l);
         System.Single  v;
         checkType(l, 2, out v);
         self.from = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#11
0
 static public int set_value(IntPtr l)
 {
     try {
         TweenOrthoSize self = (TweenOrthoSize)checkSelf(l);
         float          v;
         checkType(l, 2, out v);
         self.value = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#12
0
 static public int Begin_s(IntPtr l)
 {
     try {
         UnityEngine.GameObject a1;
         checkType(l, 1, out a1);
         System.Single a2;
         checkType(l, 2, out a2);
         System.Single a3;
         checkType(l, 3, out a3);
         var ret = TweenOrthoSize.Begin(a1, a2, a3);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#13
0
 // Use this for initialization
 void Start()
 {
     _nowprocess    = 0;
     tweenOrthoSize = GetComponent <TweenOrthoSize>();
     tweenPosition  = GetComponent <TweenPosition>();
 }
示例#14
0
 // Use this for initialization
 void Start()
 {
     _nowprocess = 0;
     tweenOrthoSize = GetComponent<TweenOrthoSize>();
     tweenPosition = GetComponent<TweenPosition>();
 }
示例#15
0
 public unsafe static long $Invoke0(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(TweenOrthoSize.Begin((GameObject)GCHandledObjects.GCHandleToObject(*args), *(float *)(args + 1), *(float *)(args + 2))));
 }