看完了
顺手加了个element改名同步hierarchy 3D遮挡!!! 然后发现当track或者folder旋转时pathnode的法线(旋转)不会跟着 以上测试放在IceFlowerMaster项目中 还有 现在没中文字体
This commit is contained in:
@@ -56,7 +56,7 @@ namespace Ichni.Editor
|
||||
bool isActive = pointer.time >= leftSideSongTime && pointer.time <= rightSideSongTime;
|
||||
pointer.gameObject.SetActive(isActive);
|
||||
});
|
||||
moveTabPoint.localPosition = new Vector3(timePointerArea.localPosition.x + OnePointer.transform.localPosition.x - timePointerInterval, -45f, 0);
|
||||
if (OnePointer != null) moveTabPoint.localPosition = new Vector3(timePointerArea.localPosition.x + OnePointer.transform.localPosition.x - timePointerInterval, -45f, 0);
|
||||
|
||||
foreach (var i in moveTabPoint.transform.GetComponentsInChildren<SubTab>())
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Ichni.Editor
|
||||
public string backgroundSpriteName;
|
||||
public Sprite backgroundSprite;
|
||||
|
||||
public static BackgroundSetter GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
public static BackgroundSetter GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, GameElement parentElement, bool useSkybox, string skyboxThemeBundleName,
|
||||
string skyboxMaterialName, string backgroundSpriteName)
|
||||
{
|
||||
@@ -29,16 +29,16 @@ namespace Ichni.Editor
|
||||
backgroundSetter.backgroundSpriteName = backgroundSpriteName;
|
||||
return backgroundSetter;
|
||||
}
|
||||
|
||||
|
||||
public void SetSkybox(string themeBundleName, string materialName)
|
||||
{
|
||||
skyboxThemeBundleName = themeBundleName;
|
||||
skyboxMaterialName = materialName;
|
||||
skyboxMaterial = ThemeBundleManager.instance.GetObject<Material>(themeBundleName, materialName);
|
||||
if(skyboxMaterial == null) skyboxMaterial = EditorManager.instance.basePrefabs.defaultSkyboxMaterial;
|
||||
if (skyboxMaterial == null) skyboxMaterial = EditorManager.instance.basePrefabs.defaultSkyboxMaterial;
|
||||
EditorManager.instance.backgroundController.SetSkybox(skyboxMaterial);
|
||||
}
|
||||
|
||||
|
||||
public void SetBackgroundSprite(string backgroundSpriteName)
|
||||
{
|
||||
string path = EditorManager.instance.projectInformation.projectPath + "/Sprites/" + backgroundSpriteName + ".png";
|
||||
@@ -48,7 +48,7 @@ namespace Ichni.Editor
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
@@ -60,22 +60,23 @@ namespace Ichni.Editor
|
||||
var skyboxMaterialNameField = inspector.GenerateInputField(this, container, "Skybox Material", nameof(skyboxMaterialName));
|
||||
var backgroundSpriteField = inspector.GenerateInputField(this, container, "Background Sprite", nameof(backgroundSpriteName));
|
||||
var applyButton = inspector.GenerateButton(this, container, "Apply", Refresh);
|
||||
|
||||
|
||||
void SetFields(bool value)
|
||||
{
|
||||
skyboxThemeBundleField.inputField.interactable = value;
|
||||
skyboxMaterialNameField.inputField.interactable = value;
|
||||
backgroundSpriteField.inputField.interactable = !value;
|
||||
}
|
||||
|
||||
|
||||
SetFields(useSkybox);
|
||||
|
||||
|
||||
useSkyboxToggle.AddListenerFunction(value => EditorManager.instance.backgroundController.EnableBackground(!value));
|
||||
useSkyboxToggle.AddListenerFunction(SetFields);
|
||||
}
|
||||
|
||||
public override void Refresh()
|
||||
{
|
||||
|
||||
EditorManager.instance.backgroundController.EnableBackground(!useSkybox);
|
||||
if (useSkybox)
|
||||
{
|
||||
@@ -94,7 +95,7 @@ namespace Ichni.Editor
|
||||
{
|
||||
public BackgroundSetter_BM()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
//次级模块
|
||||
public List<SubmoduleBase> submoduleList = new List<SubmoduleBase>();
|
||||
|
||||
|
||||
//存档类
|
||||
public BaseElement_BM matchedBM { get; set; }
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Ichni.RhythmGame
|
||||
/// 首次初始化
|
||||
/// </summary>
|
||||
/// <param name="name">物体名</param>
|
||||
public virtual void Initialize(string name, Guid elementGuid, List<string> tags,
|
||||
public virtual void Initialize(string name, Guid elementGuid, List<string> tags,
|
||||
bool isFirstGenerated, GameElement parentElement)
|
||||
{
|
||||
this.elementName = name;
|
||||
@@ -65,7 +65,7 @@ namespace Ichni.RhythmGame
|
||||
/// </summary>
|
||||
protected virtual void SetDefaultSubmodules()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -73,7 +73,7 @@ namespace Ichni.RhythmGame
|
||||
/// </summary>
|
||||
public virtual void AfterInitialize()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -93,12 +93,12 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public abstract partial class GameElement //存档,删除,复制,粘贴
|
||||
{
|
||||
|
||||
|
||||
public virtual void Refresh()
|
||||
{
|
||||
|
||||
if (connectedTab != null) connectedTab.tabButtonText.text = this.elementName;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 用于生成存档
|
||||
/// </summary>
|
||||
@@ -106,16 +106,16 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 当物体被删除时执行的方法
|
||||
/// </summary>
|
||||
public virtual void OnDelete()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除物体,包括所有子物体
|
||||
/// </summary>
|
||||
@@ -130,11 +130,11 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
|
||||
OnDelete();
|
||||
|
||||
|
||||
//LogWindow.Log("Deleted element: " + elementName);
|
||||
|
||||
|
||||
EditorManager.instance.beatmapContainer.gameElementList.Remove(this); //从保存列表中剔除
|
||||
|
||||
|
||||
if (connectedTab != null)
|
||||
{
|
||||
Destroy(connectedTab.gameObject);
|
||||
@@ -176,27 +176,27 @@ namespace Ichni.RhythmGame
|
||||
GetAllChildrenRecursively(child, elements);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<GameElement> gameElements = new List<GameElement> { this };
|
||||
GetAllChildrenRecursively(this, gameElements);
|
||||
|
||||
if(!includeThis) gameElements.Remove(this);
|
||||
|
||||
if (!includeThis) gameElements.Remove(this);
|
||||
|
||||
return gameElements;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
[System.Serializable]
|
||||
public abstract class GameElement_BM : BaseElement_BM
|
||||
{
|
||||
[System.NonSerialized]
|
||||
[System.NonSerialized]
|
||||
public static Dictionary<Guid, GameElement_BM> identifier = new(); //存档类的标识符
|
||||
|
||||
[System.NonSerialized]
|
||||
|
||||
[System.NonSerialized]
|
||||
public GameElement matchedElement; //存档类对应的游戏物体
|
||||
|
||||
|
||||
public string elementName;
|
||||
public List<string> tags;
|
||||
public Guid elementGuid;
|
||||
@@ -223,17 +223,17 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
return element_BM;
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static GameElement GetElement(Guid id)
|
||||
{
|
||||
if(identifier.TryGetValue(id, out GameElement_BM element_BM))
|
||||
if (identifier.TryGetValue(id, out GameElement_BM element_BM))
|
||||
{
|
||||
return element_BM.matchedElement;
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,9 +20,10 @@ namespace Ichni.RhythmGame
|
||||
public TimeDurationSubmodule timeDurationSubmodule { get; set; }
|
||||
public ColorSubmodule colorSubmodule { get; set; }
|
||||
public bool haveEmission => false;
|
||||
|
||||
|
||||
[Title("Editor独有参数")]
|
||||
[SerializeField] [HideInPlayMode]
|
||||
[SerializeField]
|
||||
[HideInPlayMode]
|
||||
private GameObject pathNodeSphere;
|
||||
public bool isShowingSphere;
|
||||
|
||||
@@ -60,6 +61,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
Vector3 position = transformSubmodule.currentPosition;
|
||||
Vector3 normal = Quaternion.Euler(transformSubmodule.currentEulerAngles) * Vector3.up;
|
||||
float size = transformSubmodule.currentScale.x;
|
||||
@@ -80,7 +82,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
matchedBM = new Beatmap.PathNode_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM, isShowingSphere);
|
||||
}
|
||||
|
||||
|
||||
public void SetPathNodeSphere(bool isShowing)
|
||||
{
|
||||
isShowingSphere = isShowing;
|
||||
@@ -92,7 +94,7 @@ namespace Ichni.RhythmGame
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
|
||||
base.SetUpInspector();
|
||||
|
||||
|
||||
var container = inspector.GenerateContainer("Path Node");
|
||||
var indexText = inspector.GenerateHintText(this, container, "Index: " + index);
|
||||
var isShowingSphereToggle = inspector.GenerateToggle(this, container, "Is Showing Sphere", nameof(isShowingSphere));
|
||||
@@ -110,7 +112,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
}
|
||||
|
||||
public PathNode_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement,
|
||||
public PathNode_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement,
|
||||
bool isShowingSphere)
|
||||
: base(elementName, elementGuid, tags, attachedElement)
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Ichni.RhythmGame
|
||||
trackTimeSubmodule = null;
|
||||
trackRendererSubmodule = null;
|
||||
}
|
||||
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (timeDurationSubmodule.CheckTimeInDuration(EditorManager.instance.songInformation.songTime))
|
||||
@@ -51,13 +51,14 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
trackPathSubmodule.ClosePath();
|
||||
}
|
||||
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
trackPathSubmodule?.Refresh();
|
||||
trackTimeSubmodule?.Refresh();
|
||||
trackRendererSubmodule?.Refresh();
|
||||
@@ -117,7 +118,7 @@ namespace Ichni.RhythmGame
|
||||
trackRendererSubmodule = new TrackRendererSubmodulePathGenerator(this, false, 0);
|
||||
inspectorMain.SetInspector(this);
|
||||
});
|
||||
|
||||
|
||||
var trackRendererSurfaceButton = inspector.GenerateButton(this, trackSubmodulesContainer, "Track Renderer Surface",
|
||||
() =>
|
||||
{
|
||||
@@ -126,53 +127,53 @@ namespace Ichni.RhythmGame
|
||||
});
|
||||
|
||||
var generateContainer = inspector.GenerateContainer("Generate Elements"); //物体生成
|
||||
|
||||
|
||||
var pathNodeButton = inspector.GenerateButton(this, generateContainer, "Path Node",
|
||||
() =>
|
||||
{
|
||||
PathNode.GenerateElement("New Path Node", Guid.NewGuid(), new List<string>(), true, this, true);
|
||||
}); //路径点
|
||||
|
||||
|
||||
var trackPercentPointButton = inspector.GenerateButton(this, generateContainer, "Track Percent Point",
|
||||
() =>
|
||||
{
|
||||
TrackPercentPoint.GenerateElement("New Track Percent Point", Guid.NewGuid(), new List<string>(),
|
||||
TrackPercentPoint.GenerateElement("New Track Percent Point", Guid.NewGuid(), new List<string>(),
|
||||
true, this, new FlexibleFloat());
|
||||
}); //百分比点
|
||||
|
||||
|
||||
var trackHeadPointButton = inspector.GenerateButton(this, generateContainer, "Track Head Point",
|
||||
() =>
|
||||
{
|
||||
TrackHeadPoint.GenerateElement("New Track Head Point", Guid.NewGuid(), new List<string>(),
|
||||
TrackHeadPoint.GenerateElement("New Track Head Point", Guid.NewGuid(), new List<string>(),
|
||||
true, this);
|
||||
}); //头部点(必须先有TrackTimeSubmoduleMovable)
|
||||
if (trackTimeSubmodule is not TrackTimeSubmoduleMovable) trackHeadPointButton.button.interactable = false;
|
||||
|
||||
|
||||
var tapButton = inspector.GenerateButton(this, generateContainer, "Tap",
|
||||
() =>
|
||||
{
|
||||
Tap.GenerateElement("New Tap", Guid.NewGuid(), new List<string>(), true, this, 0f);
|
||||
}); //Note Tap
|
||||
|
||||
|
||||
var stayButton = inspector.GenerateButton(this, generateContainer, "Stay",
|
||||
() =>
|
||||
{
|
||||
Stay.GenerateElement("New Stay", Guid.NewGuid(), new List<string>(), true, this, 0f);
|
||||
}); //Note Stay
|
||||
|
||||
|
||||
// var holdButton = inspector.GenerateButton(this, generateContainer, "Hold",
|
||||
// () =>
|
||||
// {
|
||||
// Hold.GenerateElement("New Hold", Guid.NewGuid(), new List<string>(), true, this, 0f);
|
||||
// }); //Note Hold
|
||||
|
||||
|
||||
var flickButton = inspector.GenerateButton(this, generateContainer, "Flick",
|
||||
() =>
|
||||
{
|
||||
Flick.GenerateElement("New Flick", Guid.NewGuid(), new List<string>(), true, this, 0f,
|
||||
new List<Vector2>());
|
||||
}); //Note Flick
|
||||
|
||||
|
||||
var displacementButton = inspector.GenerateButton(this, generateContainer, "Displacement",
|
||||
() =>
|
||||
{
|
||||
@@ -207,8 +208,8 @@ namespace Ichni.RhythmGame
|
||||
trackRendererAutoOrientButton.button.interactable = false;
|
||||
trackRendererPathGeneratorButton.button.interactable = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var toolsContainerTrack = inspector.GenerateContainer("Track Tools"); //轨道(整体)快捷工具
|
||||
var quickCopyButton = inspector.GenerateButton(this, toolsContainerTrack, "QuickCopy", () =>
|
||||
{
|
||||
@@ -229,7 +230,7 @@ namespace Ichni.RhythmGame
|
||||
QuickCopy(positionOffset, timeOffset, includeAnimation, iteration);
|
||||
});
|
||||
}); //快速复制
|
||||
|
||||
|
||||
var wholeTrackMoveButton = inspector.GenerateButton(this, toolsContainerTrack, "Whole Track Move", () =>
|
||||
{
|
||||
IHaveInspection wholeMoveWindow = inspectorMain.GenerateSecondaryWindow(this, elementName + "'s Whole Track Move");
|
||||
@@ -243,7 +244,7 @@ namespace Ichni.RhythmGame
|
||||
WholeTrackMove(positionOffset);
|
||||
});
|
||||
}); //整体移动
|
||||
|
||||
|
||||
var wholeTrackSwirlButton = inspector.GenerateButton(this, toolsContainerTrack, "Whole Track Swirl", () =>
|
||||
{
|
||||
IHaveInspection wholeSwirlWindow = inspectorMain.GenerateSecondaryWindow(this, elementName + "'s Whole Track Swirl");
|
||||
@@ -263,7 +264,7 @@ namespace Ichni.RhythmGame
|
||||
WholeTrackSwirl(angle, center, axisDirection);
|
||||
});
|
||||
}); //整体旋转
|
||||
|
||||
|
||||
// var wholeTrackFlipButton = inspector.GenerateButton(this, toolsContainerTrack, "Whole Track Flip", () =>
|
||||
// {
|
||||
// IHaveInspection wholeFlipWindow = inspectorMain.GenerateSecondaryWindow(this, elementName + "'s Whole Track Flip");
|
||||
@@ -281,20 +282,20 @@ namespace Ichni.RhythmGame
|
||||
// WholeTrackFlip(axisStart, axisEnd);
|
||||
// });
|
||||
// }); //整体翻转
|
||||
|
||||
|
||||
var toolsContainerPathNode = inspector.GenerateContainer("Path Node Tools"); //路径点快捷工具
|
||||
var setAllPathNodeSphereButton = inspector.GenerateButton(this, toolsContainerPathNode,
|
||||
var setAllPathNodeSphereButton = inspector.GenerateButton(this, toolsContainerPathNode,
|
||||
"Set All Path Node Sphere", () =>
|
||||
{
|
||||
bool firstPathNodeSphere = trackPathSubmodule.pathNodeList[0].isShowingSphere;
|
||||
SetAllPathNodeSphere(!firstPathNodeSphere);
|
||||
});
|
||||
|
||||
var setOnlyStartEndPathNodeSphereEnabledButton = inspector.GenerateButton(this, toolsContainerPathNode,
|
||||
|
||||
var setOnlyStartEndPathNodeSphereEnabledButton = inspector.GenerateButton(this, toolsContainerPathNode,
|
||||
"Only Start & End Path Node's sphere enabled", SetOnlyStartEndPathNodeSphereEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public partial class Track
|
||||
{
|
||||
public enum TrackSpaceType
|
||||
@@ -310,20 +311,20 @@ namespace Ichni.RhythmGame
|
||||
DistanceDistributed = 1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class Track_BM : GameElement_BM
|
||||
{
|
||||
public Track_BM()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public Track_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement)
|
||||
public Track_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement)
|
||||
: base(elementName, elementGuid, tags, attachedElement)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
|
||||
Reference in New Issue
Block a user