diff --git a/Editor/InstallPortDependencies.cs b/Editor/InstallPortDependencies.cs index f5d8d70..142f096 100644 --- a/Editor/InstallPortDependencies.cs +++ b/Editor/InstallPortDependencies.cs @@ -9,22 +9,66 @@ namespace NFTPort.Internal { public class InstallPortDependencies : EditorWindow { static AddRequest Request; + static AddRequest Request2; private static RemoveRequest RmRequest; private static bool newtonsoftInstalled = false; private static bool GLTFInstalled = false; + private static bool InputsysInstalled = false; + private static bool refreshing = false; [MenuItem("NFTPort/Install Dependencies")] public static void ShowWindow() { var win = GetWindow("Port Dependencies"); SetSize(win); } + + #region Scri[tinDefines + public static bool CheckScriptingDefine(string scriptingDefine) + { + BuildTargetGroup buildTargetGroup = EditorUserBuildSettings.selectedBuildTargetGroup; + var defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(buildTargetGroup); + return defines.Contains(scriptingDefine); + } + + public static void SetScriptingDefine(string scriptingDefine) + { + BuildTargetGroup buildTargetGroup = EditorUserBuildSettings.selectedBuildTargetGroup; + var defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(buildTargetGroup); + if (!defines.Contains(scriptingDefine)) + { + defines += $";{scriptingDefine}"; + PlayerSettings.SetScriptingDefineSymbolsForGroup(buildTargetGroup, defines); + } + } + + public static void RemoveScriptingDefine(string scriptingDefine) + { + BuildTargetGroup buildTargetGroup = EditorUserBuildSettings.selectedBuildTargetGroup; + var defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(buildTargetGroup); + if (defines.Contains(scriptingDefine)) + { + string newDefines = defines.Replace(scriptingDefine, ""); + PlayerSettings.SetScriptingDefineSymbolsForGroup(buildTargetGroup, newDefines); + } + } + + + #endregion + + + void OnGUI() { + GUILayout.BeginHorizontal("box"); GUILayout.Label("\n" + " NFTPort needs the following packages : \n" + "", EditorStyles.label); + if (GUILayout.Button("Refresh", GUILayout.Height(18))) + OnEnable(); + GUILayout.EndHorizontal(); + GUILayout.BeginHorizontal("box"); GUILayout.Label("com.unity.nuget.newtonsoft-json"); var defaultcol = GUI.contentColor; @@ -72,12 +116,38 @@ void OnGUI() if (GUILayout.Button("Remove Dependency", GUILayout.Height(25))) RemoveGLTF(); GUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal("box"); + GUILayout.Label("Unity Input System | Used by NFTPort Playground Sample"); + if (InputsysInstalled) + { + GUI.contentColor = Color.green; + GUILayout.Label(": installed"); + GUI.contentColor = defaultcol; + } + else + { + GUILayout.Label(": Not Installed in UPM"); + } + GUILayout.EndHorizontal(); + GUILayout.BeginHorizontal("box"); + if (GUILayout.Button("Install Now", GUILayout.Height(25))) + AddInputSys(); + + if (GUILayout.Button("Remove Dependency", GUILayout.Height(25))) + RemoveInputSys(); + GUILayout.EndHorizontal(); + + + GUI.contentColor = Color.yellow; + if(refreshing) + GUILayout.Label("refreshing..."); } static void SetSize(InstallPortDependencies win) { - win.minSize = new Vector2(330*2, 120*2); - win.maxSize = new Vector2(330*2, 120*2); + win.minSize = new Vector2(330*2, 290); + win.maxSize = new Vector2(330*2, 290); } private void OnEnable() @@ -85,6 +155,7 @@ private void OnEnable() CheckPkgsListForNewtonsoft(); CheckPkgsListForGLTFt(); + CheckPkgsListForInputsyst(); } #region newtonsoft @@ -94,6 +165,7 @@ public static void CheckPkgsListForNewtonsoft() { listRequest = Client.List(); // List packages installed for the Project EditorApplication.update += CheckPackageProgress; + refreshing = true; } private static UnityAction OnListCheckCompleteActionNewtonPackageExists; @@ -130,6 +202,7 @@ static void CheckPackageProgress() static void EndListCheck() { EditorApplication.update -= CheckPackageProgress; + refreshing = false; if (newtonsoftInstalled) { @@ -206,6 +279,7 @@ public static void CheckPkgsListForGLTFt() { listRequestgltf = Client.List(); // List packages installed for the Project EditorApplication.update += CheckPackageProgressGLTF; + refreshing = true; } static void CheckPackageProgressGLTF() @@ -233,11 +307,12 @@ static void CheckPackageProgressGLTF() static void EndListCheckGLTF() { EditorApplication.update -= CheckPackageProgressGLTF; - + refreshing = false; if (GLTFInstalled) { if(OnListCheckCompleteActionGLTFxists!=null) OnListCheckCompleteActionGLTFxists.Invoke(true); + } else { @@ -297,5 +372,114 @@ static void RemoveProgressGLTF() } #endregion + + #region UnityInputSystem + private static UnityAction OnListCheckCompleteActionInputSysxists; + public static void OnListCheckCompleteForInputSys(UnityAction action) + { + OnListCheckCompleteActionInputSysxists = action; + + } + /// ///////// CHECK + static ListRequest listRequestinputsys; + public static void CheckPkgsListForInputsyst() + { + listRequestinputsys = Client.List(); // List packages installed for the Project + EditorApplication.update += CheckPackageProgressInputsys; + refreshing = true; + } + + static void CheckPackageProgressInputsys() + { + if (listRequestinputsys.IsCompleted) + { + if (listRequestinputsys.Status == StatusCode.Success) + foreach (var package in listRequestinputsys.Result) + { + InputsysInstalled = false; + if (package.name.Contains("com.unity.inputsystem")) + { + InputsysInstalled = true; + break; + } + } + else if (listRequestinputsys.Status >= StatusCode.Failure) + { + Debug.Log(listRequestinputsys.Error.message); + } + + EndListCheckInputsys(); + } + } + static void EndListCheckInputsys() + { + EditorApplication.update -= CheckPackageProgressInputsys; + refreshing = false; + if (InputsysInstalled) + { + if(OnListCheckCompleteActionInputSysxists!=null) + OnListCheckCompleteActionInputSysxists.Invoke(true); + + SetScriptingDefine("ENABLE_INPUT_SYSTEM"); + } + else + { + if(OnListCheckCompleteActionInputSysxists!=null) + OnListCheckCompleteActionInputSysxists.Invoke(false); + RemoveScriptingDefine("ENABLE_INPUT_SYSTEM"); + } + } + + + //////////// ADD + public static void AddInputSys() + { + // Add a package to the project + Request2 = Client.Add("com.unity.inputsystem"); + EditorApplication.update += AddProgressInputSys; + } + + static void AddProgressInputSys() + { + if (Request2.IsCompleted) + { + if (Request2.Status == StatusCode.Success) + { + Debug.Log("Installed: " + Request2.Result.packageId); + CheckPackageProgressInputsys(); + } + + else if (Request2.Status >= StatusCode.Failure) + Debug.Log(Request2.Error.message); + + EditorApplication.update -= AddProgressInputSys; + } + } + + //////////// RM + public static void RemoveInputSys() + { + RemoveScriptingDefine("ENABLE_INPUT_SYSTEM"); + RmRequest = Client.Remove("com.unity.inputsystem"); + EditorApplication.update += RemoveProgressInputSys; + } + + static void RemoveProgressInputSys() + { + if (RmRequest.IsCompleted) + { + if (RmRequest.Status == StatusCode.Success) + { + Debug.Log("removed: " + RmRequest.PackageIdOrName); + } + else if (RmRequest.Status >= StatusCode.Failure) + Debug.Log(RmRequest.Error.message); + + EditorApplication.update -= RemoveProgressInputSys; + CheckPackageProgressInputsys(); + } + } + + #endregion } } \ No newline at end of file diff --git a/Editor/Readme.cs b/Editor/Readme.cs new file mode 100644 index 0000000..3529609 --- /dev/null +++ b/Editor/Readme.cs @@ -0,0 +1,19 @@ +using System; +using UnityEngine; + +namespace NFTPort.Editor +{ + public class Readme : ScriptableObject { + public Texture2D icon; + public float iconMaxWidth = 128f; + public string title; + public Section[] sections; + public bool loadedLayout; + public bool notFirstload; + + [Serializable] + public class Section { + public string heading, text, linkText, url; + } + } +} diff --git a/Editor/Readme.cs.meta b/Editor/Readme.cs.meta new file mode 100644 index 0000000..640b190 --- /dev/null +++ b/Editor/Readme.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fcf7219bab7fe46a1ad266029b2fee19 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - icon: {fileID: 2800000, guid: 1b480bc9fbc74b244a6d80b08833b0f1, type: 3} + executionOrder: 0 + icon: {fileID: 2800000, guid: 1b480bc9fbc74b244a6d80b08833b0f1, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/ReadmeEditor.cs b/Editor/ReadmeEditor.cs new file mode 100644 index 0000000..36d30ec --- /dev/null +++ b/Editor/ReadmeEditor.cs @@ -0,0 +1,162 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using System; +using System.IO; +using System.Reflection; + +namespace NFTPort.Editor +{ + [CustomEditor(typeof(Readme))] + [InitializeOnLoad] + public class ReadmeEditor : UnityEditor.Editor { + + static string kShowedReadmeSessionStateName = "ReadmeEditor.showedReadme"; + + static float kSpace = 16f; + + static ReadmeEditor() + { + EditorApplication.delayCall += SelectReadmeAutomatically; + } + + static void SelectReadmeAutomatically() + { + if (!SessionState.GetBool(kShowedReadmeSessionStateName, false )) + { + var readme = SelectReadme(); + SessionState.SetBool(kShowedReadmeSessionStateName, true); + + if (readme && !readme.loadedLayout) + { + LoadLayout(); + readme.loadedLayout = true; + } + } + } + + static void LoadLayout() + { + var assembly = typeof(EditorApplication).Assembly; + var windowLayoutType = assembly.GetType("UnityEditor.WindowLayout", true); + var method = windowLayoutType.GetMethod("LoadWindowLayout", BindingFlags.Public | BindingFlags.Static); + method.Invoke(null, new object[]{Path.Combine(Application.dataPath, "TutorialInfo/Layout.wlt"), false}); + } + + [MenuItem("Tutorial/Show Tutorial Instructions")] + static Readme SelectReadme() + { + var ids = AssetDatabase.FindAssets("Readme t:Readme"); + if (ids.Length == 1) + { + var readmeObject = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GUIDToAssetPath(ids[0])); + + Selection.objects = new UnityEngine.Object[]{readmeObject}; + + return (Readme)readmeObject; + } + else + { + Debug.Log("Couldn't find a readme"); + return null; + } + } + + protected override void OnHeaderGUI() + { + var readme = (Readme)target; + Init(); + + var iconWidth = Mathf.Min(EditorGUIUtility.currentViewWidth/3f - 20f, 128f); + + GUILayout.BeginHorizontal("In BigTitle"); + { + GUILayout.Label(readme.icon, GUILayout.Width(iconWidth), GUILayout.Height(iconWidth)); + GUILayout.Label(readme.title, TitleStyle); + } + GUILayout.EndHorizontal(); + } + + public override void OnInspectorGUI() + { + var readme = (Readme)target; + Init(); + + foreach (var section in readme.sections) + { + if (!string.IsNullOrEmpty(section.heading)) + { + GUILayout.Label(section.heading, HeadingStyle); + } + if (!string.IsNullOrEmpty(section.text)) + { + GUILayout.Label(section.text, BodyStyle); + } + if (!string.IsNullOrEmpty(section.linkText)) + { + if (LinkLabel(new GUIContent(section.linkText))) + { + Application.OpenURL(section.url); + } + } + GUILayout.Space(kSpace); + } + } + + + bool m_Initialized; + + GUIStyle LinkStyle { get { return m_LinkStyle; } } + [SerializeField] GUIStyle m_LinkStyle; + + GUIStyle TitleStyle { get { return m_TitleStyle; } } + [SerializeField] GUIStyle m_TitleStyle; + + GUIStyle HeadingStyle { get { return m_HeadingStyle; } } + [SerializeField] GUIStyle m_HeadingStyle; + + GUIStyle BodyStyle { get { return m_BodyStyle; } } + [SerializeField] GUIStyle m_BodyStyle; + + void Init() + { + if (m_Initialized) + return; + m_BodyStyle = new GUIStyle(EditorStyles.label); + m_BodyStyle.wordWrap = true; + m_BodyStyle.fontSize = 14; + + m_TitleStyle = new GUIStyle(m_BodyStyle); + m_TitleStyle.fontSize = 26; + + m_HeadingStyle = new GUIStyle(m_BodyStyle); + m_HeadingStyle.fontSize = 18 ; + + m_LinkStyle = new GUIStyle(m_BodyStyle); + m_LinkStyle.wordWrap = false; + // Match selection color which works nicely for both light and dark skins + m_LinkStyle.normal.textColor = new Color (0x00/255f, 0x78/255f, 0xDA/255f, 1f); + m_LinkStyle.stretchWidth = false; + + m_Initialized = true; + } + + bool LinkLabel (GUIContent label, params GUILayoutOption[] options) + { + var position = GUILayoutUtility.GetRect(label, LinkStyle, options); + + Handles.BeginGUI (); + Handles.color = LinkStyle.normal.textColor; + Handles.DrawLine (new Vector3(position.xMin, position.yMax), new Vector3(position.xMax, position.yMax)); + Handles.color = Color.white; + Handles.EndGUI (); + + EditorGUIUtility.AddCursorRect (position, MouseCursor.Link); + + return GUI.Button (position, label, LinkStyle); + } + } + +} + diff --git a/Editor/ReadmeEditor.cs.meta b/Editor/ReadmeEditor.cs.meta new file mode 100644 index 0000000..b3e9bf4 --- /dev/null +++ b/Editor/ReadmeEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a057215713c1e8c4187028bfbc6474dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/README.md b/README.md index 3bd4465..cbf9472 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,21 @@ -

![NFTPort Gaming](https://imgur.com/yPKRwvU.png) -[![star this repo](https://img.shields.io/github/stars/nftport/nftport-unity?label=Star%20the%20Repo&style=social)](https://github.com/nftport/nftport-unity) -[![Join Discord](https://img.shields.io/discord/862277439023874059?logo=discord)](https://discord.gg/w92sXkNmBR) -[![Follow Twitter](https://img.shields.io/twitter/follow/nftport_xyz?style=social&logo=twitter)](https://twitter.com/intent/follow?screen_name=nftport_xy)
-[![Release](https://img.shields.io/github/v/release/nftport/nftport-unity)](https://github.com/nftport/nftport-unity/releases) -[![Json](https://img.shields.io/github/package-json/v/nftport/nftport-unity/com.nftport.nftport?style=flat-square)]() -[![Json](https://img.shields.io/github/package-json/v/nftport/nftport-unity/preview_branch?style=flat-square)]()
-[![License](https://img.shields.io/github/license/nftport/nftport-unity?style=flat-square)](https://github.com/nftport/nftport-unity/blob/com.nftport.nftport/LICENSE.md) -[![Made with Unity](https://img.shields.io/badge/Made%20with-Unity-57b9d3.svg?style=flat-square&logo=unity)](https://unity3d.com) -[![Made with NFTPort](https://img.shields.io/badge/Made%20with-NFTPort-black?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAtCAYAAAA6GuKaAAAFSUlEQVRYhdVZb0gjRxR/m8SYhBj/4CIS5DzOelLxTwsih9whKKUgyJ30FCqCX4pQBUFU8EMV/eJBOBDEK9yX4iFUPxSVHpRTavEoIiIV/7UgKGpIJBGi8c642Wx2y5s6YRsTm2Q3uesPBmZ3Z9/85s1782beMEdHR4AIBAKg1WohGAyCxWL5LCMjowEAvtTpdKUAoIUUQhCEfUmS3nAc94vX613WaDSEn06nA4ZhgJDGyvv378FoNOpZlv3BaDR+je8kSQJRFFPJlwBJYv8Iv9//m8fjafd6vccmk+kf0sfHx2QUDMPcs1qtb/R6/T3UNhL+GIDaFUXR53Q6GzmO+zU9PR2Yvb09NAvtnTt37FqtNl8QhBBVai4fEqi8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CjQXlDc7OxsKRPTGLRy4o5Qk6U/G7XZXsyy7Gn45hAN59+4d5q8jmgG2RY1kZ2eHQniikN+rYDDCQwIezyIl1c/Ozr4hF0UFBQWrBoOhOjzLH8t9i/wGQQnkxFEmvfORcxEE4cJut7Ma/OhyuRohQnIFf/6vohaog9IZlBOmPud2uxt4nuc1aJuBQMDtcDjqRFEUlGb5lQLNVK4MOgCXy/Wtz+f7He1fg8aNh1Ov17vkdDpLeZ7/gyZXUpEBjQR6ZXdtEg632/2Fx+P5PsSLeirer9BpyMzMfGo2m79iGOZzhmHYVAYghCRJHkmS/uI47iev1zsliiKH2idaZxj4GxRC6+g7LT4GAAAAAElFTkSuQmCC)](https://www.nftport.xyz/) - + [![star this repo](https://img.shields.io/github/stars/nftport/nftport-unity?label=Star%20the%20Repo&style=social)](https://github.com/nftport/nftport-unity) + [![Join Discord](https://img.shields.io/discord/862277439023874059?logo=discord)](https://discord.gg/w92sXkNmBR) + [![Follow Twitter](https://img.shields.io/twitter/follow/nftport_xyz?style=social&logo=twitter)](https://twitter.com/intent/follow?screen_name=nftport_xy)
+ [![Release](https://img.shields.io/github/v/release/nftport/nftport-unity)](https://github.com/nftport/nftport-unity/releases) + [![Json](https://img.shields.io/github/package-json/v/nftport/nftport-unity/com.nftport.nftport?style=flat-square)]() + [![Json](https://img.shields.io/github/package-json/v/nftport/nftport-unity/preview_branch?style=flat-square)]()
+ [![License](https://img.shields.io/github/license/nftport/nftport-unity?style=flat-square)](https://github.com/nftport/nftport-unity/blob/com.nftport.nftport/LICENSE.md) + [![Made with Unity](https://img.shields.io/badge/Made%20with-Unity-57b9d3.svg?style=flat-square&logo=unity)](https://unity3d.com) + [![Made with NFTPort](https://img.shields.io/badge/Made%20with-NFTPort-black?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAtCAYAAAA6GuKaAAAFSUlEQVRYhdVZb0gjRxR/m8SYhBj/4CIS5DzOelLxTwsih9whKKUgyJ30FCqCX4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+hwGcNjW319PWxvb0NZWZkqciNBNdI0jYanepZlYWtri5yok4GkrNM0eMzMzMDw8LDq8lXTdPh7SnxwcBCmp6eVdHMDSYuIcuItLS2wsbEBhYWFqshOahin6Sx00MrKSuKgDx8+VCw3JXsP6qBmsxnevn0LPT09t7ZP2eoRC6i5YGJzbGws4X7jyjAphdzOu7u7SUbWaDTGqwySYUo4h5tIuoDaOeblGhoaYHd3F0pKSuISoQkGgwfRcs+Yy7gNFxcXcZOmQNJI/u7du2RlwdwJRbRE/nUAu8SbgIVoGrNYLGRTZDAYbhR8n5ubmzBpCjQXlDc7OxsKRPTGLRy4o5Qk6U/G7XZXsyy7Gn45hAN59+4d5q8jmgG2RY1kZ2eHQniikN+rYDDCQwIezyIl1c/Ozr4hF0UFBQWrBoOhOjzLH8t9i/wGQQnkxFEmvfORcxEE4cJut7Ma/OhyuRohQnIFf/6vohaog9IZlBOmPud2uxt4nuc1aJuBQMDtcDjqRFEUlGb5lQLNVK4MOgCXy/Wtz+f7He1fg8aNh1Ov17vkdDpLeZ7/gyZXUpEBjQR6ZXdtEg632/2Fx+P5PsSLeirer9BpyMzMfGo2m79iGOZzhmHYVAYghCRJHkmS/uI47iev1zsliiKH2idaZxj4GxRC6+g7LT4GAAAAAElFTkSuQmCC)](https://www.nftport.xyz/) ![Screenshot 2022-06-25 034312](https://user-images.githubusercontent.com/43649755/176864004-9599128b-16cd-48b1-b4ae-a8d654453532.jpg) ### Introduction -NFTPort's Unity extension provides tools and features to fast-track development and create cross-chain compatible NFT games and products in Unity with fast and reliable onchain data. +NFTPort's Unity extension wraps NFTPort API's and provides tools and features to fast-track development and create cross-chain compatible NFT games and products in Unity with fast and reliable onchain data. ### Get NFTPort Unity extension Import as a package using Git URL: In Unity's Package Manager, click the '+' on the top left corner and select 'Add package from git URL.' @@ -28,10 +26,10 @@ Import as a package using Git URL: In Unity's Package Manager, click the '+' on
Upto 100 or more free NFT mints and 5 fully owned customizable contracts for your first product/development. -

+

+ +![3dfree](https://user-images.githubusercontent.com/43649755/175334913-12e4310f-06c5-407e-ac9d-fa0681c595f7.gif) - ![3dfree](https://user-images.githubusercontent.com/43649755/175334913-12e4310f-06c5-407e-ac9d-fa0681c595f7.gif) -

------- diff --git a/Samples~/NFTPort Playground/Supporting Assets/Minimal Starter Assets/InputSystem/StarterAssetsInputs.cs b/Samples~/NFTPort Playground/Supporting Assets/Minimal Starter Assets/InputSystem/StarterAssetsInputs.cs index a7d9f59..bfcf3ae 100644 --- a/Samples~/NFTPort Playground/Supporting Assets/Minimal Starter Assets/InputSystem/StarterAssetsInputs.cs +++ b/Samples~/NFTPort Playground/Supporting Assets/Minimal Starter Assets/InputSystem/StarterAssetsInputs.cs @@ -1,5 +1,5 @@ using UnityEngine; -#if ENABLE_INPUT_SYSTEM && STARTER_ASSETS_PACKAGES_CHECKED +#if ENABLE_INPUT_SYSTEM using UnityEngine.InputSystem; #endif diff --git a/Samples~/NFTPort Playground/Supporting Assets/SampleImport_Playground.cs b/Samples~/NFTPort Playground/Supporting Assets/SampleImport_Playground.cs index 08a619d..86bdf8a 100644 --- a/Samples~/NFTPort Playground/Supporting Assets/SampleImport_Playground.cs +++ b/Samples~/NFTPort Playground/Supporting Assets/SampleImport_Playground.cs @@ -41,13 +41,16 @@ static void SampleDependencyCheck() { InstallPortDependencies.OnListCheckCompleteForGLTF(arg0 => GLTFDependencyAction(arg0)); InstallPortDependencies.CheckPkgsListForGLTFt(); + + InstallPortDependencies.OnListCheckCompleteForInputSys((arg0 => GLTFDependencyAction(arg0))); + InstallPortDependencies.CheckPkgsListForInputsyst(); } static void GLTFDependencyAction(bool exists) { if (!exists) { - Debug.Log("This Sample needs GLTF Utility as it uses .glb models which makes the 3D NFT models compatible to show at browser and at marketplaces like opensea, please install it via NFTPort/Install Dependencies"); + Debug.Log("This Sample needs GLTF Utility as it uses .glb models which makes the 3D NFT models compatible to show at browser and at marketplaces like opensea, and Unity's New Input System. Please install it via NFTPort/Install Dependencies"); InstallPortDependencies.ShowWindow(); } } diff --git a/Samples~/NFTPort Playground/Supporting Assets/ThirdPersonController_PortMod.cs b/Samples~/NFTPort Playground/Supporting Assets/ThirdPersonController_PortMod.cs index 7d59145..176c834 100644 --- a/Samples~/NFTPort Playground/Supporting Assets/ThirdPersonController_PortMod.cs +++ b/Samples~/NFTPort Playground/Supporting Assets/ThirdPersonController_PortMod.cs @@ -1,5 +1,5 @@ using UnityEngine; -#if ENABLE_INPUT_SYSTEM && STARTER_ASSETS_PACKAGES_CHECKED +#if ENABLE_INPUT_SYSTEM using UnityEngine.InputSystem; #endif diff --git a/package.json b/package.json index ab92d0f..9cfc004 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ } ], "dependencies": { - "com.unity.nuget.newtonsoft-json": "2.0.2" + "com.unity.nuget.newtonsoft-json": "3.0.2" }, "keywords": [ "Web3",