public override bool Initialise(VrsCloudPrefs manager)
        {
            Manager = manager;

            Debug.Log("VrsCloudPrefs: CloudKeyValueStore.Initialise()");

#if UNITY_EDITOR
            Debug.Log("VrsCloudPrefs: CloudKeyValueStore Initialising Editor Store");

            var nativeStore = ScriptableObject.CreateInstance <LocalKeyValueStore>();
            nativeStore.KeyPrefix = "REMOTE.";
            concreteStore         = nativeStore;
#elif UNITY_IOS
            Debug.Log("VrsCloudPrefs: CloudKeyValueStore Initialising IOS Store");

            concreteStore = ScriptableObject.CreateInstance <CloudKeyValueStoreIOS>();
#elif UNITY_ANDROID
            Debug.Log("VrsCloudPrefs: CloudKeyValueStore Initialising Android Store");

            var nativeStore = ScriptableObject.CreateInstance <LocalKeyValueStore>();
            nativeStore.KeyPrefix = "REMOTE.";
            concreteStore         = nativeStore;
#endif

            return(concreteStore.Initialise(manager));
        }
        public override bool Initialise(VrsCloudPrefs manager)
        {
            Manager = manager;

            Debug.Log("VrsCloudPrefs: CloudKeyValueStoreIOS.Initialise()");

            VRS_CloudPrefs_InitializeWithGameObjectName(manager.gameObject.name);
            VRS_CloudPrefs_Synchronize();
            return(true);
        }
Пример #3
0
        // Use this for initialization
        void Awake()
        {
            if (_inst != null && _inst != this)
            {
                GameObject.DestroyImmediate(gameObject);
                return;
            }

            bool isOk = true;

            if (localStore)
            {
                if (!localStore.Initialise(this))
                {
                    Debug.LogError("VrsCloudPrefs: Local sotre initialisation failed");
                    isOk = false;
                }
                else
                {
                    Debug.Log("VrsCloudPrefs: Local store initialised");
                }
            }
            else
            {
                Debug.LogError("VrsCloudPrefs: No local store specified");
                isOk = false;
            }

            if (remoteStore)
            {
                if (!remoteStore.Initialise(this))
                {
                    Debug.LogError("VrsCloudPrefs: Remote sotre initialisation failed");
                    isOk = false;
                }
                else
                {
                    Debug.Log("VrsCloudPrefs: Remote store initialised");
                }
            }
            else
            {
                Debug.LogError("VrsCloudPrefs: No remote store specified");
                isOk = false;
            }

            if (isOk)
            {
                DontDestroyOnLoad(gameObject);
                _inst = this;
            }
        }
Пример #4
0
        // Use this for initialization
        void Start()
        {
            List <KeyValuePair> newValues = new List <KeyValuePair>();

            foreach (KeyValuePair kvp in initial)
            {
                KeyValuePair copy = kvp;
                if (VrsCloudPrefs.HasKey(kvp.key))
                {
                    copy.value = VrsCloudPrefs.GetString(kvp.key);
                    VrsCloudPrefs.SetString(kvp.key, copy.value);
                }
                else
                {
                    VrsCloudPrefs.SetString(kvp.key, kvp.value);
                }
                newValues.Add(copy);
            }
            initial = newValues.ToArray();
        }
 public override bool Initialise(VrsCloudPrefs manager)
 {
     return(true);
 }
Пример #6
0
 public abstract bool Initialise(VrsCloudPrefs manager);