Amazon.Util.Storage.Internal.PlayerPreferenceKVStore.Get C# (CSharp) 메소드

Get() 공개 메소드

Gets the value identified by key
public Get ( string key ) : string
key string Identifier
리턴 string
        public override string Get(string key)
        {
            if (UnityInitializer.IsMainThread())
            {
                return GetHelper(key);
            }
            else
            {
                string value = string.Empty;
                AutoResetEvent asyncEvent = new AutoResetEvent(false);
                UnityRequestQueue.Instance.ExecuteOnMainThread(() =>
                {
                    value = GetHelper(key);
                    asyncEvent.Set();
                });
                asyncEvent.WaitOne();
                return value;
            }
            
        }

Usage Example

 public string GetValue(string key, ApplicationSettingsMode mode)
 {
     var kvStore = new PlayerPreferenceKVStore();
     return kvStore.Get(key);
 }