Пример #1
0
    /// <summary>
    /// Changes the color when touch a node
    /// </summary>
    /// <param name="state_">State.</param>
    public void changeState(int state_)
    {
        state = state_;
        Color tcolor = GetComponent <Image> ().color;

        switch (state)
        {
        case 0:
            ATween.ValueTo(gameObject, ATween.Hash("from", tcolor, "to", new Color(1, 1, 1, 1), "time", .3f, "onupdate", "OnUpdateTween", "onupdatetarget", this.gameObject));

            //						GetComponent<Image> ().DOColor (new Color(1,1,1,1),.3f);
            break;

        case 1:
            ATween.ValueTo(gameObject, ATween.Hash("from", tcolor, "to", new Color(.2f, .6f, .8f, 1), "time", .3f, "onupdate", "OnUpdateTween", "onupdatetarget", this.gameObject));


            break;

        case 2:
            ATween.ValueTo(gameObject, ATween.Hash("from", tcolor, "to", new Color(0, 1, 0, 1), "time", .3f, "onupdate", "OnUpdateTween", "onupdatetarget", this.gameObject));


            break;
        }
    }
Пример #2
0
    void fadeOut()
    {
        mask.gameObject.SetActive(true);
        mask.color = Color.black;

        ATween.ValueTo(mask.gameObject, ATween.Hash("from", 1, "to", 0, "time", 1, "onupdate", "OnUpdateTween", "onupdatetarget", this.gameObject, "oncomplete", "fadeOutOver", "oncompletetarget", this.gameObject));
    }
Пример #3
0
 void fadeIn(string sceneName)
 {
     if (mask.IsActive())
     {
         return;
     }
     mask.gameObject.SetActive(true);
     mask.color = new Color(0, 0, 0, 0);
     SceneManager.LoadScene(sceneName);
     ATween.ValueTo(mask.gameObject, ATween.Hash("ignoretimescale", true, "from", 0, "to", 1, "time", 1, "onupdate", "OnUpdateTween", "onupdatetarget", this.gameObject, "oncomplete", "fadeInOver", "oncompleteparams", sceneName, "oncompletetarget", this.gameObject));
 }
Пример #4
0
    void fadeIn(string sceneName)
    {
        if (mask.IsActive())
        {
            return;
        }
        mask.gameObject.SetActive(true);
        mask.color = new Color(0, 0, 0, 0);
//		mask.DOFade (1, 1).OnComplete (() => {
//			//			mask.gameObject.SetActive (false);
//			SceneManager.LoadScene(sceneName);
//		});
        ATween.ValueTo(mask.gameObject, ATween.Hash("from", 0, "to", 1, "time", 1, "onupdate", "OnUpdateTween", "onupdatetarget", this.gameObject, "oncomplete", "fadeInOver", "oncompleteparams", sceneName, "oncompletetarget", this.gameObject));
    }
Пример #5
0
    /// <summary>
    /// camera fade in
    /// </summary>
    /// <param name="sceneName">Scene name.</param>
    void fadeIn(string sceneName)
    {
        if (mask.IsActive())
        {
            return;
        }
        mask.gameObject.SetActive(true);
        mask.color = new Color(0, 0, 0, 0);


//				ATween.MoveBy(gameObject, ATween.Hash("x", 2, "easeType", "easeInOutExpo", "loopType", "pingPong", "delay", .1));



        ATween.ValueTo(mask.gameObject, ATween.Hash("from", 0, "to", 1, "time", 1, "onupdate", "OnUpdateTween", "onupdatetarget", this.gameObject, "oncomplete", "fadeInOver", "oncompleteparams", sceneName, "oncompletetarget", this.gameObject));
    }