更新一些冲突内容

This commit is contained in:
2025-09-02 01:12:08 +08:00
parent 5365ab6441
commit f9f80aa559
6 changed files with 122 additions and 22 deletions

61
Convention/Editor/File.cs Normal file
View File

@@ -0,0 +1,61 @@
using System.Collections;
using System.Collections.Generic;
using System.IO;
using Convention.SO;
using UnityEditor;
using UnityEngine;
namespace Convention
{
public class FileEditor : AbstractCustomEditor
{
[MenuItem("Convention/AssetBundle/Create for Android")]
static void CreatAssetBundle()
{
string path = Path.Combine(Application.streamingAssetsPath, "AssetBundle", "Android");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
BuildPipeline.BuildAssetBundles(path, BuildAssetBundleOptions.None, BuildTarget.Android);
UnityEngine.Debug.Log("Android Finish!");
}
[MenuItem("Convention/AssetBundle/Create for IOS")]
static void BuildAllAssetBundlesForIOS()
{
string dirName = "AssetBundles/IOS/IOS";
if (!Directory.Exists(dirName))
{
Directory.CreateDirectory(dirName);
}
BuildPipeline.BuildAssetBundles(dirName, BuildAssetBundleOptions.None, BuildTarget.iOS);
UnityEngine.Debug.Log("IOS Finish!");
}
[MenuItem("Convention/AssetBundle/Create for Windows")]
static void CreatPCAssetBundleForwINDOWS()
{
string path = Path.Combine(Application.streamingAssetsPath, "AssetBundle", "Windows");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
BuildPipeline.BuildAssetBundles(path, BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows64);
UnityEngine.Debug.Log("Windows Finish!");
}
[MenuItem("Convention/AssetBundle/Create for Mac")]
static void CreatPCAssetBundleForMac()
{
string path = Path.Combine(Application.streamingAssetsPath, "AssetBundle", "Mac");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
BuildPipeline.BuildAssetBundles(path, BuildAssetBundleOptions.None, BuildTarget.StandaloneOSX);
UnityEngine.Debug.Log("Mac Finish!");
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0fde7509f09639547adff8534a7d9698
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -412,18 +412,18 @@ namespace Convention
BandNegativeCheck();
}
void Update()
{
float[] spectrum = new float[256];
AudioListener.GetSpectrumData(spectrum, 0, FFTWindow.Rectangular);
for (int i = 1; i < spectrum.Length - 1; i++)
{
Debug.DrawLine(new Vector3(i - 1, spectrum[i] + 10, 0), new Vector3(i, spectrum[i + 1] + 10, 0), Color.red);
Debug.DrawLine(new Vector3(i - 1, Mathf.Log(spectrum[i - 1]) + 10, 2), new Vector3(i, Mathf.Log(spectrum[i]) + 10, 2), Color.cyan);
Debug.DrawLine(new Vector3(Mathf.Log(i - 1), spectrum[i - 1] - 10, 1), new Vector3(Mathf.Log(i), spectrum[i] - 10, 1), Color.green);
Debug.DrawLine(new Vector3(Mathf.Log(i - 1), Mathf.Log(spectrum[i - 1]), 3), new Vector3(Mathf.Log(i), Mathf.Log(spectrum[i]), 3), Color.blue);
}
}
//void Update()
//{
// float[] spectrum = new float[256];
// AudioListener.GetSpectrumData(spectrum, 0, FFTWindow.Rectangular);
// for (int i = 1; i < spectrum.Length - 1; i++)
// {
// Debug.DrawLine(new Vector3(i - 1, spectrum[i] + 10, 0), new Vector3(i, spectrum[i + 1] + 10, 0), Color.red);
// Debug.DrawLine(new Vector3(i - 1, Mathf.Log(spectrum[i - 1]) + 10, 2), new Vector3(i, Mathf.Log(spectrum[i]) + 10, 2), Color.cyan);
// Debug.DrawLine(new Vector3(Mathf.Log(i - 1), spectrum[i - 1] - 10, 1), new Vector3(Mathf.Log(i), spectrum[i] - 10, 1), Color.green);
// Debug.DrawLine(new Vector3(Mathf.Log(i - 1), Mathf.Log(spectrum[i - 1]), 3), new Vector3(Mathf.Log(i), Mathf.Log(spectrum[i]), 3), Color.blue);
// }
//}
}
}

View File

@@ -37,19 +37,35 @@ namespace Convention
private void Update()
{
Vector3 dxyz = Vector3.zero;
Vector3 rxyz = Vector3.zero;
//Vector3 rxyz = Vector3.zero;
if (Keyboard.current[Key.W].isPressed || Keyboard.current[Key.UpArrow].isPressed)
dxyz += TargetFollow.forward;
{
var temp = TargetFollow.forward;
//temp.y = 0;
dxyz += temp.normalized;
}
if (Keyboard.current[Key.A].isPressed || Keyboard.current[Key.LeftArrow].isPressed)
dxyz += -TargetFollow.right;
{
var temp = TargetFollow.right;
temp.y = 0;
dxyz -= temp.normalized;
}
if (Keyboard.current[Key.D].isPressed || Keyboard.current[Key.RightArrow].isPressed)
dxyz += TargetFollow.right;
{
var temp = TargetFollow.right;
temp.y = 0;
dxyz += temp.normalized;
}
if (Keyboard.current[Key.S].isPressed || Keyboard.current[Key.DownArrow].isPressed)
dxyz += -TargetFollow.forward;
{
var temp = TargetFollow.forward;
//temp.y = 0;
dxyz -= temp.normalized;
}
if (Keyboard.current[Key.Space].isPressed)
dxyz += TargetFollow.up;
dxyz += Vector3.up;
if (Keyboard.current[Key.LeftShift].isPressed)
dxyz += -TargetFollow.up;
dxyz -= Vector3.up;
var drotation = Vector3.zero;
if (isFocus)
@@ -60,13 +76,15 @@ namespace Convention
//
TargetFollow.Translate(dxyz * moveSpeed, Space.Self);
TargetFollow.Translate(dxyz * moveSpeed, Space.World);
TargetFollow.Rotate(drotation * rotationSpeed, Space.Self);
//
if (Keyboard.current[Key.Escape].isPressed)
isFocus = false;
if (Keyboard.current[Key.LeftCtrl].isPressed && Keyboard.current[Key.LeftShift].isPressed)
TargetFollow.localEulerAngles = new(0, TargetFollow.eulerAngles.y, 0);
}
}
}

View File

@@ -79,6 +79,13 @@ namespace Convention
}
public string GetName(bool is_ignore_extension = false)
{
if (OriginInfo != null)
{
if (OriginInfo is FileInfo finfo)
return is_ignore_extension ? Path.GetFileNameWithoutExtension(finfo.FullName) : finfo.Name;
else if (OriginInfo is DirectoryInfo dinfo)
return dinfo.Name;
}
var result = this.FullPath[..(
(this.FullPath.Contains('.') && is_ignore_extension)
? this.FullPath.LastIndexOf('.')
@@ -89,8 +96,8 @@ namespace Convention
? ^1
: ^0
)];
return result[(Mathf.Max(result.Contains('/') ? result.LastIndexOf('/') : -1,
result.Contains('\\') ? result.LastIndexOf('\\') : -1) + 1)..];
//result.LastIndexOf('\\') return -1 when '\\' was not been contained
return result[(Mathf.Max(result.LastIndexOf('/'), result.LastIndexOf('\\')) + 1)..];
}
public string GetExtension()
{

View File

@@ -22,8 +22,11 @@ namespace Convention.WindowsUI.Variant
public BaseWindowBar.RegisteredPageWrapper GameWindowIndex { get; private set; }
public bool IsSelectSceneCamera { get; private set; }
public void CameraSelect(bool isScene)
{
IsSelectSceneCamera = isScene;
SceneCamera.gameObject.SetActive(isScene);
ModuleCamera.gameObject.SetActive(!isScene);
if (m_GameObjectOnSceneOnly != null)