效果模块,以及代码位置整理
This commit is contained in:
71
Assets/Scripts/EditorGame/GameElements/SubstantialObject.cs
Normal file
71
Assets/Scripts/EditorGame/GameElements/SubstantialObject.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public abstract class SubstantialObject : GameElement, IHaveTransformSubmodule, IHaveTimeDurationSubmodule, IHaveColorSubmodule
|
||||
{
|
||||
public string themeBundleName, objectName;
|
||||
|
||||
public TransformSubmodule transformSubmodule { get; set; }
|
||||
public TimeDurationSubmodule timeDurationSubmodule { get; set; }
|
||||
public ColorSubmodule colorSubmodule { get; set; }
|
||||
public bool haveEmission { get; }
|
||||
|
||||
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);
|
||||
|
||||
return substantialObject;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
{
|
||||
transformSubmodule = new TransformSubmodule(this);
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
colorSubmodule = new ColorSubmodule(this);
|
||||
|
||||
submoduleList.Add(transformSubmodule);
|
||||
submoduleList.Add(timeDurationSubmodule);
|
||||
submoduleList.Add(colorSubmodule);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class SubstantialObject_BM : GameElement_BM
|
||||
{
|
||||
public string themeBundleName;
|
||||
public string objectName;
|
||||
|
||||
public SubstantialObject_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public SubstantialObject_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement,
|
||||
string themeBundleName, string objectName)
|
||||
: base(elementName, elementGuid, tags, attachedElement)
|
||||
{
|
||||
this.themeBundleName = themeBundleName;
|
||||
this.objectName = objectName;
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement attached)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user