void Awake() { enabled = false; if (instance == null) { Application.targetFrameRate = 300; instance = this; setBounds(); enemyMask = LayerMask.GetMask("Enemy"); #if UNITY_ANDROID activity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic <AndroidJavaObject>("currentActivity"); toast = new Toast(); prefs = new SecurePreferences(activity, "resonance.spaceincharge"); #else prefs = new SecurePreferences(); #endif points = prefs.readInt(PREF_POINTS, PREF_POINTS_DEFAULT); setLevels(); setFeatures(); DontDestroyOnLoad(gameObject); } else { instance.mainCamera = Camera.main; instance.cameraShake = instance.mainCamera.GetComponent <CameraShake>(); DestroyImmediate(gameObject); } }
void Awake() { enabled = false; if (instance == null) { Application.targetFrameRate = 300; instance = this; setBounds(); enemyMask = LayerMask.GetMask("Enemy"); #if UNITY_ANDROID activity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity"); toast = new Toast(); prefs = new SecurePreferences(activity, "resonance.spaceincharge"); #else prefs = new SecurePreferences(); #endif points = prefs.readInt(PREF_POINTS, PREF_POINTS_DEFAULT); setLevels(); setFeatures(); DontDestroyOnLoad(gameObject); } else { instance.mainCamera = Camera.main; instance.cameraShake = instance.mainCamera.GetComponent<CameraShake>(); DestroyImmediate(gameObject); } }
private void PopulateAuthenticateRequest(ref AuthenticateRequest authenticateRequest, GetAuthRequiredReply getAuth) { authenticateRequest.Auth = new String(SecurePreferences.CreateAuthResponse(PasswordPreference, getAuth.Salt, getAuth.Challenge, null)); }