public void ChangeSprite(GroundType type, bool isSpeed = false)
    {
        if (background != null)
        {
            if ((int)type == 99)
            {
                background.sprite = GetSprites[4];
            }
            else if ((int)type == 0)
            {
                light.Stop(Color.white);
                background.sprite = GetSprites[0];
                light.gameObject.SetActive(false);
            }
            else
            {
                background.sprite = GetSprites[0];
                light.gameObject.SetActive(true);

                light.SetFromAndTo(Color.white, colorTransparent);
                light.PlayForward(System.Convert.ToInt32(!isSpeed));
                colorLight.SetFromAndTo(lightColor[(int)type - 1], (lightColor[(int)type - 1] * colorTransparent));
                colorLight.PlayForward(System.Convert.ToInt32(!isSpeed));
            }
        }
    }
 public void OpenLight(GroundType gType = GroundType.None, bool isShow = true)
 {
     if (isShow)
     {
         light.Stop(Color.white);
         colorLight.Stop(lightColor[(int)gType - 1]);
         colorLight.SetFromAndTo(lightColor[(int)gType - 1], lightColor[(int)gType - 1] * colorTransparent);
         light.SetFromAndTo(Color.white, colorTransparent);
         light.PlayForward(0);
         colorLight.PlayForward(0);
     }
     else
     {
         if (gType != GroundType.None)
         {
             colorLight.Stop(lightColor[(int)gType - 1]);
         }
         else
         {
             colorLight.Stop(lightColor[(int)_groundType - 1]);
         }
         light.Stop(Color.white);
         light.gameObject.SetActive(true);
     }
 }
Exemple #3
0
 protected override void OnStop()
 {
     base.OnStop();
     _tween.Stop();
 }