StartMenu!
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
@@ -11,15 +12,16 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public bool isStatic;
|
||||
|
||||
public static SubstantialObject GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, GameElement parentElement, string themeBundleName, string objectName, bool isStatic)
|
||||
public static EnvironmentObject GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, string themeBundleName, string objectName, GameElement parentElement, bool isStatic)
|
||||
{
|
||||
EnvironmentObject themeBundleObject =
|
||||
ThemeBundleManager.instance.GetObject<EnvironmentObject>(themeBundleName, objectName);
|
||||
EnvironmentObject environmentObject =
|
||||
Instantiate(themeBundleObject, parentElement.transform).GetComponent<EnvironmentObject>();
|
||||
environmentObject.Initialize(elementName, id, tags, isFirstGenerated, parentElement);
|
||||
EnvironmentObject environmentObject =
|
||||
SubstantialObject.GenerateElement(elementName, id, tags, isFirstGenerated, themeBundleName, objectName, parentElement)
|
||||
.GetComponent<EnvironmentObject>();
|
||||
|
||||
environmentObject.isStatic = isStatic;
|
||||
environmentObject.gameObject.isStatic = isStatic;
|
||||
|
||||
return environmentObject;
|
||||
}
|
||||
}
|
||||
@@ -31,6 +33,38 @@ namespace Ichni.RhythmGame
|
||||
matchedBM = new EnvironmentObject_BM(elementName, elementGuid, tags,
|
||||
parentElement.matchedBM as GameElement_BM, themeBundleName, objectName, isStatic);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
base.SetUpInspector();
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("Generate");
|
||||
var environmentObjectButton = inspector.GenerateButton(this, container, "Environment Object",
|
||||
() => TemporaryObject.GenerateElement("New Environment Object", Guid.NewGuid(), new List<string>(),
|
||||
true, this));
|
||||
var isStaticToggle = inspector.GenerateToggle(this, container, "Is Static", nameof(isStatic));
|
||||
isStaticToggle.AddListenerFunction(_ => gameObject.isStatic = isStatic);
|
||||
|
||||
var generateContainer = inspector.GenerateContainer("Generate");
|
||||
var generateDisplacementButton = inspector.GenerateButton(this, generateContainer, "Displacement",
|
||||
() => Displacement.GenerateElement("New Displacement", Guid.NewGuid(), new List<string>(), true,
|
||||
this, new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat()));
|
||||
var generateSwirlButton = inspector.GenerateButton(this, generateContainer, "Swirl",
|
||||
() => Swirl.GenerateElement("New Swirl", Guid.NewGuid(), new List<string>(), true,
|
||||
this, new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat()));
|
||||
var generateScaleButton = inspector.GenerateButton(this, generateContainer, "Scale",
|
||||
() => Scale.GenerateElement("New Scale", Guid.NewGuid(), new List<string>(), true,
|
||||
this, new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat()));
|
||||
var generateBaseColorChangeButton = inspector.GenerateButton(this, generateContainer, "Base Color Change",
|
||||
() => BaseColorChange.GenerateElement("New Base Color Change", Guid.NewGuid(), new List<string>(), true,
|
||||
this, new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat()));
|
||||
if (haveEmission)
|
||||
{
|
||||
var generateEmissionColorChangeButton = inspector.GenerateButton(this, generateContainer, "Emission Color Change",
|
||||
() => EmissionColorChange.GenerateElement("New Emission Color Change", Guid.NewGuid(), new List<string>(), true,
|
||||
this, new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
@@ -54,13 +88,13 @@ namespace Ichni.RhythmGame
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = EnvironmentObject.GenerateElement(elementName, elementGuid, tags, false,
|
||||
GetElement(attachedElementGuid), themeBundleName, objectName, isStatic);
|
||||
themeBundleName, objectName,GetElement(attachedElementGuid), isStatic);
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return EnvironmentObject.GenerateElement(elementName, Guid.NewGuid(), tags, false,
|
||||
parent, themeBundleName, objectName, isStatic);
|
||||
themeBundleName, objectName, parent, isStatic);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,16 +13,13 @@ namespace Ichni.RhythmGame
|
||||
public TransformSubmodule transformSubmodule { get; set; }
|
||||
public TimeDurationSubmodule timeDurationSubmodule { get; set; }
|
||||
public ColorSubmodule colorSubmodule { get; set; }
|
||||
public bool haveEmission { get; }
|
||||
public bool haveEmission => false;
|
||||
|
||||
public static SubstantialObject GenerateElement(string elementName, Guid id, List<string> tags, bool isFirstGenerated,
|
||||
string themeBundleName, string objectName, GameElement parentElement)
|
||||
{
|
||||
|
||||
|
||||
GameObject themeBundleObject = ThemeBundleManager.instance.GetObject<GameObject>(themeBundleName, objectName);
|
||||
|
||||
|
||||
SubstantialObject substantialObject = Instantiate(themeBundleObject, parentElement.transform).GetComponent<SubstantialObject>();
|
||||
substantialObject.Initialize(elementName, id, tags, isFirstGenerated, parentElement);
|
||||
substantialObject.themeBundleName = themeBundleName;
|
||||
|
||||
@@ -65,8 +65,8 @@ namespace Ichni.RhythmGame
|
||||
float size = transformSubmodule.currentScale.x;
|
||||
Color color = colorSubmodule.currentBaseColor;
|
||||
|
||||
transform.position = position;
|
||||
transform.rotation = Quaternion.LookRotation(normal);
|
||||
transform.localPosition = position;
|
||||
transform.localRotation = Quaternion.LookRotation(normal);
|
||||
transform.localScale = Vector3.one * size;
|
||||
|
||||
node = new SplinePoint(position, Vector3.up, normal, size, color);
|
||||
|
||||
@@ -50,6 +50,8 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
trackPathSubmodule.ClosePath();
|
||||
}
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -76,11 +76,18 @@ namespace Ichni.RhythmGame
|
||||
var container = inspector.GenerateContainer("Track Time Movable");
|
||||
var startTimeInputField =
|
||||
inspector.GenerateInputField(this, container, "Start Time", nameof(trackStartTime));
|
||||
startTimeInputField.AddListenerFunction(_ => RefreshChildren());
|
||||
|
||||
var endTimeInputField = inspector.GenerateInputField(this, container, "End Time", nameof(trackEndTime));
|
||||
endTimeInputField.AddListenerFunction(_ => RefreshChildren());
|
||||
|
||||
var visibleTimeInputField =
|
||||
inspector.GenerateInputField(this, container, "Visible Time Length", nameof(visibleTrackTimeLength));
|
||||
|
||||
var animationCurveDropdown = inspector.GenerateDropdown(this, container, "Animation Curve",
|
||||
typeof(AnimationCurveType), nameof(animationCurveType));
|
||||
animationCurveDropdown.AddListenerFunction(_ => RefreshChildren());
|
||||
|
||||
var deleteButton = inspector.GenerateButton(this, container, "Delete",
|
||||
() =>
|
||||
{
|
||||
@@ -90,6 +97,17 @@ namespace Ichni.RhythmGame
|
||||
track.Refresh();
|
||||
});
|
||||
}
|
||||
|
||||
private void RefreshChildren()
|
||||
{
|
||||
track.childElementList.ForEach(child =>
|
||||
{
|
||||
if (child is NoteBase note)
|
||||
{
|
||||
note.UpdateNoteInTrack();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
|
||||
Reference in New Issue
Block a user