Object Tracker
This commit is contained in:
3
.idea/.idea.IchniCreatorStudio/.idea/vcs.xml
generated
3
.idea/.idea.IchniCreatorStudio/.idea/vcs.xml
generated
@@ -2,5 +2,8 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
<mapping directory="" vcs="Git" />
|
<mapping directory="" vcs="Git" />
|
||||||
|
<mapping directory="$PROJECT_DIR$/Packages/NBPostProcessing" vcs="Git" />
|
||||||
|
<mapping directory="$PROJECT_DIR$/Packages/NBShaders" vcs="Git" />
|
||||||
|
<mapping directory="$PROJECT_DIR$/Packages/XuanXuanRenderUtility" vcs="Git" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -69,6 +69,8 @@ MonoBehaviour:
|
|||||||
type: 2}
|
type: 2}
|
||||||
particleTracker: {fileID: 7924065371675278968, guid: 0b3b8df64bc2b4a4fabd753f7e9189e7,
|
particleTracker: {fileID: 7924065371675278968, guid: 0b3b8df64bc2b4a4fabd753f7e9189e7,
|
||||||
type: 3}
|
type: 3}
|
||||||
|
objectTracker: {fileID: 4179914404395760092, guid: f0debcd3b25df1546b976a04672d2e6f,
|
||||||
|
type: 3}
|
||||||
sampler: {fileID: 8976586735561836907, guid: 6191c60211a05c04ea9265f89896f4d0, type: 3}
|
sampler: {fileID: 8976586735561836907, guid: 6191c60211a05c04ea9265f89896f4d0, type: 3}
|
||||||
trail: {fileID: 4801226466239889825, guid: a21d9cdd0e3454527bec5f2b0e9a9cae, type: 3}
|
trail: {fileID: 4801226466239889825, guid: a21d9cdd0e3454527bec5f2b0e9a9cae, type: 3}
|
||||||
defaultTrailMaterial: {fileID: 2100000, guid: 8af6dd7f0725540388b84a4697118bb9,
|
defaultTrailMaterial: {fileID: 2100000, guid: 8af6dd7f0725540388b84a4697118bb9,
|
||||||
|
|||||||
184
Assets/Prefabs/GameElements/Track/ObjectTracker.prefab
Normal file
184
Assets/Prefabs/GameElements/Track/ObjectTracker.prefab
Normal file
@@ -0,0 +1,184 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &4179914404395760092
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 4793278966605267409}
|
||||||
|
- component: {fileID: 3144517396823347096}
|
||||||
|
- component: {fileID: 1220781714347628550}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: ObjectTracker
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &4793278966605267409
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4179914404395760092}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &3144517396823347096
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4179914404395760092}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: acb0592a986cebb4287d41702ab6ea22, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
updateMethod: 0
|
||||||
|
_spline: {fileID: 0}
|
||||||
|
_autoUpdate: 1
|
||||||
|
_rotationModifier:
|
||||||
|
blend: 1
|
||||||
|
useClippedPercent: 0
|
||||||
|
keys: []
|
||||||
|
_offsetModifier:
|
||||||
|
blend: 1
|
||||||
|
useClippedPercent: 0
|
||||||
|
keys: []
|
||||||
|
_colorModifier:
|
||||||
|
blend: 1
|
||||||
|
useClippedPercent: 0
|
||||||
|
keys: []
|
||||||
|
_sizeModifier:
|
||||||
|
blend: 1
|
||||||
|
useClippedPercent: 0
|
||||||
|
keys: []
|
||||||
|
_clipFromSample:
|
||||||
|
position: {x: 0, y: 0, z: 0}
|
||||||
|
up: {x: 0, y: 0, z: 0}
|
||||||
|
forward: {x: 0, y: 0, z: 0}
|
||||||
|
color: {r: 0, g: 0, b: 0, a: 0}
|
||||||
|
size: 0
|
||||||
|
percent: 0
|
||||||
|
_clipToSample:
|
||||||
|
position: {x: 0, y: 0, z: 0}
|
||||||
|
up: {x: 0, y: 0, z: 0}
|
||||||
|
forward: {x: 0, y: 0, z: 0}
|
||||||
|
color: {r: 0, g: 0, b: 0, a: 0}
|
||||||
|
size: 0
|
||||||
|
percent: 0
|
||||||
|
_loopSamples: 0
|
||||||
|
_clipFrom: 0
|
||||||
|
_clipTo: 1
|
||||||
|
animClipFrom: 0
|
||||||
|
animClipTo: 1
|
||||||
|
multithreaded: 0
|
||||||
|
buildOnAwake: 1
|
||||||
|
buildOnEnable: 0
|
||||||
|
objects: []
|
||||||
|
_evaluateOffset: 0
|
||||||
|
_spawnMethod: 0
|
||||||
|
_spawnCount: 0
|
||||||
|
_retainPrefabInstancesInEditor: 1
|
||||||
|
_objectPositioning: 0
|
||||||
|
_iteration: 0
|
||||||
|
_randomSeed: 1
|
||||||
|
_minOffset: {x: 0, y: 0, z: 0}
|
||||||
|
_maxOffset: {x: 0, y: 0, z: 0}
|
||||||
|
_offsetUseWorldCoords: 0
|
||||||
|
_minRotation: {x: 0, y: 0, z: 0}
|
||||||
|
_maxRotation: {x: 0, y: 0, z: 0}
|
||||||
|
_uniformScaleLerp: 1
|
||||||
|
_minScaleMultiplier: {x: 1, y: 1, z: 1}
|
||||||
|
_maxScaleMultiplier: {x: 1, y: 1, z: 1}
|
||||||
|
_shellOffset: 0
|
||||||
|
_applyRotation: 0
|
||||||
|
_rotateByOffset: 0
|
||||||
|
_applyScale: 0
|
||||||
|
_objectMethod: 0
|
||||||
|
delayedSpawn: 0
|
||||||
|
spawnDelay: 0.1
|
||||||
|
lastChildCount: 0
|
||||||
|
lastPointCount: 0
|
||||||
|
spawned: []
|
||||||
|
_useCustomObjectDistance: 0
|
||||||
|
_minObjectDistance: 0
|
||||||
|
_maxObjectDistance: 0
|
||||||
|
_customOffsetRule: {fileID: 0}
|
||||||
|
_customRotationRule: {fileID: 0}
|
||||||
|
_customScaleRule: {fileID: 0}
|
||||||
|
--- !u!114 &1220781714347628550
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4179914404395760092}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 8dd005989b661ca4484a9998fa134782, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
serializationData:
|
||||||
|
SerializedFormat: 2
|
||||||
|
SerializedBytes:
|
||||||
|
ReferencedUnityObjects: []
|
||||||
|
SerializedBytesString:
|
||||||
|
Prefab: {fileID: 0}
|
||||||
|
PrefabModificationsReferencedUnityObjects: []
|
||||||
|
PrefabModifications: []
|
||||||
|
SerializationNodes:
|
||||||
|
- Name: elementGuid
|
||||||
|
Entry: 2
|
||||||
|
Data: 00000000000000000000000000000000
|
||||||
|
- Name: submoduleList
|
||||||
|
Entry: 7
|
||||||
|
Data: 0|System.Collections.Generic.List`1[[Ichni.RhythmGame.SubmoduleBase,
|
||||||
|
Assembly-CSharp]], mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 12
|
||||||
|
Data: 0
|
||||||
|
- Name:
|
||||||
|
Entry: 13
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name: enableTypes
|
||||||
|
Entry: 6
|
||||||
|
Data:
|
||||||
|
elementName:
|
||||||
|
tags: []
|
||||||
|
parentElement: {fileID: 0}
|
||||||
|
connectedTab: {fileID: 0}
|
||||||
|
childElementList: []
|
||||||
|
track: {fileID: 0}
|
||||||
|
objectController: {fileID: 3144517396823347096}
|
||||||
|
objectPrefab: {fileID: 0}
|
||||||
|
themeBundleName:
|
||||||
|
objectName:
|
||||||
|
playTime: 0
|
||||||
|
stopTime: 0
|
||||||
|
spawnCount: 0
|
||||||
|
positionOffsetMin: {x: 0, y: 0}
|
||||||
|
positionOffsetMax: {x: 0, y: 0}
|
||||||
|
customPositionRuleName:
|
||||||
|
applyRotationOffset: 0
|
||||||
|
rotationOffsetMin: {x: 0, y: 0, z: 0}
|
||||||
|
rotationOffsetMax: {x: 0, y: 0, z: 0}
|
||||||
|
customRotationRuleName:
|
||||||
|
applyScaleOffset: 0
|
||||||
|
scaleOffsetMin: {x: 1, y: 1, z: 1}
|
||||||
|
scaleOffsetMax: {x: 1, y: 1, z: 1}
|
||||||
|
customScaleRuleName:
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f0debcd3b25df1546b976a04672d2e6f
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -5685,6 +5685,7 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
isLoadedProject: 0
|
isLoadedProject: 0
|
||||||
loadedProjectName:
|
loadedProjectName:
|
||||||
|
isRecovery: 0
|
||||||
--- !u!4 &1050672441
|
--- !u!4 &1050672441
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -17607,7 +17608,7 @@ RectTransform:
|
|||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 20, y: -0.00015258789}
|
m_AnchoredPosition: {x: 20, y: -0.00012207031}
|
||||||
m_SizeDelta: {x: 40, y: 0}
|
m_SizeDelta: {x: 40, y: 0}
|
||||||
m_Pivot: {x: 0.5, y: 1}
|
m_Pivot: {x: 0.5, y: 1}
|
||||||
--- !u!1 &4337614255290428457
|
--- !u!1 &4337614255290428457
|
||||||
|
|||||||
@@ -187,6 +187,15 @@ namespace Ichni.RhythmGame
|
|||||||
string.Empty, string.Empty, false, 0, 1, false, 10, Vector3.right, 10, 5, true, Vector3.zero);
|
string.Empty, string.Empty, false, 0, 1, false, 10, Vector3.right, 10, 5, true, Vector3.zero);
|
||||||
}); //Particle Tracker
|
}); //Particle Tracker
|
||||||
|
|
||||||
|
var objectTrackerButton = inspector.GenerateButton(this, particleSubcontainer, "Object Tracker",
|
||||||
|
() =>
|
||||||
|
{
|
||||||
|
ObjectTracker.GenerateElement("New Object Tracker", Guid.NewGuid(), new List<string>(), true, this,
|
||||||
|
string.Empty, string.Empty, 10, Vector2.zero, Vector2.zero, string.Empty,
|
||||||
|
false, Vector3.zero,Vector3.zero, string.Empty,
|
||||||
|
false, Vector3.zero, Vector3.zero, string.Empty);
|
||||||
|
}); //Object Tracker
|
||||||
|
|
||||||
StandardInspectionElement.GenerateForTransform(this, generateContainer); //关于有Transform的元素
|
StandardInspectionElement.GenerateForTransform(this, generateContainer); //关于有Transform的元素
|
||||||
inspector.GenerateButton(this, particleSubcontainer, "Track Global Color Change",
|
inspector.GenerateButton(this, particleSubcontainer, "Track Global Color Change",
|
||||||
() => { TrackGlobalColorChange.GenerateElement("New Track Global Color Change", Guid.NewGuid(), new List<string>(), true, this, new FlexibleFloat(true), new FlexibleFloat(true), new FlexibleFloat(true), new FlexibleFloat(true)); }); //变量容器
|
() => { TrackGlobalColorChange.GenerateElement("New Track Global Color Change", Guid.NewGuid(), new List<string>(), true, this, new FlexibleFloat(true), new FlexibleFloat(true), new FlexibleFloat(true), new FlexibleFloat(true)); }); //变量容器
|
||||||
|
|||||||
@@ -0,0 +1,284 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Dreamteck.Splines;
|
||||||
|
using Ichni.Editor;
|
||||||
|
using Ichni.RhythmGame.Beatmap;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Ichni.RhythmGame
|
||||||
|
{
|
||||||
|
public partial class ObjectTracker : GameElement
|
||||||
|
{
|
||||||
|
public Track track;
|
||||||
|
public ObjectController objectController;
|
||||||
|
public GameObject objectPrefab;
|
||||||
|
private List<string> themeBundleList;
|
||||||
|
private List<string> objectNameList;
|
||||||
|
public string themeBundleName;
|
||||||
|
public string objectName;
|
||||||
|
|
||||||
|
public float playTime;
|
||||||
|
public float stopTime;
|
||||||
|
|
||||||
|
public int spawnCount;
|
||||||
|
public Vector2 positionOffsetMin = Vector2.zero;
|
||||||
|
public Vector2 positionOffsetMax = Vector2.zero;
|
||||||
|
public string customPositionRuleName;
|
||||||
|
|
||||||
|
public bool applyRotationOffset = false;
|
||||||
|
public Vector3 rotationOffsetMin = Vector3.zero;
|
||||||
|
public Vector3 rotationOffsetMax = Vector3.zero;
|
||||||
|
public string customRotationRuleName;
|
||||||
|
|
||||||
|
public bool applyScaleOffset = false;
|
||||||
|
public Vector3 scaleOffsetMin = Vector3.one;
|
||||||
|
public Vector3 scaleOffsetMax = Vector3.one;
|
||||||
|
public string customScaleRuleName;
|
||||||
|
|
||||||
|
public static ObjectTracker GenerateElement(string elementName, Guid id, List<string> tags,
|
||||||
|
bool isFirstGenerated, Track track, string themeBundleName, string objectName, int spawnCount,
|
||||||
|
Vector2 positionOffsetMin, Vector2 positionOffsetMax, string customPositionRuleName,
|
||||||
|
bool applyRotationOffset, Vector3 rotationOffsetMin, Vector3 rotationOffsetMax, string customRotationRuleName,
|
||||||
|
bool applyScaleOffset, Vector3 scaleOffsetMin, Vector3 scaleOffsetMax, string customScaleRuleName)
|
||||||
|
{
|
||||||
|
ObjectTracker objectTracker = Instantiate(EditorManager.instance.basePrefabs.objectTracker, track.transform).GetComponent<ObjectTracker>();
|
||||||
|
objectTracker.objectPrefab = ThemeBundleManager.instance.GetObject<GameObject>(themeBundleName, objectName);
|
||||||
|
|
||||||
|
objectTracker.objectController.objects = new[] { objectTracker.objectPrefab };
|
||||||
|
objectTracker.Initialize(elementName, id, tags, isFirstGenerated, track);
|
||||||
|
objectTracker.track = track;
|
||||||
|
objectTracker.objectController.spline = track.trackPathSubmodule.path;
|
||||||
|
objectTracker.themeBundleList = ThemeBundleManager.instance.loadedThemeBundleList.ConvertAll(x => x.themeBundleName);
|
||||||
|
objectTracker.objectNameList = new List<string>();
|
||||||
|
objectTracker.themeBundleName = themeBundleName;
|
||||||
|
objectTracker.objectName = objectName;
|
||||||
|
objectTracker.SetSpawnSettings(spawnCount,
|
||||||
|
positionOffsetMin, positionOffsetMax, customPositionRuleName,
|
||||||
|
applyRotationOffset, rotationOffsetMin, rotationOffsetMax, customRotationRuleName,
|
||||||
|
applyScaleOffset, scaleOffsetMin, scaleOffsetMax, customScaleRuleName);
|
||||||
|
return objectTracker;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
float songTime = EditorManager.instance.songInformation.songTime;
|
||||||
|
if (playTime > songTime || stopTime < songTime)
|
||||||
|
{
|
||||||
|
if (objectController.enabled)
|
||||||
|
{
|
||||||
|
objectController.enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!objectController.enabled)
|
||||||
|
{
|
||||||
|
objectController.enabled = true;
|
||||||
|
objectController.Spawn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetUpInspector()
|
||||||
|
{
|
||||||
|
base.SetUpInspector();
|
||||||
|
|
||||||
|
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||||
|
Inspector inspectorMain = EditorManager.instance.uiManager.inspector;
|
||||||
|
var container = inspector.GenerateContainer("Object Tracker");
|
||||||
|
var generate = container.GenerateSubcontainer(3);
|
||||||
|
var themeBundleDropdown =
|
||||||
|
inspector.GenerateDropdown(this, generate, "Theme Bundle", themeBundleList, nameof(themeBundleName))
|
||||||
|
.AddListenerFunction(() => inspectorMain.SetInspector(this));
|
||||||
|
if (themeBundleName != String.Empty && ThemeBundleManager.instance.TryGetThemeBundle(themeBundleName, out ThemeBundle themeBundle))
|
||||||
|
{
|
||||||
|
objectNameList = themeBundle.assetList_GameObject.ConvertAll(x => x.name);
|
||||||
|
var objectNameDropdown =
|
||||||
|
inspector.GenerateDropdown(this, generate, "Object Name", objectNameList, nameof(objectName))
|
||||||
|
.AddListenerFunction(() => inspectorMain.SetInspector(this));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var objectNameDropdown =
|
||||||
|
inspector.GenerateDropdown(this, generate, "Object Name", new List<string>(), nameof(objectName));
|
||||||
|
objectNameDropdown.dropdown.interactable = false;
|
||||||
|
} // 如果没有选择主题包,则物体名称下拉框不可用
|
||||||
|
|
||||||
|
var setButton = inspector.GenerateButton(this, generate, "Generate", () =>
|
||||||
|
{
|
||||||
|
this.objectPrefab = ThemeBundleManager.instance.GetObject<GameObject>(themeBundleName, objectName);
|
||||||
|
this.objectController.objects = new[] { this.objectPrefab };
|
||||||
|
this.objectController.Spawn();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (themeBundleName == String.Empty || objectName == String.Empty)
|
||||||
|
{
|
||||||
|
setButton.button.interactable = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var spawnSettings = container.GenerateSubcontainer(3);
|
||||||
|
inspector.GenerateInputField(this, spawnSettings, "Spawn Count", nameof(spawnCount))
|
||||||
|
.AddListenerFunction(()=> objectController.spawnCount = spawnCount);
|
||||||
|
inspector.GenerateInputField(this, spawnSettings, "Play Time", nameof(playTime));
|
||||||
|
inspector.GenerateInputField(this, spawnSettings, "Stop Time", nameof(stopTime));
|
||||||
|
var posSettings = container.GenerateSubcontainer(1);
|
||||||
|
inspector.GenerateVector2InputField(this, posSettings, "Position Offset Min", nameof(positionOffsetMin))
|
||||||
|
.AddListenerFunction(()=> objectController.minOffset = positionOffsetMin);
|
||||||
|
inspector.GenerateVector2InputField(this, posSettings, "Position Offset Max", nameof(positionOffsetMax))
|
||||||
|
.AddListenerFunction(()=> objectController.maxOffset = positionOffsetMax);
|
||||||
|
//inspector.GenerateInputField(this, posSettings, "Custom Position Rule Name", nameof(customPositionRuleName));
|
||||||
|
var rotSettings = container.GenerateSubcontainer(1);
|
||||||
|
inspector.GenerateToggle(this, rotSettings, "Apply Rotation Offset", nameof(applyRotationOffset))
|
||||||
|
.AddListenerFunction(()=> objectController.applyRotation = applyRotationOffset);
|
||||||
|
inspector.GenerateVector3InputField(this, rotSettings, "Rotation Offset Min", nameof(rotationOffsetMin))
|
||||||
|
.AddListenerFunction(()=> objectController.minRotation = rotationOffsetMin);
|
||||||
|
inspector.GenerateVector3InputField(this, rotSettings, "Rotation Offset Max", nameof(rotationOffsetMax))
|
||||||
|
.AddListenerFunction(()=> objectController.maxRotation = rotationOffsetMax);
|
||||||
|
//inspector.GenerateInputField(this, rotSettings, "Custom Rotation Rule Name", nameof(customRotationRuleName));
|
||||||
|
var scaleSettings = container.GenerateSubcontainer(1);
|
||||||
|
inspector.GenerateToggle(this, scaleSettings, "Apply Scale Offset", nameof(applyScaleOffset))
|
||||||
|
.AddListenerFunction(()=> objectController.applyScale = applyScaleOffset);
|
||||||
|
inspector.GenerateVector3InputField(this, scaleSettings, "Scale Offset Min", nameof(scaleOffsetMin))
|
||||||
|
.AddListenerFunction(()=> objectController.minScaleMultiplier = scaleOffsetMin);
|
||||||
|
inspector.GenerateVector3InputField(this, scaleSettings, "Scale Offset Max", nameof(scaleOffsetMax))
|
||||||
|
.AddListenerFunction(()=> objectController.maxScaleMultiplier = scaleOffsetMax);
|
||||||
|
//inspector.GenerateInputField(this, scaleSettings, "Custom Scale Rule Name", nameof(customScaleRuleName));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SaveBM()
|
||||||
|
{
|
||||||
|
matchedBM = new Beatmap.ObjectTracker_BM(elementName, elementGuid, tags,
|
||||||
|
parentElement.matchedBM as GameElement_BM,
|
||||||
|
themeBundleName, objectName,
|
||||||
|
playTime, stopTime,
|
||||||
|
spawnCount,
|
||||||
|
positionOffsetMin, positionOffsetMax, customPositionRuleName,
|
||||||
|
applyRotationOffset, rotationOffsetMin, rotationOffsetMax, customRotationRuleName,
|
||||||
|
applyScaleOffset, scaleOffsetMin, scaleOffsetMax, customScaleRuleName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class ObjectTracker
|
||||||
|
{
|
||||||
|
public void SetSpawnSettings(int spawnCount,
|
||||||
|
Vector2 positionOffsetMin, Vector2 positionOffsetMax, string customPositionRuleName,
|
||||||
|
bool applyRotationOffset, Vector3 rotationOffsetMin, Vector3 rotationOffsetMax, string customRotationRuleName,
|
||||||
|
bool applyScaleOffset, Vector3 scaleOffsetMin, Vector3 scaleOffsetMax, string customScaleRuleName)
|
||||||
|
{
|
||||||
|
this.spawnCount = spawnCount;
|
||||||
|
this.positionOffsetMin = positionOffsetMin;
|
||||||
|
this.positionOffsetMax = positionOffsetMax;
|
||||||
|
this.customPositionRuleName = customPositionRuleName;
|
||||||
|
this.applyRotationOffset = applyRotationOffset;
|
||||||
|
this.rotationOffsetMin = rotationOffsetMin;
|
||||||
|
this.rotationOffsetMax = rotationOffsetMax;
|
||||||
|
this.customRotationRuleName = customRotationRuleName;
|
||||||
|
this.applyScaleOffset = applyScaleOffset;
|
||||||
|
this.scaleOffsetMin = scaleOffsetMin;
|
||||||
|
this.scaleOffsetMax = scaleOffsetMax;
|
||||||
|
this.customScaleRuleName = customScaleRuleName;
|
||||||
|
|
||||||
|
objectController.spawnCount = spawnCount;
|
||||||
|
objectController.minOffset = positionOffsetMin;
|
||||||
|
objectController.maxOffset = positionOffsetMax;
|
||||||
|
|
||||||
|
objectController.applyRotation = applyRotationOffset;
|
||||||
|
objectController.minRotation = rotationOffsetMin;
|
||||||
|
objectController.maxRotation = rotationOffsetMax;
|
||||||
|
|
||||||
|
objectController.applyScale = applyScaleOffset;
|
||||||
|
objectController.minScaleMultiplier = scaleOffsetMin;
|
||||||
|
objectController.maxScaleMultiplier = scaleOffsetMax;
|
||||||
|
|
||||||
|
objectController.Spawn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace Beatmap
|
||||||
|
{
|
||||||
|
public class ObjectTracker_BM : GameElement_BM
|
||||||
|
{
|
||||||
|
public string themeBundleName;
|
||||||
|
public string objectName;
|
||||||
|
|
||||||
|
public float playTime;
|
||||||
|
public float stopTime;
|
||||||
|
|
||||||
|
public int spawnCount;
|
||||||
|
public Vector2 positionOffsetMin;
|
||||||
|
public Vector2 positionOffsetMax;
|
||||||
|
public string customPositionRuleName;
|
||||||
|
|
||||||
|
public bool applyRotationOffset;
|
||||||
|
public Vector3 rotationOffsetMin;
|
||||||
|
public Vector3 rotationOffsetMax;
|
||||||
|
public string customRotationRuleName;
|
||||||
|
|
||||||
|
public bool applyScaleOffset;
|
||||||
|
public Vector3 scaleOffsetMin;
|
||||||
|
public Vector3 scaleOffsetMax;
|
||||||
|
public string customScaleRuleName;
|
||||||
|
|
||||||
|
public ObjectTracker_BM()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObjectTracker_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement,
|
||||||
|
string themeBundleName, string objectName,
|
||||||
|
float playTime, float stopTime,
|
||||||
|
int spawnCount,
|
||||||
|
Vector2 positionOffsetMin, Vector2 positionOffsetMax, string customPositionRuleName,
|
||||||
|
bool applyRotationOffset, Vector3 rotationOffsetMin, Vector3 rotationOffsetMax, string customRotationRuleName,
|
||||||
|
bool applyScaleOffset, Vector3 scaleOffsetMin, Vector3 scaleOffsetMax, string customScaleRuleName)
|
||||||
|
: base(elementName, elementGuid, tags, attachedElement)
|
||||||
|
{
|
||||||
|
this.themeBundleName = themeBundleName;
|
||||||
|
this.objectName = objectName;
|
||||||
|
|
||||||
|
this.playTime = playTime;
|
||||||
|
this.stopTime = stopTime;
|
||||||
|
|
||||||
|
this.spawnCount = spawnCount;
|
||||||
|
this.positionOffsetMin = positionOffsetMin;
|
||||||
|
this.positionOffsetMax = positionOffsetMax;
|
||||||
|
this.customPositionRuleName = customPositionRuleName;
|
||||||
|
|
||||||
|
this.applyRotationOffset = applyRotationOffset;
|
||||||
|
this.rotationOffsetMin = rotationOffsetMin;
|
||||||
|
this.rotationOffsetMax = rotationOffsetMax;
|
||||||
|
this.customRotationRuleName = customRotationRuleName;
|
||||||
|
|
||||||
|
this.applyScaleOffset = applyScaleOffset;
|
||||||
|
this.scaleOffsetMin = scaleOffsetMin;
|
||||||
|
this.scaleOffsetMax = scaleOffsetMax;
|
||||||
|
this.customScaleRuleName = customScaleRuleName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ExecuteBM()
|
||||||
|
{
|
||||||
|
matchedElement = ObjectTracker.GenerateElement(
|
||||||
|
elementName, elementGuid, tags, false,
|
||||||
|
GetElement(attachedElementGuid) as Track,
|
||||||
|
themeBundleName, objectName,
|
||||||
|
spawnCount,
|
||||||
|
positionOffsetMin, positionOffsetMax, customPositionRuleName,
|
||||||
|
applyRotationOffset, rotationOffsetMin, rotationOffsetMax, customRotationRuleName,
|
||||||
|
applyScaleOffset, scaleOffsetMin, scaleOffsetMax, customScaleRuleName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override GameElement DuplicateBM(GameElement attached)
|
||||||
|
{
|
||||||
|
return ObjectTracker.GenerateElement(
|
||||||
|
elementName, Guid.NewGuid(), new List<string>(tags), false,
|
||||||
|
attached as Track,
|
||||||
|
themeBundleName, objectName,
|
||||||
|
spawnCount,
|
||||||
|
positionOffsetMin, positionOffsetMax, customPositionRuleName,
|
||||||
|
applyRotationOffset, rotationOffsetMin, rotationOffsetMax, customRotationRuleName,
|
||||||
|
applyScaleOffset, scaleOffsetMin, scaleOffsetMax, customScaleRuleName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8dd005989b661ca4484a9998fa134782
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -20,6 +20,7 @@ namespace Ichni.RhythmGame
|
|||||||
public GameObject pathNode;
|
public GameObject pathNode;
|
||||||
public Material defaultTrackMaterial;
|
public Material defaultTrackMaterial;
|
||||||
public GameObject particleTracker;
|
public GameObject particleTracker;
|
||||||
|
public GameObject objectTracker;
|
||||||
public GameObject sampler;
|
public GameObject sampler;
|
||||||
|
|
||||||
[Title("Trail相关")] public GameObject trail;
|
[Title("Trail相关")] public GameObject trail;
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"trackPercent" : {
|
"trackPercent" : {
|
||||||
"value" : 0,
|
"value" : 0.077866666,
|
||||||
"currentAnimationIndex" : 0,
|
"currentAnimationIndex" : 0,
|
||||||
"animations" : [
|
"animations" : [
|
||||||
{
|
{
|
||||||
@@ -61198,6 +61198,72 @@
|
|||||||
"attachedElementGuid" : {
|
"attachedElementGuid" : {
|
||||||
"value" : "edeb96f4-7a07-451b-b26e-5a1c8419ad00"
|
"value" : "edeb96f4-7a07-451b-b26e-5a1c8419ad00"
|
||||||
}
|
}
|
||||||
|
},{
|
||||||
|
"__type" : "Ichni.RhythmGame.Beatmap.ObjectTracker_BM,Assembly-CSharp",
|
||||||
|
"themeBundleName" : "departure_to_multiverse",
|
||||||
|
"objectName" : "Constellation",
|
||||||
|
"playTime" : 0,
|
||||||
|
"stopTime" : 5,
|
||||||
|
"spawnCount" : 10,
|
||||||
|
"positionOffsetMin" : {
|
||||||
|
"x" : -10,
|
||||||
|
"y" : 0
|
||||||
|
},
|
||||||
|
"positionOffsetMax" : {
|
||||||
|
"x" : 10,
|
||||||
|
"y" : 10
|
||||||
|
},
|
||||||
|
"customPositionRuleName" : "",
|
||||||
|
"applyRotationOffset" : false,
|
||||||
|
"rotationOffsetMin" : {
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 0,
|
||||||
|
"z" : 0
|
||||||
|
},
|
||||||
|
"rotationOffsetMax" : {
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 0,
|
||||||
|
"z" : 0
|
||||||
|
},
|
||||||
|
"customRotationRuleName" : "",
|
||||||
|
"applyScaleOffset" : false,
|
||||||
|
"scaleOffsetMin" : {
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 0,
|
||||||
|
"z" : 0
|
||||||
|
},
|
||||||
|
"scaleOffsetMax" : {
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 0,
|
||||||
|
"z" : 0
|
||||||
|
},
|
||||||
|
"customScaleRuleName" : "",
|
||||||
|
"elementName" : "New Object Tracker",
|
||||||
|
"tags" : [
|
||||||
|
|
||||||
|
],
|
||||||
|
"elementGuid" : {
|
||||||
|
"value" : "7c65495d-73a6-4e7f-9b26-16d4a9225cc1"
|
||||||
|
},
|
||||||
|
"attachedElementGuid" : {
|
||||||
|
"value" : "86e95b79-c349-4861-b526-d8ec31cbb04f"
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
"__type" : "Ichni.RhythmGame.Beatmap.BackgroundSetter_BM,Assembly-CSharp",
|
||||||
|
"useSkybox" : true,
|
||||||
|
"skyboxThemeBundleName" : "departure_to_multiverse",
|
||||||
|
"skyboxMaterialName" : "DTM_Skybox_StarryIndigo",
|
||||||
|
"backgroundSpriteName" : "Background",
|
||||||
|
"elementName" : "Background Setter",
|
||||||
|
"tags" : [
|
||||||
|
|
||||||
|
],
|
||||||
|
"elementGuid" : {
|
||||||
|
"value" : "9f8b13f6-309b-4b2c-8c77-cb327a021632"
|
||||||
|
},
|
||||||
|
"attachedElementGuid" : {
|
||||||
|
"value" : "00000000-0000-0000-0000-000000000000"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"attachedElementGuid" : {
|
"attachedElementGuid" : {
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ guid: 92e2ddcb3cdd78544bef993272068d31
|
|||||||
PrefabImporter:
|
PrefabImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName: departure_to_multiverse
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|||||||
Reference in New Issue
Block a user