setOnCompleteHandler() public method

public setOnCompleteHandler ( Action onComplete ) : void
onComplete Action
return void
示例#1
0
    public static AbstractGoTween FadeOut(this GameObject self, float duration = 0.5f, FadeOutEndAction action = FadeOutEndAction.Destroy, float alpha = 0, float delay = 0, GoEaseType ease = GoEaseType.Linear)
    {
        if (duration == 0)
        {
            Debug.LogWarning("Invalid parameter duration on FadeIn call");
        }

        AbstractGoTween tween = self.alphaTo(duration, alpha, ease, delay);

        if (tween != null)
        {
            switch (action)
            {
            case FadeOutEndAction.DoNothing: break;

            case FadeOutEndAction.Inactive:
                tween.setOnCompleteHandler(c => self.SetActive(false));
                break;

            case FadeOutEndAction.Destroy:
                tween.setOnCompleteHandler(c => self.DestroySelf());
                break;
            }
        }
        else
        {
            switch (action)
            {
            case FadeOutEndAction.DoNothing: break;

            case FadeOutEndAction.Inactive:
                self.SetActive(false);
                break;

            case FadeOutEndAction.Destroy:
                self.DestroySelf();
                break;
            }
        }
        return(tween);
    }
 static public int setOnCompleteHandler(IntPtr l)
 {
     try {
         AbstractGoTween self = (AbstractGoTween)checkSelf(l);
         System.Action <AbstractGoTween> a1;
         LuaDelegation.checkDelegate(l, 2, out a1);
         self.setOnCompleteHandler(a1);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }