using System.IO; using UnityEditor; using UnityEngine; namespace Mogafa.Unity.Common.Editor { [InitializeOnLoad] public class CopyLinkDotXml { static CopyLinkDotXml() { var sourcePath = Path.GetFullPath("Packages/com.didabu.event.unity"); var destPath = Path.Combine(Application.dataPath, "Didabu", "Event"); var sourceFile = Path.Combine(sourcePath, "link.xml"); var destFile = Path.Combine(destPath, "link.xml"); if (File.Exists(sourceFile)) { if (!Directory.Exists(destPath)) { Directory.CreateDirectory(destPath); } if (!File.Exists(destFile)) { File.Copy(sourceFile, destFile, true); } } } } }