static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { foreach (var assetPath in importedAssets) { //games-ids.xml was created or modified; if (assetPath.Equals(AN_Settings.ANDROID_GAMES_IDS_FILE_PATH)) { AN_GoolgePlayRersources.LoadLocalGamesIds(); } AN_FirebaseDefinesResolver.ProcessAssetImport(assetPath); AN_ResolveManager.ProcessAssetImport(assetPath); } foreach (var assetPath in deletedAssets) { //games-ids.xml was deleted; if (assetPath.Equals(AN_Settings.ANDROID_GAMES_IDS_FILE_PATH)) { AN_GoolgePlayRersources.DropGamesIds(); } AN_FirebaseDefinesResolver.ProcessAssetDelete(assetPath); AN_ResolveManager.ProcessAssetDelete(assetPath); } }
void OnGUI() { EditorGUILayout.LabelField("Copy the game resources from the console", EditorStyles.boldLabel); using (new SA_GuiBeginHorizontal()) { GUILayout.Space(10f); EditorGUILayout.LabelField("Once you configure at least one resource (event, achievement, or leaderboard), " + "copy the resource configuration from the Google Play Developer Console, " + "and paste inside the Text Area bellow. " + "To get the resources go to the Achievements tab, " + "then click on 'Get resources' on the bottom of the list.", SA_PluginSettingsWindowStyles.DescribtionLabelStyle); } EditorGUILayout.Space(); EditorGUI.BeginChangeCheck(); m_rawData = EditorGUILayout.TextArea(m_rawData, SA_PluginSettingsWindowStyles.TextArea, GUILayout.Height(450)); if (EditorGUI.EndChangeCheck()) { m_isDirty = true; } using (new SA_GuiBeginHorizontal()) { EditorGUILayout.Space(); GUI.enabled = m_isDirty; bool clicked = GUILayout.Button("Save", GUILayout.Width(300)); if (clicked) { AN_GoolgePlayRersources.OverrideGamesIds(m_rawData); m_isDirty = false; var image = AN_Skin.GetIcon(AN_GooglePlayFeaturesUI.GOOGLE_PLAY_ICON_NAME); GUIContent message = new GUIContent("games-ids.xml saved", image); ShowNotification(message); } GUI.enabled = true; } }