-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8c27b4e
Showing
323 changed files
with
18,845 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using UnityEditor; | ||
|
||
namespace TapSDK.Core.Editor { | ||
public static class BuildTargetUtils { | ||
public static bool IsSupportMobile(BuildTarget platform) { | ||
return platform == BuildTarget.iOS || platform == BuildTarget.Android; | ||
} | ||
|
||
public static bool IsSupportStandalone(BuildTarget platform) { | ||
return platform == BuildTarget.StandaloneOSX || | ||
platform == BuildTarget.StandaloneWindows || platform == BuildTarget.StandaloneWindows64; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Xml; | ||
using UnityEngine; | ||
using UnityEditor; | ||
|
||
namespace TapSDK.Core.Editor { | ||
public class LinkedAssembly { | ||
public string Fullname { get; set; } | ||
public string[] Types { get; set; } | ||
} | ||
|
||
public class LinkXMLGenerator { | ||
public static void Generate(string path, IEnumerable<LinkedAssembly> assemblies) { | ||
DirectoryInfo parent = Directory.GetParent(path); | ||
if (!parent.Exists) { | ||
Directory.CreateDirectory(parent.FullName); | ||
} | ||
|
||
XmlDocument doc = new XmlDocument(); | ||
|
||
XmlNode rootNode = doc.CreateElement("linker"); | ||
doc.AppendChild(rootNode); | ||
|
||
foreach (LinkedAssembly assembly in assemblies) { | ||
XmlNode assemblyNode = doc.CreateElement("assembly"); | ||
|
||
XmlAttribute fullnameAttr = doc.CreateAttribute("fullname"); | ||
fullnameAttr.Value = assembly.Fullname; | ||
assemblyNode.Attributes.Append(fullnameAttr); | ||
|
||
if (assembly.Types?.Length > 0) { | ||
foreach (string type in assembly.Types) { | ||
XmlNode typeNode = doc.CreateElement("type"); | ||
XmlAttribute typeFullnameAttr = doc.CreateAttribute("fullname"); | ||
typeFullnameAttr.Value = type; | ||
typeNode.Attributes.Append(typeFullnameAttr); | ||
|
||
XmlAttribute typePreserveAttr = doc.CreateAttribute("preserve"); | ||
typePreserveAttr.Value = "all"; | ||
typeNode.Attributes.Append(typePreserveAttr); | ||
|
||
assemblyNode.AppendChild(typeNode); | ||
} | ||
} else { | ||
XmlAttribute preserveAttr = doc.CreateAttribute("preserve"); | ||
preserveAttr.Value = "all"; | ||
assemblyNode.Attributes.Append(preserveAttr); | ||
} | ||
|
||
rootNode.AppendChild(assemblyNode); | ||
} | ||
|
||
doc.Save(path); | ||
AssetDatabase.Refresh(); | ||
|
||
Debug.Log($"Generate {path} done."); | ||
Debug.Log(doc.OuterXml); | ||
} | ||
|
||
public static void Delete(string path) { | ||
if (File.Exists(path)) { | ||
File.Delete(path); | ||
AssetDatabase.Refresh(); | ||
} | ||
|
||
Debug.Log($"Delete {path} done."); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.