Exemplo n.º 1
0
        public static GTGameID LoadSetting()
        {
            GTGameID data = null;
            TextAsset binarydata = Resources.Load<TextAsset>("GoPlaySDKSetting");
            if (binarydata == null)
            {
                // setting is not set
                return new GTGameID();
            }

            try
            {
                Stream ms = new MemoryStream(binarydata.bytes);
                try
                {
                    BinaryFormatter formatter = new BinaryFormatter();
                    data = (GTGameID)formatter.Deserialize(ms);
                }
                catch (SerializationException e)
                {
                    Debug.LogError(e.Message);
                }
                finally
                {
                    ms.Close();
                }
            }
            catch (FileNotFoundException e)
            {
                Debug.Log("Load Gtoken Setting: " + e.Message);
                data = new GTGameID();
            }
            return data;
        }
Exemplo n.º 2
0
 void OnEnable()
 {
     hideFlags = HideFlags.HideAndDontSave;
     if (data == null)
     {
         data = GTGameID.LoadSetting();
     }
 }
Exemplo n.º 3
0
 // Start Session
 public Session()
 {
     gameId = GTGameID.LoadSetting();
     // Look for cache session
     SessionId = PlayerPrefs.GetString(GOPLAY_Session, string.Empty);
 }