Example #1
0
 public void setSW(bool stat, bool isSlow)
 {
     if (!sw_enable || stat == sw_stat)
     {
         return;
     }
     if (stat)
     {
         _Ani.Play("mini_up");
         GameObject.Find("sw_mini/switch_ball").GetComponent <UISprite>().spriteName = "switch_on_pin";
         GameObject.Find("sw_mini/switch_use").GetComponent <UISprite>().spriteName  = "switch_m_on";
         _zzz.GetComponent <ParticleSystem>().Stop();
         _zzz.SetActive(false);
         sw_stat = true;
     }
     else
     {
         if (isSlow)
         {
             _Ani.Play("mini_down");
         }
         else
         {
             _Ani.Play("mini_down");
         }
         GameObject.Find("sw_mini/switch_ball").GetComponent <UISprite>().spriteName = "switch_off_pin";
         GameObject.Find("sw_mini/switch_use").GetComponent <UISprite>().spriteName  = "switch_m_off";
         _zzz.GetComponent <ParticleSystem>().Play();
         _zzz.SetActive(true);
         sw_stat = false;
     }
     dia = GameObject.Find("dialog").GetComponent <dialog>();
     dia.UpdateSW(sw_stat);
     dia.SetSpeed(sw_stat);
 }
Example #2
0
 public void togggleSW(bool value)
 {
     if (_zzz == null)
     {
         _zzz = GameObject.Find("SleepPar");
     }
     if (!sw_enable)
     {
         SoundUtils.PlaySE(SEFIleInfos.CommonWrong);
         return;
     }
     if (!sw_stat)
     {
         _Ani.Play("mini_up");
         GameObject.Find("sw_mini/switch_ball").GetComponent <UISprite>().spriteName = "switch_on_pin";
         GameObject.Find("sw_mini/switch_use").GetComponent <UISprite>().spriteName  = "switch_m_on";
         _zzz.GetComponent <ParticleSystem>().Stop();
         _zzz.transform.localScale = Vector3.zero;
         sw_stat = true;
     }
     else
     {
         _Ani.Play("mini_down");
         GameObject.Find("sw_mini/switch_ball").GetComponent <UISprite>().spriteName = "switch_off_pin";
         GameObject.Find("sw_mini/switch_use").GetComponent <UISprite>().spriteName  = "switch_m_off";
         _zzz.GetComponent <ParticleSystem>().Play();
         _zzz.transform.localScale = Vector3.one;
         sw_stat = false;
     }
     dia = GameObject.Find("dialog").GetComponent <dialog>();
     dia.UpdateSW(sw_stat);
     dia.SetSpeed(sw_stat);
     SoundUtils.PlaySE(SEFIleInfos.MainMenuOnClick);
 }