something & 编辑器指南
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Dreamteck.Splines;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
@@ -36,17 +37,17 @@ namespace Ichni.RhythmGame
|
||||
LogWindow.Log("Only one GameCamera can be created", Color.red);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
GameCamera gameCamera =
|
||||
Instantiate(EditorManager.instance.basePrefabs.gameCamera).GetComponent<GameCamera>();
|
||||
|
||||
gameCamera.Initialize(elementName, id, tags, isFirstGenerated, parentElement);
|
||||
|
||||
|
||||
cameraManager.gameCamera = gameCamera;
|
||||
cameraManager.backgroundCamera.GetComponent<UniversalAdditionalCameraData>().cameraStack.Add(gameCamera.camera);
|
||||
if (cameraManager.isSceneCameraActive) gameCamera.camera.enabled = false;
|
||||
|
||||
|
||||
|
||||
|
||||
gameCamera.parentElement = parentElement;
|
||||
gameCamera.cameraViewType = cameraViewType;
|
||||
gameCamera.camera.orthographic = cameraViewType == CameraViewType.Orthographic;
|
||||
@@ -74,13 +75,29 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public partial class GameCamera
|
||||
{
|
||||
private Vector3 GetWorldEulerAngles()
|
||||
{
|
||||
Vector3 output = transformSubmodule.originalEulerAngles;
|
||||
GameElement element = this;
|
||||
while (element != null)
|
||||
{
|
||||
if (element is IHaveTransformSubmodule)
|
||||
{
|
||||
output += ((TransformSubmodule)element.submoduleList.Where(r => r is TransformSubmodule).First()).currentEulerAngles;
|
||||
}
|
||||
element = element.parentElement;
|
||||
}
|
||||
|
||||
|
||||
return output;
|
||||
}
|
||||
public void SetTransformObserver()
|
||||
{
|
||||
Observable.EveryUpdate().Subscribe(_ =>
|
||||
{
|
||||
if (transformSubmodule.eulerAnglesOffsetLock)
|
||||
{
|
||||
rotationPoint.eulerAngles = transformSubmodule.currentEulerAngles;
|
||||
rotationPoint.localEulerAngles = transformSubmodule.originalEulerAngles;
|
||||
}
|
||||
else if (transformSubmodule.eulerAnglesDirtyMark)
|
||||
{
|
||||
@@ -91,7 +108,7 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
|
||||
transformSubmodule.currentEulerAngles = transformSubmodule.originalEulerAngles + offset;
|
||||
rotationPoint.eulerAngles = transformSubmodule.currentEulerAngles;
|
||||
rotationPoint.localEulerAngles = transformSubmodule.currentEulerAngles;
|
||||
transformSubmodule.eulerAnglesDirtyMark = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user