Exemplo n.º 1
0
    }//GetOriginalValue_Util

    //private List<>
    //private List<Vector3> animateList = new List<Animate>();
    //public void GetOriginalValue_Util( Transform pTransform );
    public void Delay(float pDuration, Anim_EndAnimCallBack pCallBack)
    {
        if (pCallBack != null)
        {
            StartCoroutine(Delay_Util(pDuration, pCallBack));
        }
    }
Exemplo n.º 2
0
 static public void FadeIn(Transform pObject, float pDuration = -1.0f, Anim_EndAnimCallBack pCallBack = null)
 {
     if (pDuration < 0.0f)
     {
         pDuration = AnimateManager.Instance.defaultFadeInDuration;
     }
     Util.SetActive(pObject, true);
     Animate lAnimate = new Animate(pObject); lAnimate.duration = pDuration; lAnimate.endCallBack = pCallBack; lAnimate.SetFadeIn(); lAnimate.Play();
 }//Fadein
Exemplo n.º 3
0
    static public void FadeOut(Transform pObject, float pDuration = -1.0f, Anim_EndAnimCallBack pCallBack = null)
    {
        if (pDuration < 0.0f)
        {
            pDuration = AnimateManager.Instance.defaultFadeOutDuration;
        }
        Animate lAnimate = new Animate(pObject); lAnimate.duration = pDuration; lAnimate.endCallBack = pCallBack;

        lAnimate.SetFadeOut();
        lAnimate.Init();
        lAnimate.Play();
    }//FadeOut
Exemplo n.º 4
0
    static public void FadeToward(Transform pObject, float pDuration = -1.0f, Anim_EndAnimCallBack pCallBack = null, float pAlphaBegin = 1.0f, float pAlphaEnd = 0.0f)
    {
        if (pDuration < 0.0f)
        {
            pDuration = AnimateManager.Instance.defaultFadeOutDuration;
        }
        Animate lAnimate = new Animate(pObject); lAnimate.duration = pDuration; lAnimate.endCallBack = pCallBack;

        lAnimate.alphaBegin = pAlphaBegin;
        lAnimate.alphaEnd   = pAlphaEnd;
        lAnimate.animAlpha  = true;
        lAnimate.Init();
        lAnimate.Play();
    }//Fadein
Exemplo n.º 5
0
    static public void ZoomIn(Transform pObject, float pDuration = -1.0f, Anim_EndAnimCallBack pCallBack = null)
    {
        if (pDuration < 0.0f)
        {
            pDuration = AnimateManager.Instance.defaultZoomInDuration;
        }
        Util.SetActive(pObject, true);
        Animate lAnimate = new Animate(pObject); lAnimate.duration = pDuration; lAnimate.endCallBack = pCallBack;

        lAnimate.SetFadeIn();
        AnimateManager.Instance.SetOriginalValue_Private(pObject, AnimateType.scale, pObject.localScale);
        lAnimate.transformCallBack = (float pT, List <Transform> pTransformList) => {
            Vector3 lZeroScale = new Vector3(0.0f, 0.0f, 0.0f);
            foreach (Transform lTransform in pTransformList)
            {
                lTransform.localScale = Vector3.Lerp(lZeroScale, AnimateManager.Instance.GetOriginalV3_Private(lTransform, AnimateType.scale), pT);
            }
        };

        lAnimate.Play();
    }//ZoomIn
Exemplo n.º 6
0
    static public void MoveToLocal(Transform pObject, Vector3 pDestinationPosition, bool pFadeIn = false, bool pFadeOut = false, float pDuration = -1.0f, Anim_EndAnimCallBack pCallBack = null)
    {
        if (pDuration < 0.0f)
        {
            pDuration = AnimateManager.Instance.defaultMoveToDuration;
        }
        Animate lAnimate = new Animate(pObject); lAnimate.duration = pDuration; lAnimate.endCallBack = pCallBack;

        if (pFadeIn)
        {
            lAnimate.SetFadeIn(); Util.SetActive(pObject, true);
        }
        if (pFadeOut)
        {
            lAnimate.SetFadeOut();
        }
        AnimateManager.Instance.SetOriginalValue_Private(pObject, AnimateType.localTranslation, pObject.localPosition);
        lAnimate.transformCallBack = (float pT, List <Transform> pTransformList) => {
            foreach (Transform lTransform in pTransformList)
            {
                Vector3 lOriginalPosition = AnimateManager.Instance.GetOriginalV3_Private(lTransform, AnimateType.localTranslation);
                lTransform.localPosition = Vector3.Lerp(lOriginalPosition, pDestinationPosition, pT);
            }
        };

        lAnimate.Play();
    }//MoveToLocal
Exemplo n.º 7
0
 static public void MoveToLocal(GameObject pObject, Vector3 pDestinationPosition, bool pFadeIn = false, bool pFadeOut = false, float pDuration = -1.0f, Anim_EndAnimCallBack pCallBack = null)
 {
     Animate.FadeIn(pObject.transform, pDuration, pCallBack);
 }
Exemplo n.º 8
0
 static public void ScaleTo(GameObject pObject, float pDestinationScale, float pDuration = -1.0f, Anim_EndAnimCallBack pCallBack = null)
 {
     Animate.FadeIn(pObject.transform, pDuration, pCallBack);
 }
Exemplo n.º 9
0
 static public void ZoomOut(GameObject pObject, float pDuration = -1.0f, Anim_EndAnimCallBack pCallBack = null)
 {
     Animate.FadeIn(pObject.transform, pDuration, pCallBack);
 }
Exemplo n.º 10
0
 static public void FadeToward(GameObject pObject, float pDuration = -1.0f, Anim_EndAnimCallBack pCallBack = null, float pAlphaBegin = 1.0f, float pAlphaEnd = 0.0f)
 {
     Animate.FadeToward(pObject.transform, pDuration, pCallBack, pAlphaBegin, pAlphaEnd);
 }
Exemplo n.º 11
0
    }//FadeOut

    static public void FadeIn(Button pObject, float pDuration = -1.0f, Anim_EndAnimCallBack pCallBack = null)
    {
        Animate.FadeIn(pObject.transform, pDuration, pCallBack);
    }
Exemplo n.º 12
0
 static public void Delay(float pDuration, Anim_EndAnimCallBack pCallBack)
 {
     AnimateManager.Instance.Delay(pDuration, pCallBack);
 }
Exemplo n.º 13
0
    private IEnumerator Delay_Util(float pDuration, Anim_EndAnimCallBack pCallBack)
    {
        yield return(new WaitForSeconds(pDuration));

        pCallBack();
    }