static private void CreateInstance()
        {
            if (!s_DidQuit && !s_Instance)
            {
                // guid: SagoApp/Resources/SagoApp/AnalyticsController.prefab

                ResourceReference reference;
                reference      = ScriptableObject.CreateInstance <ResourceReference>();
                reference.Guid = "fde7cd87248144d369abeb5aef694ecc";

                ResourceReferenceLoaderRequest request;
                request = ResourceReferenceLoader.Load(reference, typeof(GameObject));

                if (!string.IsNullOrEmpty(request.error))
                {
                    Debug.LogError(request.error, DebugContext.SagoApp);
                    return;
                }

                GameObject gameObject;
                gameObject      = Instantiate(request.asset) as GameObject;
                gameObject.name = request.asset.name;
                DontDestroyOnLoad(gameObject);

                s_Instance = gameObject.GetComponent <AnalyticsController>();
            }
        }
예제 #2
0
        //
        // Factory
        //
        static public LoadingSpinner Create()
        {
            // guid: SagoApp/Resources/SagoApp/LoadingSpinner.prefab

            ResourceReference reference;

            reference      = ScriptableObject.CreateInstance <ResourceReference>();
            reference.Guid = "b83dfc0a5ad994b9d9f343a791779993";

            ResourceReferenceLoaderRequest request;

            request = ResourceReferenceLoader.Load(reference, typeof(GameObject));

            if (!string.IsNullOrEmpty(request.error))
            {
                Debug.LogError(request.error);
                return(null);
            }

            GameObject gameObject;

            gameObject      = Instantiate(request.asset) as GameObject;
            gameObject.name = request.asset.name;
            gameObject.SetActive(false);

            LoadingIndicator loader;

            loader = gameObject.GetComponent <LoadingIndicator>();

            return(loader as LoadingSpinner);
        }
		private LocalizedStringDictionary LoadLocalizedStringDictionary(Language language) {
			var resourceReference = GetResourceReference(language);
			if (resourceReference) {
				try {
					var request = ResourceReferenceLoader.Load<TextAsset>(resourceReference);
					// TODO: requires sync load
					var asset = request.asset as TextAsset;
					var json = JsonUtility.FromJson<LocalizedStringDictionary.Json>(asset.text);
					var dictionary = new LocalizedStringDictionary(json);
					return dictionary;
				} catch {
					// Debug.LogWarningFormat("Could not load dictionary: {0}", path);
				}
			}
			return new LocalizedStringDictionary();
		}
예제 #4
0
        //
        // Factory Methods
        //
        public static FadeTransition Create()
        {
            // guid: SagoNavigation/Resources/SagoNavigation/FadeTransition.prefab

            ResourceReference reference;

            reference      = ScriptableObject.CreateInstance <ResourceReference>();
            reference.Guid = "e351f7bdd660e4972aca465aecbb0b37";

            ResourceReferenceLoaderRequest request;

            request = ResourceReferenceLoader.Load(reference, typeof(GameObject));

            GameObject instance;

            instance = Object.Instantiate(request.asset) as GameObject;

            return(instance ? instance.GetComponent <FadeTransition>() : null);
        }