skybox subsetter
This commit is contained in:
8
Assets/Scripts/EditorGame/Animations/Camera.meta
Normal file
8
Assets/Scripts/EditorGame/Animations/Camera.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33fed65294a2fca4f98dee57d861fd7f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
105
Assets/Scripts/EditorGame/Animations/Camera/CameraFieldOfView.cs
Normal file
105
Assets/Scripts/EditorGame/Animations/Camera/CameraFieldOfView.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public partial class CameraFieldOfView : AnimationBase
|
||||
{
|
||||
public FlexibleFloat fieldOfView;
|
||||
public GameCamera targetGameCamera;
|
||||
|
||||
public static CameraFieldOfView GenerateElement(string elementName, Guid id,
|
||||
List<string> tags, bool isFirstGenerated, GameCamera gameCamera, FlexibleFloat fieldOfView)
|
||||
{
|
||||
CameraFieldOfView camFOV = Instantiate(EditorManager.instance.basePrefabs.emptyObject)
|
||||
.AddComponent<CameraFieldOfView>();
|
||||
camFOV.Initialize(elementName, id, tags, isFirstGenerated, gameCamera);
|
||||
|
||||
camFOV.animatedObject = gameCamera;
|
||||
camFOV.targetGameCamera = gameCamera;
|
||||
|
||||
camFOV.fieldOfView = fieldOfView;
|
||||
camFOV.animationReturnType = FlexibleReturnType.Before;
|
||||
|
||||
return camFOV;
|
||||
}
|
||||
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
}
|
||||
|
||||
protected override void UpdateAnimation(float songTime)
|
||||
{
|
||||
fieldOfView.UpdateFlexibleFloat(songTime);
|
||||
|
||||
if (fieldOfView.returnType == FlexibleReturnType.MiddleExecuting)
|
||||
{
|
||||
targetGameCamera.perspectiveAngle = fieldOfView.value;
|
||||
targetGameCamera.gameCamera.fieldOfView = fieldOfView.value;
|
||||
}
|
||||
}
|
||||
|
||||
public override void ApplyTimeOffset(float offset)
|
||||
{
|
||||
base.ApplyTimeOffset(offset);
|
||||
fieldOfView.animations.ForEach(anim => anim.ApplyTimeOffset(offset));
|
||||
}
|
||||
}
|
||||
|
||||
public partial class CameraFieldOfView
|
||||
{
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new CameraFieldOfView_BM(elementName, elementGuid, tags, targetGameCamera.matchedBM as GameCamera_BM, fieldOfView.ConvertToBM());
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
base.SetUpInspector();
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("Camera Field of View");
|
||||
var subcontainer = container.GenerateSubcontainer(3);
|
||||
var fovButton = inspector.GenerateButton(this, subcontainer, "Field of View", () =>
|
||||
{
|
||||
inspector.GenerateCompositeParameterWindow(this, "Field of View", nameof(fieldOfView)).SetAsFlexibleFloat();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public partial class CameraFieldOfView_BM : AnimationBase_BM
|
||||
{
|
||||
public FlexibleFloat_BM fieldOfView;
|
||||
|
||||
public CameraFieldOfView_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public CameraFieldOfView_BM(string elementName, Guid elementGuid, List<string> tags,
|
||||
GameElement_BM attachedElement, FlexibleFloat_BM fieldOfView)
|
||||
: base(elementName, elementGuid, tags, attachedElement)
|
||||
{
|
||||
this.fieldOfView = fieldOfView;
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = CameraFieldOfView.GenerateElement(elementName, elementGuid, tags, false,
|
||||
GetElement(attachedElementGuid) as GameCamera, fieldOfView.ConvertToGameType());
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return CameraFieldOfView.GenerateElement(elementName, Guid.NewGuid(), tags, false,
|
||||
parent as GameCamera, fieldOfView.ConvertToGameType());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 701abff238d3b4643acb1ae607e27c49
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -75,7 +75,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class TrackTotalTimeChange_BM : GameElement_BM
|
||||
public class TrackTotalTimeChange_BM : AnimationBase_BM
|
||||
{
|
||||
public FlexibleFloat_BM totalTime;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user