Exemple #1
0
        public static void CreateAdInits()
        {
            GameObject gameObject = new GameObject("AdsInit");
            AdsInit    a          = gameObject.AddComponent <AdsInit>();

            string[] guids = AssetDatabase.FindAssets("ADS_SETTING");

                        #if UNITY_5_3
            a.adIdds = AssetDatabase.LoadAssetAtPath <ADIDS>(AssetDatabase.GUIDToAssetPath(guids[0]));
            a.SetADIDS(AssetDatabase.LoadAssetAtPath <ADIDS>(AssetDatabase.GUIDToAssetPath(guids[0])));
                        #else
            a.adIdds = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guids[0]), typeof(ADIDS)) as ADIDS;
            a.SetADIDS(AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guids[0]), typeof(ADIDS))  as ADIDS);
                        #endif
            //			Autoselect();
        }
        public static void CreateAdInits()
        {
            GameObject gameObject = new GameObject("AdsInit");
            AdsInit    a          = gameObject.AddComponent <AdsInit>();

            string[] guids = AssetDatabase.FindAssets("ADS_SETTING");

                        #if UNITY_5_3_OR_NEWER
            a._ADIDS = AssetDatabase.LoadAssetAtPath <ADIDS>(AssetDatabase.GUIDToAssetPath(guids[0]));
            a.SetADIDS(AssetDatabase.LoadAssetAtPath <ADIDS>(AssetDatabase.GUIDToAssetPath(guids[0])));
                        #else
            a._ADIDS = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guids[0]), typeof(ADIDS)) as ADIDS;
            a.SetADIDS(AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guids[0]), typeof(ADIDS))  as ADIDS);
                        #endif
            //			Autoselect();

//			if (GUI.changed){
//				EditorUtility.SetDirty(target);
                        #if UNITY_5_3_OR_NEWER
            EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
                        #endif
//			}
        }