将Spline移出Plugin,以调整SplineRenderer的OnWillCameraRender

This commit is contained in:
SoulliesOfficial
2025-03-01 22:58:20 -05:00
parent 860d7393fb
commit 5d775ae687
529 changed files with 237 additions and 119 deletions

View File

@@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GeneralSecondaryWIndow : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

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

View File

@@ -68,7 +68,6 @@ namespace Ichni.RhythmGame
{
public enum CameraViewType
{
None = -1,
Perspective = 0,
Orthographic = 1
}

View File

@@ -12,6 +12,7 @@ namespace Ichni.RhythmGame
public partial class TrackPathSubmodule : TrackSubmodule
{
public SplineComputer path;
public SplineRenderer trackDisplay;
public List<PathNode> pathNodeList;
public Track.TrackSpaceType trackSpaceType;
@@ -21,6 +22,7 @@ namespace Ichni.RhythmGame
public TrackPathSubmodule(Track track, Track.TrackSpaceType trackSpaceType, Track.TrackSamplingType trackSamplingType, bool isClosed) : base(track)
{
this.path = track.AddComponent<SplineComputer>();
this.track.trackPathSubmodule = this;
this.pathNodeList = new List<PathNode>();
this.trackSpaceType = trackSpaceType;
@@ -29,6 +31,10 @@ namespace Ichni.RhythmGame
SetUpSplineComputer(this.trackSpaceType, this.trackSamplingType);
//闭合路径在PathNode生成时执行在初始化的情况下PathNode数量为0不会执行闭合操作
this.trackDisplay = UnityEngine.Object.Instantiate(EditorManager.instance.basePrefabs.trackDisplay, track.transform).GetComponent<SplineRenderer>();
this.trackDisplay.spline = path;
this.trackDisplay.size = 0.1f;
}
}

View File

@@ -136,7 +136,7 @@ public class FlexibleFloatTab : MonoBehaviour
Camera mainCamera;
if (EditorManager.instance.cameraManager.isSceneCameraActive)
{
mainCamera = EditorManager.instance.cameraManager.sceneCamera.camera;
mainCamera = EditorManager.instance.cameraManager.sceneCamera.sceneCamera;
}
else
{

View File

@@ -12,6 +12,7 @@ public class BasePrefabsCollection : SerializedScriptableObject
public GameObject gameCamera;
[Title("Track相关")] public GameObject track;
public GameObject trackDisplay;
public GameObject pathNode;
public Material defaultTrackMaterial;

View File

@@ -31,7 +31,7 @@ namespace Ichni.Editor
}
isSceneCameraActive = !isSceneCameraActive;
sceneCamera.camera.enabled = isSceneCameraActive;
sceneCamera.sceneCamera.enabled = isSceneCameraActive;
gameCamera.camera.enabled = !isSceneCameraActive;
}

View File

@@ -4,12 +4,13 @@ using System.Collections.Generic;
using Ichni.RhythmGame;
using Ichni.RhythmGame.Beatmap;
using UnityEngine;
using UnityEngine.Serialization;
namespace Ichni.Editor
{
public class SceneCamera : MonoBehaviour, IBaseElement
{
public Camera camera;
[FormerlySerializedAs("camera")] public Camera sceneCamera;
public GameCamera.CameraViewType viewType;
public float perspectiveAngle;
@@ -29,15 +30,15 @@ namespace Ichni.Editor
var viewTypeDropdown = inspector.GenerateDropdown(this, container, "View Type", typeof(GameCamera.CameraViewType), nameof(viewType));
var perspectiveAngleField = inspector.GenerateInputField(this, container, "Perspective Angle", nameof(perspectiveAngle));
var orthographicSizeField = inspector.GenerateInputField(this, container, "Orthographic Size", nameof(orthographicSize));
viewTypeDropdown.AddListenerFunction(_ => camera.orthographic = viewType == GameCamera.CameraViewType.Orthographic);
perspectiveAngleField.AddListenerFunction(_ => camera.fieldOfView = perspectiveAngle);
orthographicSizeField.AddListenerFunction(_ => camera.orthographicSize = orthographicSize);
viewTypeDropdown.AddListenerFunction(_ => sceneCamera.orthographic = viewType == GameCamera.CameraViewType.Orthographic);
perspectiveAngleField.AddListenerFunction(_ => sceneCamera.fieldOfView = perspectiveAngle);
orthographicSizeField.AddListenerFunction(_ => sceneCamera.orthographicSize = orthographicSize);
var positionInputFields = inspector.GenerateVector3InputField(this, container, "Position", nameof(cameraPosition), true);
positionInputFields.AddListenerFunction(() => camera.transform.position = cameraPosition);
positionInputFields.AddListenerFunction(() => sceneCamera.transform.position = cameraPosition);
var eulerAnglesInputFields = inspector.GenerateVector3InputField(this, container, "Euler Angles", nameof(cameraEulerAngles), true);
eulerAnglesInputFields.AddListenerFunction(() => camera.transform.eulerAngles = cameraEulerAngles);
eulerAnglesInputFields.AddListenerFunction(() => sceneCamera.transform.eulerAngles = cameraEulerAngles);
container.SetDeviver(1);
@@ -45,8 +46,8 @@ namespace Ichni.Editor
private void Update()
{
cameraPosition = camera.transform.position;
cameraEulerAngles = camera.transform.eulerAngles;
cameraPosition = sceneCamera.transform.position;
cameraEulerAngles = sceneCamera.transform.eulerAngles;
}
}
}