Example #1
0
 public static void Vibrate(long milliseconds)
 {
     if (GameConfigs.GetIsVibrate())
     {
         if (isAndroid())
         {
             vibrator.Call("vibrate", milliseconds);
         }
         else
         {
             Handheld.Vibrate();
         }
     }
 }
Example #2
0
 public static void Vibrate(long[] pattern, int repeat)
 {
     if (GameConfigs.GetIsVibrate())
     {
         if (isAndroid())
         {
             vibrator.Call("vibrate", pattern, repeat);
         }
         else
         {
             Handheld.Vibrate();
         }
     }
 }
Example #3
0
 public static void Vibrate()
 {
     if (GameConfigs.GetIsVibrate())
     {
         if (isAndroid())
         {
             vibrator.Call("vibrate");
         }
         else
         {
             Handheld.Vibrate();
         }
     }
 }
Example #4
0
    public void OnClickSettingShow()
    {
        bool possibleSettingShow = false;

        if (SceneManager.GetActiveScene().buildIndex == (int)SCENE_INDEX.MAINMENU)
        {
            possibleSettingShow = true;
        }
        else if ((SceneManager.GetActiveScene().buildIndex == (int)SCENE_INDEX.GAMESTAGE) && PlayerManager.Instance().GetPlayerControl().IsGround())
        {
            possibleSettingShow = true;
        }

        if (possibleSettingShow)
        {
            topCanvas.sortingOrder = 10;

            SoundManager.PlayOneShotSound(SoundContainer.Instance().SoundEffectsDic[GameStatics.sound_select], SoundContainer.Instance().SoundEffectsDic[GameStatics.sound_select].clip);

            IsSettingState = true;
            SettingControlTweenTrans.gameObject.SetActive(true);
            SettingControlTweenTrans.startingVector = outXPos_SettingControl;
            SettingControlTweenTrans.endVector      = inXPos_SettingControl;

            if (SceneManager.GetActiveScene().buildIndex == (int)SCENE_INDEX.MAINMENU)
            {
                SettingGoBackText.text = "Exit Game";
            }
            else
            {
                SettingGoBackText.text = "Main Menu";
            }

            SettingControlTweenTrans.Begin();
            SettingControlTweenTrans.defaultVector = SettingControlTweenTrans.startingVector;

            if (slider_bgm != null && slider_sfx != null)
            {
                slider_bgm.SetValueWithoutNotify(SoundManager.MusicVolume);
                slider_sfx.SetValueWithoutNotify(SoundManager.SoundVolume);
            }

            if (toggle_vibrate != null)
            {
                toggle_vibrate.SetIsOnWithoutNotify(GameConfigs.GetIsVibrate());
            }
        }
    }