アセット選定

This commit is contained in:
oogushiyuuga
2026-06-22 18:13:33 +09:00
parent 50f8ea0d99
commit 37a9909520
322 changed files with 51703 additions and 3 deletions

View File

@@ -0,0 +1,130 @@
using UnityEngine;
using UnityEditor;
using System.IO;
using UnityEngine.Rendering;
public class ConifersInstaller : EditorWindow
{
static ConifersInstaller window;
int selectedPipeline = 0;
string launcherPath = "Assets/Forst/Conifers [BOTD]/Installer/Editor/LaunchConifersInstaller";
string[] supportedPipelines = new string[3]
{
"Built in render pipeline",
"URP",
"HDRP"
};
string[] packagePaths = new string[3]
{
"Assets/Forst/Conifers [BOTD]/Conifers_BIRP.unitypackage",
"Assets/Forst/Conifers [BOTD]/Conifers_URP.unitypackage",
"Assets/Forst/Conifers [BOTD]/Conifers_HDRP.unitypackage"
};
bool pipelineChecked = false;
[MenuItem( "Window/Forst/Install Conifers Package", false, 1000 )]
public static void Init()
{
window = GetWindow<ConifersInstaller>(false, "Forst - Conifers Installer", true);
window.minSize = window.maxSize = new Vector2(520, 280);
}
public void OnGUI()
{
var _style_bodytxt = new GUIStyle(EditorStyles.label);
_style_bodytxt.wordWrap = true;
_style_bodytxt.fontSize = 12;
if (!pipelineChecked)
{
pipelineChecked = true;
if (GraphicsSettings.defaultRenderPipeline != null)
{
if (GraphicsSettings.defaultRenderPipeline.GetType().ToString().Contains("HD"))
{
selectedPipeline = 2;
}
else if (GraphicsSettings.defaultRenderPipeline.GetType().ToString().Contains("Universal"))
{
selectedPipeline = 1;
}
}
}
GUILayout.Space(16);
EditorGUILayout.BeginVertical();
GUILayout.BeginHorizontal();
GUILayout.Space(16);
EditorGUILayout.LabelField("Welcome to the Conifers [BOTD] Package!", EditorStyles.boldLabel);
GUILayout.Space(16);
GUILayout.EndHorizontal();
GUILayout.Space(8);
GUILayout.BeginHorizontal();
GUILayout.Space(16);
EditorGUILayout.LabelField(
"This package contains multiple sub packages which add support for the built in render pipeline, URP or HDRP. " +
"Please select the render pipeline used in your project to install the appropriate sub package.", _style_bodytxt);
GUILayout.Space(16);
GUILayout.EndHorizontal();
GUILayout.Space(8);
GUILayout.BeginHorizontal();
GUILayout.Space(16);
GUILayout.Label("Choose your render pipeline", GUILayout.Width(240));
GUILayout.BeginVertical();
selectedPipeline = EditorGUILayout.Popup(selectedPipeline, supportedPipelines);
GUILayout.Space(4);
if (GUILayout.Button("Install selected package", GUILayout.Height(28)))
{
InstallPackage();
}
GUILayout.EndVertical();
GUILayout.Space(16);
GUILayout.EndHorizontal();
GUILayout.Space(16);
GUI.enabled = true;
if (!File.Exists(launcherPath + ".cs"))
{
GUI.enabled = false;
}
GUILayout.BeginHorizontal();
GUILayout.Space(16);
EditorGUILayout.LabelField(
"Once you have installed the needed package you can remove the automatic launcher script from your project. " +
"You can still open this window by choosing 'Window' -> 'Forst' -> 'Install Conifers Package'.", _style_bodytxt);
GUILayout.Space(16);
GUILayout.EndHorizontal();
GUILayout.Space(8);
GUILayout.BeginHorizontal();
GUILayout.Space(16);
GUILayout.Label("Delete the launcher", GUILayout.Width(240));
if (GUILayout.Button("Delete", GUILayout.Height(28)))
{
FileUtil.DeleteFileOrDirectory(launcherPath + ".cs");
FileUtil.DeleteFileOrDirectory(launcherPath + ".meta");
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
}
GUILayout.Space(16);
GUILayout.EndHorizontal();
GUILayout.EndVertical();
}
void InstallPackage()
{
AssetDatabase.ImportPackage(packagePaths[selectedPipeline], true);
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: ec52f9eee8853094e8743994573aab70
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 142076
packageName: 'Conifers [BOTD]'
packageVersion: 2.01
assetPath: Assets/Forst/Conifers [BOTD]/Installer/Editor/ConifersInstaller.cs
uploadId: 649803

View File

@@ -0,0 +1,24 @@
using UnityEditor;
using UnityEngine;
using System;
using System.Collections;
[InitializeOnLoad]
public class LaunchConifersInstaller
{
static LaunchConifersInstaller()
{
EditorApplication.update += Update;
}
static void Update()
{
EditorApplication.update -= Update;
if( !EditorApplication.isPlayingOrWillChangePlaymode )
{
ConifersInstaller.Init();
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: a763f5a1ec8fa1746bec38f0547741ab
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 142076
packageName: 'Conifers [BOTD]'
packageVersion: 2.01
assetPath: Assets/Forst/Conifers [BOTD]/Installer/Editor/LaunchConifersInstaller.cs
uploadId: 649803