コード例 #1
0
    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);
        }
    }
コード例 #2
0
ファイル: Game.cs プロジェクト: belandsoft/Space-in-Charge
    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);
        }
    }
コード例 #3
0
 private void PopulateAuthenticateRequest(ref AuthenticateRequest authenticateRequest, GetAuthRequiredReply getAuth)
 {
     authenticateRequest.Auth = new String(SecurePreferences.CreateAuthResponse(PasswordPreference, getAuth.Salt, getAuth.Challenge, null));
 }