改改改
重大bug修复:track删除pathnode后不能正确更新 Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
@@ -66,7 +66,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
this.baseColorDirtyMark = false;
|
||||
this.emissionColorDirtyMark = false;
|
||||
|
||||
|
||||
if (!HaveSameSubmodule)
|
||||
{
|
||||
(attachedGameElement as IHaveColorSubmodule).colorSubmodule = this;
|
||||
@@ -88,7 +88,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
this.baseColorDirtyMark = false;
|
||||
this.emissionColorDirtyMark = false;
|
||||
|
||||
|
||||
if (!HaveSameSubmodule)
|
||||
{
|
||||
(attachedGameElement as IHaveColorSubmodule).colorSubmodule = this;
|
||||
@@ -106,15 +106,21 @@ namespace Ichni.RhythmGame
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("Color");
|
||||
var subcontainer = container.GenerateSubcontainer(1, 300f);
|
||||
|
||||
|
||||
if ((attachedGameElement as IHaveColorSubmodule).haveBaseColor)
|
||||
{
|
||||
var baseColor = inspector.GenerateBaseColorPicker(this, subcontainer, "Base Color", nameof(originalBaseColor));
|
||||
baseColor.AddListenerFunction(Refresh);
|
||||
// var baseColor = inspector.GenerateBaseColorPicker(this, subcontainer, "Base Color", nameof(originalBaseColor));
|
||||
// baseColor.AddListenerFunction(Refresh);
|
||||
// 新增:HSV轮盘
|
||||
var hsvDrawer = inspector.GenerateHsvDrawer(this, subcontainer, "HSV", nameof(originalBaseColor));
|
||||
hsvDrawer.AddListenerFunction(Refresh);
|
||||
|
||||
if (attachedGameElement.childElementList.Exists(x => x is BaseColorChange))
|
||||
{
|
||||
baseColor.title.text += " (Occupied by Animation)";
|
||||
baseColor.canvasGroup.interactable = false;
|
||||
// baseColor.title.text += " (Occupied by Animation)";
|
||||
// baseColor.canvasGroup.interactable = false;
|
||||
hsvDrawer.title.text += " (Occupied by Animation)";
|
||||
hsvDrawer.canvasGroup.interactable = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +129,7 @@ namespace Ichni.RhythmGame
|
||||
var emissionColor = inspector.GenerateEmissionColorPicker(this, subcontainer, "Emission Color",
|
||||
nameof(emissionEnabled), nameof(originalEmissionColor), nameof(originalEmissionIntensity));
|
||||
emissionColor.AddListenerFunction(Refresh);
|
||||
|
||||
|
||||
if (attachedGameElement.childElementList.Exists(x => x is EmissionColorChange))
|
||||
{
|
||||
emissionColor.title.text += " (Occupied by Animation)";
|
||||
@@ -147,7 +153,7 @@ namespace Ichni.RhythmGame
|
||||
public ColorSubmodule colorSubmodule { get; set; }
|
||||
public virtual bool haveBaseColor => true;
|
||||
public virtual bool haveEmissionColor => false;
|
||||
|
||||
|
||||
public void SetColorObserver()
|
||||
{
|
||||
GameElement attachedGameElement = colorSubmodule.attachedGameElement;
|
||||
@@ -158,7 +164,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
bool willRefresh = false;
|
||||
|
||||
if (colorSubmodule.baseColorDirtyMark)
|
||||
@@ -167,14 +173,14 @@ namespace Ichni.RhythmGame
|
||||
colorSubmodule.baseColorDirtyMark = false;
|
||||
willRefresh = true;
|
||||
}
|
||||
|
||||
|
||||
if (colorSubmodule.emissionColorDirtyMark)
|
||||
{
|
||||
//在动画物体中改变currentColor
|
||||
colorSubmodule.emissionColorDirtyMark = false;
|
||||
willRefresh = true;
|
||||
}
|
||||
|
||||
|
||||
if (willRefresh)
|
||||
{
|
||||
attachedGameElement.Refresh();
|
||||
@@ -209,13 +215,13 @@ namespace Ichni.RhythmGame
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
attachedElement = GameElement_BM.GetElement(attachedElementGuid);
|
||||
(attachedElement as IHaveColorSubmodule).colorSubmodule = new ColorSubmodule(attachedElement,
|
||||
(attachedElement as IHaveColorSubmodule).colorSubmodule = new ColorSubmodule(attachedElement,
|
||||
originalBaseColor, emissionEnabled, originalEmissionColor, originalEmissionIntensity);
|
||||
}
|
||||
|
||||
public override void DuplicateBM(GameElement attached)
|
||||
{
|
||||
(attached as IHaveColorSubmodule).colorSubmodule = new ColorSubmodule(attached,
|
||||
(attached as IHaveColorSubmodule).colorSubmodule = new ColorSubmodule(attached,
|
||||
originalBaseColor, emissionEnabled, originalEmissionColor, originalEmissionIntensity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,6 +79,7 @@ namespace Ichni.RhythmGame
|
||||
public void OnDestroy()
|
||||
{
|
||||
track.trackPathSubmodule.pathNodeList.Remove(this);
|
||||
track.trackPathSubmodule.SetPathPoints();
|
||||
track.Refresh();
|
||||
print("PathNode " + elementName + " destroyed.");
|
||||
}
|
||||
|
||||
@@ -98,14 +98,11 @@ namespace Ichni.RhythmGame
|
||||
SetUpSplineComputer(trackSpaceType, trackSamplingType);
|
||||
|
||||
|
||||
foreach (var pathNode in pathNodeList)
|
||||
{
|
||||
SetPathNode(pathNode);
|
||||
}
|
||||
|
||||
ClosePath();
|
||||
path.Rebuild(true);
|
||||
}
|
||||
|
||||
public void SortPathnodeInChildren()//emm待用吧
|
||||
{
|
||||
Debug.Log("TrackSort");
|
||||
@@ -127,6 +124,14 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public partial class TrackPathSubmodule
|
||||
{
|
||||
public void SetPathPoints()
|
||||
{
|
||||
path.SetPoints(new SplinePoint[0]);
|
||||
foreach (var pathNode in pathNodeList)
|
||||
{
|
||||
SetPathNode(pathNode);
|
||||
}
|
||||
}
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new TrackPathSubmodule_BM(attachedGameElement, this);
|
||||
|
||||
@@ -44,11 +44,13 @@ namespace Ichni.RhythmGame
|
||||
this.materialThemeBundleName = materialThemeBundleName;
|
||||
this.materialName = materialName;
|
||||
Material mat = ThemeBundleManager.instance.GetObject<Material>(materialThemeBundleName, materialName);
|
||||
if (mat != null)
|
||||
if (mat == null)
|
||||
{
|
||||
renderMaterial = mat;
|
||||
meshRenderer.material = renderMaterial;
|
||||
mat = EditorManager.instance.basePrefabs.defaultTrackMaterial;
|
||||
|
||||
}
|
||||
renderMaterial = mat;
|
||||
meshRenderer.material = renderMaterial;
|
||||
}
|
||||
|
||||
public override void Refresh()
|
||||
@@ -136,7 +138,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
if (enableEmission)
|
||||
{
|
||||
meshRenderer.material.EnableKeyword("_EMISSION_ON");
|
||||
meshRenderer.material.EnableKeyword("_EMISSION_ON");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -193,7 +195,7 @@ namespace Ichni.RhythmGame
|
||||
public string materialName;
|
||||
public bool enableEmission;
|
||||
public float emissionIntensity;
|
||||
public bool zWrite;
|
||||
public bool zWrite; // 新增
|
||||
|
||||
public TrackRendererSubmoduleAutoOrient_BM()
|
||||
{
|
||||
@@ -207,7 +209,7 @@ namespace Ichni.RhythmGame
|
||||
materialName = trackRendererSubmodule.materialName;
|
||||
enableEmission = trackRendererSubmodule.enableEmission;
|
||||
emissionIntensity = trackRendererSubmodule.emissionIntensity;
|
||||
|
||||
zWrite = trackRendererSubmodule.zWrite; // 新增
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
@@ -273,7 +275,7 @@ namespace Ichni.RhythmGame
|
||||
public string materialName;
|
||||
public bool enableEmission;
|
||||
public float emissionIntensity;
|
||||
public bool zWrite;
|
||||
public bool zWrite; // 新增
|
||||
|
||||
public TrackRendererSubmodulePathGenerator_BM()
|
||||
{
|
||||
@@ -287,6 +289,7 @@ namespace Ichni.RhythmGame
|
||||
materialName = trackRendererSubmodule.materialName;
|
||||
enableEmission = trackRendererSubmodule.enableEmission;
|
||||
emissionIntensity = trackRendererSubmodule.emissionIntensity;
|
||||
zWrite = trackRendererSubmodule.zWrite; // 新增
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
@@ -372,7 +375,7 @@ namespace Ichni.RhythmGame
|
||||
public string materialName;
|
||||
public bool enableEmission;
|
||||
public float emissionIntensity;
|
||||
public bool zWrite;
|
||||
public bool zWrite; // 新增
|
||||
public int sideCount;
|
||||
|
||||
public TrackRendererSubmoduleTubeGenerator_BM()
|
||||
@@ -387,6 +390,7 @@ namespace Ichni.RhythmGame
|
||||
materialName = trackRendererSubmodule.materialName;
|
||||
enableEmission = trackRendererSubmodule.enableEmission;
|
||||
emissionIntensity = trackRendererSubmodule.emissionIntensity;
|
||||
zWrite = trackRendererSubmodule.zWrite; // 新增
|
||||
sideCount = trackRendererSubmodule.sideCount;
|
||||
}
|
||||
|
||||
@@ -453,7 +457,7 @@ namespace Ichni.RhythmGame
|
||||
public string materialName;
|
||||
public bool enableEmission;
|
||||
public float emissionIntensity;
|
||||
public bool zWrite;
|
||||
public bool zWrite; // 新增
|
||||
|
||||
public TrackRendererSubmoduleSurface_BM()
|
||||
{
|
||||
@@ -467,6 +471,7 @@ namespace Ichni.RhythmGame
|
||||
materialName = trackRendererSubmodule.materialName;
|
||||
enableEmission = trackRendererSubmodule.enableEmission;
|
||||
emissionIntensity = trackRendererSubmodule.emissionIntensity;
|
||||
zWrite = trackRendererSubmodule.zWrite; // 新增
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
|
||||
Reference in New Issue
Block a user