Пример #1
0
        Tinylytics_Config CreateAnalyticsConfigFile()
        {
            Tinylytics_Config asset = ScriptableObject.CreateInstance <Tinylytics_Config>();

            AssetDatabase.CreateAsset(asset, "Assets/Resources/AnalyticsConfiguration.asset");
            AssetDatabase.SaveAssets();
            return(asset);
        }
Пример #2
0
 void OnEnable()
 {
     if (EditorPrefs.HasKey("AnalyticsConfigObjectPath"))
     {
         string objectPath = EditorPrefs.GetString("AnalyticsConfigObjectPath");
         analyticsConfig = AssetDatabase.LoadAssetAtPath(objectPath, typeof(Tinylytics_Config)) as Tinylytics_Config;
     }
 }
Пример #3
0
        static void OnBeforeSceneLoadRuntimeMethod()
        {
            //Debug.Log("Before first scene loaded");
            Tinylytics_Config storage = Resources.Load <Tinylytics_Config>("Tinylytics_URLConfig");

            //GameObject instance = GameObject.Instantiate(Resources.Load("AnalyticsManager")) as GameObject;
            GameObject.Instantiate(Resources.Load("Tinylytics_BackendManager"));
            BackendManager.SetUniqueURL(storage.uniqueURL);
        }
Пример #4
0
        void CreateNewConfigFile()
        {
            // There is no overwrite protection here!
            // There is No "Are you sure you want to overwrite your existing object?" if it exists.
            // This should probably get a string from the user to create a new name and pass it ...

            analyticsConfig = CreateAnalyticsConfigFile();
            if (analyticsConfig)
            {
                //initialize it:
                //inventoryItemList.itemList = new List<InventoryItem>();
                string relPath = AssetDatabase.GetAssetPath(analyticsConfig);
                EditorPrefs.SetString("AnalyticsConfigObjectPath", relPath);
            }
        }
Пример #5
0
        void OpenConfigFile()
        {
            string absPath = EditorUtility.OpenFilePanel("Select Config File", Application.dataPath, "asset");

            if (absPath.StartsWith(Application.dataPath))
            {
                string relPath = absPath.Substring(Application.dataPath.Length - "Assets".Length);
                analyticsConfig = AssetDatabase.LoadAssetAtPath(relPath, typeof(Tinylytics_Config)) as Tinylytics_Config;
                //if (analyticsConfig.itemList == null)
                //	inventoryItemList.itemList = new List<InventoryItem>();
                if (analyticsConfig)
                {
                    EditorPrefs.SetString("AnalyticsConfigObjectPath", relPath);
                }
            }
        }