基础内容-6
技术性调整; Note效果;
This commit is contained in:
@@ -20,6 +20,9 @@ namespace Ichni.RhythmGame
|
||||
//标识 GUID
|
||||
public Guid elementGuid;
|
||||
|
||||
//标签
|
||||
public List<string> tags;
|
||||
|
||||
//存档
|
||||
//public BaseElement_BM matchedBM;
|
||||
|
||||
@@ -38,13 +41,14 @@ namespace Ichni.RhythmGame
|
||||
/// 首次初始化
|
||||
/// </summary>
|
||||
/// <param name="name">物体名</param>
|
||||
public virtual void NewInitialize(string name)
|
||||
public virtual void Initialize(string name)
|
||||
{
|
||||
this.elementName = name;
|
||||
this.elementGuid = Guid.NewGuid();
|
||||
EditorManager.instance.elementList.Add(this);
|
||||
//GameManager.beatMapContainer.beatMapElementList.Add(this);
|
||||
//serialNumber = totalSerialNumber++;
|
||||
SetTransformObserver();
|
||||
//SetTransformObserver();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -63,6 +67,14 @@ namespace Ichni.RhythmGame
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当物体被删除时执行的方法
|
||||
/// </summary>
|
||||
public virtual void OnDelete()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置父物体
|
||||
/// </summary>
|
||||
@@ -76,6 +88,23 @@ namespace Ichni.RhythmGame
|
||||
transform.SetParent(parentElement.transform);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Delete()
|
||||
{
|
||||
if (this.childElementList != null)
|
||||
{
|
||||
for (int i = 0; i < childElementList.Count; i++)
|
||||
{
|
||||
childElementList[i].Delete(); //删除子GameElement、
|
||||
}
|
||||
}
|
||||
|
||||
OnDelete();
|
||||
|
||||
EditorManager.instance.elementList.Remove(this); //从保存列表中剔除
|
||||
this.parentElement.childElementList.Remove(this);
|
||||
Destroy(gameObject); //销毁
|
||||
}
|
||||
}
|
||||
|
||||
public abstract partial class BaseElement
|
||||
|
||||
Reference in New Issue
Block a user