using UnityEditor; using UnityEngine; using System; using System.Collections.Generic; using System.Linq; using System.Text; using log4net; namespace P4Connect { /// <summary> /// This class hooks onto the Asset Save/Delete/Move process and makes sure that /// Perforce is updated accordingly. It uses the perforce connection class /// (which internally uses Config to retrieve the connection settings) /// to open a connection to the server and add the required changes (add/checkout/delete/move). /// </summary> public class AssetPostProcessor : UnityEditor.AssetPostprocessor { private static readonly ILog log = LogManager.GetLogger(typeof(AssetPostProcessor)); public static void OnPostprocessAllAssets ( String [] aImportedAssets, String [] aDeletedAssets, String [] aMovedAssets, String [] aMovedFromAssetPaths) { #if DEBUG log.Debug("#### OnPostprocessAllAssets"); log.Debug(" import: "); log.Debug(aImportedAssets); log.Debug(" delete: "); log.Debug(aDeletedAssets); log.Debug(" Move: "); log.Debug(aMovedAssets); log.Debug(" MoveTo: "); log.Debug(aMovedFromAssetPaths); #endif if (aImportedAssets.Length > 0) { Engine.CreateAssets(aImportedAssets); } if (aDeletedAssets.Length > 0) { Engine.DeleteAssets(aDeletedAssets); } if (aMovedAssets.Length > 0) { Engine.MoveAssets(aMovedFromAssetPaths, aMovedAssets); } #if DEBUG log.Debug("#### OnPostprocessAllAssets Complete"); #endif } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#7 | 16251 | Norman Morse | Update Dev branch to match reorganization in workshop | ||
#6 | 14236 | Norman Morse | update dev branch with GA.8 release files | ||
#5 | 12558 | Norman Morse | Integrate from main to dev | ||
#4 | 12467 | Norman Morse |
Many minor changes to improve logging Added a filter for Console log display where you can select a level Hooked the log file location to the Configuration Log Entry. |
||
#3 | 12445 | Norman Morse |
Integrated log4net and nunit into P4Connect. Still need cleanup and debugging, good enough for dev tree Also added ChangeManager and ChangeLists Classes for future use with multiple changes. |
||
#2 | 12363 | Norman Morse |
Merging //guest/perforce_software/p4connect/src/... to //guest/norman_morse/dev/p4connect/src/... |
||
#1 | 10941 | Norman Morse | Create dev branch from workshop | ||
//guest/perforce_software/p4connect/src/P4Connect/P4Connect/P4Connect.AssetPostProcessor.cs | |||||
#1 | 10940 | Norman Morse |
Inital Workshop release of P4Connect. Released under BSD-2 license |