@@ -26,7 +26,7 @@ namespace Ichni.Editor
|
||||
|
||||
InitializeWindow(titleText, ApplyParameters);
|
||||
|
||||
StartCoroutine(WindowAnim.ShowPanelOnScale(gameObject));
|
||||
|
||||
}
|
||||
|
||||
public void RemoveUnit(DynamicUICompositeUnit unit)
|
||||
|
||||
@@ -15,12 +15,12 @@ namespace Ichni.Editor
|
||||
|
||||
public void Initialize(GameElement gameElement, string titleText)
|
||||
{
|
||||
StartCoroutine(WindowAnim.ShowPanelOnScale(gameObject));
|
||||
|
||||
WindowRect = windowRect;
|
||||
Containers = new List<DynamicUIContainer>();
|
||||
MarkedSubcontainers = new Dictionary<string, DynamicUISubcontainer>();
|
||||
MarkedElements = new Dictionary<string, DynamicUIElement>();
|
||||
|
||||
|
||||
connectedGameElement = gameElement;
|
||||
InitializeWindow(titleText);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Ichni.Editor
|
||||
Instantiate(EditorManager.instance.basePrefabs.generalSecondaryWindow,
|
||||
EditorManager.instance.uiManager.mainPage.mainCanvas.GetComponent<RectTransform>()).GetComponent<GeneralSecondaryWindow>();
|
||||
|
||||
escapeConfirmWindow.Initialize("Confirm Escape");
|
||||
escapeConfirmWindow.Initialize("Confirm Escape (without saving)");
|
||||
|
||||
var container = escapeConfirmWindow.GenerateContainer();
|
||||
var clipSettings = container.GenerateSubcontainer(3);
|
||||
@@ -113,6 +113,7 @@ namespace Ichni.Editor
|
||||
var applyClipButton = saveClipWindow.GenerateButton(clipSettings, "Apply", () =>
|
||||
{
|
||||
EditorManager.instance.projectManager.beatmapClipManager.SaveClip(clipNameInputField.GetValue<string>());
|
||||
clipManagementWindow.closeButton.onClick.Invoke();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -146,6 +147,7 @@ namespace Ichni.Editor
|
||||
var applyClipButton = loadClipWindow.GenerateButton(clipSettings, "Apply", () =>
|
||||
{
|
||||
EditorManager.instance.projectManager.beatmapClipManager.LoadClip(clipNameInputField.GetValue<string>());
|
||||
clipManagementWindow.closeButton.onClick.Invoke();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace Ichni.Editor
|
||||
onQuit?.Invoke();
|
||||
Destroy(gameObject);
|
||||
});
|
||||
StartCoroutine(WindowAnim.ShowPanelOnScale(gameObject));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public string themeBundleName;
|
||||
public string materialName;
|
||||
|
||||
|
||||
public bool prewarm;
|
||||
public float playTime;
|
||||
public float stopTime;
|
||||
@@ -28,14 +28,14 @@ namespace Ichni.RhythmGame
|
||||
public bool is3D;
|
||||
public float width;
|
||||
public Vector3 extendDirection;
|
||||
|
||||
|
||||
public float density;
|
||||
public float lifeTime;
|
||||
|
||||
|
||||
public bool isAutoOrient;
|
||||
public Vector3 particleRotation;
|
||||
|
||||
|
||||
|
||||
|
||||
public static ParticleTracker GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, Track track, string themeBundleName, string materialName,
|
||||
bool prewarm, float playTime, float stopTime,
|
||||
@@ -69,10 +69,10 @@ namespace Ichni.RhythmGame
|
||||
Renderer particleRenderer = particle.GetComponent<Renderer>();
|
||||
particleRenderer.material = Instantiate(material);
|
||||
particleRenderer.InitializeShader();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void SetParticleSettings(bool prewarm,
|
||||
public void SetParticleSettings(bool prewarm,
|
||||
bool is3D, float width, Vector3 extendDirection,
|
||||
float density, float lifeTime,
|
||||
bool isAutoOrient, Vector3 particleRotation)
|
||||
@@ -102,14 +102,25 @@ namespace Ichni.RhythmGame
|
||||
float songTime = EditorManager.instance.songInformation.songTime;
|
||||
if (playTime > songTime || stopTime < songTime)
|
||||
{
|
||||
particle.Stop();
|
||||
if (particle.isPlaying || particle.isPaused)
|
||||
{
|
||||
particle.Stop();
|
||||
|
||||
particle.Clear();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!particle.isPlaying)
|
||||
if (!EditorManager.instance.musicPlayer.isPlaying)
|
||||
{
|
||||
particle.Pause();
|
||||
}
|
||||
else if (!particle.isPlaying)
|
||||
{
|
||||
particle.Play();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,43 +128,43 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
matchedBM = new ParticleTracker_BM(elementName, elementGuid, tags,
|
||||
parentElement.matchedBM as GameElement_BM,
|
||||
prewarm, playTime, stopTime, is3D, width, extendDirection, density, lifeTime, isAutoOrient, particleRotation,
|
||||
prewarm, playTime, stopTime, is3D, width, extendDirection, density, lifeTime, isAutoOrient, particleRotation,
|
||||
themeBundleName, materialName);
|
||||
}
|
||||
|
||||
|
||||
private List<string> themeBundleList;
|
||||
private List<string> materialNameList;
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
base.SetUpInspector();
|
||||
|
||||
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
Inspector inspectorMain = EditorManager.instance.uiManager.inspector;
|
||||
Inspector inspectorMain = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("Particle Tracker");
|
||||
|
||||
DynamicUISubcontainer particleSettings0 = container.GenerateSubcontainer(3);
|
||||
inspector.GenerateToggle(this, particleSettings0, "Prewarm", nameof(prewarm)).AddListenerFunction(SetPrewarm);
|
||||
inspector.GenerateInputField(this, particleSettings0, "Play Time", nameof(playTime));
|
||||
inspector.GenerateInputField(this, particleSettings0, "Stop Time", nameof(stopTime));
|
||||
|
||||
|
||||
DynamicUISubcontainer particleSettings1_0 = container.GenerateSubcontainer(3);
|
||||
inspector.GenerateToggle(this, particleSettings1_0, "Is 3D", nameof(is3D)).AddListenerFunction(SetShape);
|
||||
inspector.GenerateInputField(this, particleSettings1_0, "Width", nameof(width)).AddListenerFunction(SetShape);
|
||||
DynamicUISubcontainer particleSettings1_1 = container.GenerateSubcontainer(1);
|
||||
inspector.GenerateVector3InputField(this, particleSettings1_1, "Extend Direction", nameof(extendDirection)).AddListenerFunction(SetShape);
|
||||
|
||||
|
||||
DynamicUISubcontainer particleSettings2 = container.GenerateSubcontainer(3);
|
||||
inspector.GenerateInputField(this, particleSettings2, "Density", nameof(density)).AddListenerFunction(SetDensity);
|
||||
inspector.GenerateInputField(this, particleSettings2, "Life Time", nameof(lifeTime)).AddListenerFunction(SetLifeTime);
|
||||
|
||||
|
||||
DynamicUISubcontainer particleSettings3_0 = container.GenerateSubcontainer(3);
|
||||
inspector.GenerateToggle(this, particleSettings3_0, "Is Auto Orient", nameof(isAutoOrient)).AddListenerFunction(SetAlignment);
|
||||
DynamicUISubcontainer particleSettings3_1 = container.GenerateSubcontainer(1);
|
||||
inspector.GenerateVector3InputField(this, particleSettings3_1, "Particle Rotation", nameof(particleRotation)).AddListenerFunction(SetParticleRotation);
|
||||
|
||||
DynamicUISubcontainer materialSettings = container.GenerateSubcontainer(3);
|
||||
var themeBundleDropdown =
|
||||
var themeBundleDropdown =
|
||||
inspector.GenerateDropdown(this, materialSettings, "Theme Bundle", themeBundleList, nameof(themeBundleName))
|
||||
.AddListenerFunction(() => inspectorMain.SetInspector(this));
|
||||
if (themeBundleName != String.Empty && ThemeBundleManager.instance.TryGetThemeBundle(themeBundleName, out ThemeBundle themeBundle))
|
||||
@@ -165,14 +176,14 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
else
|
||||
{
|
||||
var objectNameDropdown =
|
||||
var objectNameDropdown =
|
||||
inspector.GenerateDropdown(this, materialSettings, "Material Name", new List<string>(), nameof(materialName));
|
||||
objectNameDropdown.dropdown.interactable = false;
|
||||
} // 如果没有选择主题包,则材质名称下拉框不可用
|
||||
|
||||
|
||||
var setMaterialButton = inspector.GenerateButton(this, materialSettings, "Set Material", () =>
|
||||
{
|
||||
SetParticleMaterial(themeBundleName, materialName);
|
||||
SetParticleMaterial(themeBundleName, materialName);
|
||||
});
|
||||
|
||||
if (themeBundleName == String.Empty || materialName == String.Empty)
|
||||
@@ -197,19 +208,19 @@ namespace Ichni.RhythmGame
|
||||
var emission = particle.emission;
|
||||
emission.rateOverTime = density;
|
||||
}
|
||||
|
||||
|
||||
private void SetLifeTime()
|
||||
{
|
||||
var mainModule = particle.main;
|
||||
mainModule.startLifetime = lifeTime;
|
||||
}
|
||||
|
||||
|
||||
private void SetPrewarm()
|
||||
{
|
||||
var mainModule = particle.main;
|
||||
mainModule.prewarm = prewarm;
|
||||
}
|
||||
|
||||
|
||||
private void SetAlignment()
|
||||
{
|
||||
ParticleSystemRenderer particleSystemRenderer = particle.GetComponent<ParticleSystemRenderer>();
|
||||
@@ -226,7 +237,7 @@ namespace Ichni.RhythmGame
|
||||
SetParticleRotation();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void SetParticleRotation()
|
||||
{
|
||||
var mainModule = particle.main;
|
||||
@@ -251,7 +262,7 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class ParticleTracker_BM : GameElement_BM
|
||||
@@ -269,7 +280,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public bool isAutoOrient = true;
|
||||
public Vector3 particleRotation = Vector3.zero;
|
||||
|
||||
|
||||
public string materialThemeBundleName = string.Empty;
|
||||
public string materialName = string.Empty;
|
||||
|
||||
@@ -279,7 +290,7 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
|
||||
public ParticleTracker_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement,
|
||||
bool prewarm, float playTime, float stopTime,
|
||||
bool prewarm, float playTime, float stopTime,
|
||||
bool is3D, float width, Vector3 extendDirection,
|
||||
float density, float lifeTime,
|
||||
bool isAutoOrient, Vector3 particleRotation,
|
||||
@@ -295,7 +306,7 @@ namespace Ichni.RhythmGame
|
||||
this.lifeTime = lifeTime;
|
||||
this.isAutoOrient = isAutoOrient;
|
||||
this.particleRotation = particleRotation;
|
||||
|
||||
|
||||
this.materialThemeBundleName = materialThemeBundleName;
|
||||
this.materialName = materialName;
|
||||
}
|
||||
@@ -311,7 +322,7 @@ namespace Ichni.RhythmGame
|
||||
public override GameElement DuplicateBM(GameElement attached)
|
||||
{
|
||||
return ParticleTracker.GenerateElement(
|
||||
elementName, Guid.NewGuid(), tags, false,
|
||||
elementName, Guid.NewGuid(), tags, false,
|
||||
attached as Track, materialThemeBundleName, materialName,
|
||||
prewarm, playTime, stopTime, is3D, width, extendDirection, density, lifeTime, isAutoOrient, particleRotation);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public partial class GraphicalFlexibleFloatWindow : MovableWindow
|
||||
|
||||
|
||||
closeButton.onClick.AddListener(Quit);
|
||||
StartCoroutine(WindowAnim.ShowPanelOnScale(gameObject));
|
||||
|
||||
for (int i = 0; i <= FlexibleFloats.Length - 1; i++)
|
||||
{
|
||||
ClipBoard.Add(Subtitles[i], new List<AnimatedFloat>());
|
||||
|
||||
@@ -169,5 +169,50 @@ namespace Ichni
|
||||
cameraManager.SetUpInspector();
|
||||
gridController.SetUpInspector();
|
||||
}
|
||||
|
||||
|
||||
private bool isQuit = false;
|
||||
[Obsolete]
|
||||
public void OnApplicationQuit()
|
||||
{
|
||||
if (isQuit) return;
|
||||
|
||||
Application.CancelQuit();//退出拦截
|
||||
GeneralSecondaryWindow QuitWindow =
|
||||
Instantiate(EditorManager.instance.basePrefabs.generalSecondaryWindow,
|
||||
EditorManager.instance.uiManager.mainPage.mainCanvas.GetComponent<RectTransform>()).GetComponent<GeneralSecondaryWindow>();
|
||||
|
||||
QuitWindow.Initialize("Do You Want To Save?", () =>
|
||||
{
|
||||
Destroy(QuitWindow.gameObject);
|
||||
});
|
||||
|
||||
|
||||
var container = QuitWindow.GenerateContainer("Save confirm");
|
||||
var beatmapToolsSettings = container.GenerateSubcontainer(3);
|
||||
var yesButton = QuitWindow.GenerateButton(beatmapToolsSettings, "Yes", () =>
|
||||
{
|
||||
isQuit = true;
|
||||
EditorManager.instance.projectManager.saveManager.Save();
|
||||
Application.Quit();
|
||||
|
||||
});
|
||||
var noButton = QuitWindow.GenerateButton(beatmapToolsSettings, "No", () =>
|
||||
{
|
||||
isQuit = true;
|
||||
Application.Quit();
|
||||
});
|
||||
|
||||
// if (isQuit)
|
||||
// {
|
||||
// Application.CancelQuit();//退出拦截
|
||||
// MessageCtrl.Instance.OpenConfirmView("关闭界面将终止,确认关闭?", "", () =>
|
||||
// {
|
||||
// isQuit = false;
|
||||
// Application.Quit();
|
||||
// });
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user