修复
This commit is contained in:
@@ -4,21 +4,20 @@ using Ichni.Editor;
|
||||
using Ichni.RhythmGame;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using System.Collections.Generic;
|
||||
using Beatmap;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
// 以EnvironmentObject为基底,支持伪阴影shader参数刷新
|
||||
public class BasicEnvironmentObject : EnvironmentObject
|
||||
{
|
||||
[Header("Pseudo Shadow Settings")]
|
||||
public Renderer shadowRenderer; // 指向带有伪阴影shader的Renderer
|
||||
[Header("Pseudo Shadow Settings")] public Renderer shadowRenderer; // 指向带有伪阴影shader的Renderer
|
||||
|
||||
[Range(-1, 1)] public float shadowThreshold = 0.2f;
|
||||
[Range(0, 1)] public float shadowSmoothness = 0.5f;
|
||||
public bool useWorldLight = false;
|
||||
public Vector3 fakeLightDir = new Vector3(0.5f, 1, 0.5f);
|
||||
public override bool haveEmissionColor => true;
|
||||
|
||||
public static BasicEnvironmentObject GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, string themeBundleName, string objectName, GameElement parentElement,
|
||||
bool isStatic,
|
||||
@@ -34,6 +33,7 @@ namespace Ichni.RhythmGame
|
||||
basicEnvObj.fakeLightDir = fakeLightDir;
|
||||
return basicEnvObj;
|
||||
}
|
||||
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
@@ -64,6 +64,7 @@ namespace Ichni.RhythmGame
|
||||
var shadowSettings2 = container.GenerateSubcontainer(1);
|
||||
var w = inspector.GenerateVector3InputField(this, shadowSettings2, "Fake Light Direction", nameof(fakeLightDir));
|
||||
}
|
||||
|
||||
public override void SaveBM()
|
||||
{
|
||||
base.SaveBM();
|
||||
@@ -72,44 +73,46 @@ namespace Ichni.RhythmGame
|
||||
shadowThreshold, shadowSmoothness, useWorldLight, fakeLightDir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class BasicEnvironmentObject_BM : EnvironmentObject_BM
|
||||
namespace Beatmap
|
||||
{
|
||||
|
||||
public float shadowThreshold;
|
||||
public float shadowSmoothness;
|
||||
public bool useWorldLight;
|
||||
public Vector3 fakeLightDir;
|
||||
|
||||
public BasicEnvironmentObject_BM() { }
|
||||
|
||||
public BasicEnvironmentObject_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM parentElement,
|
||||
string themeBundleName, string objectName, bool isStatic,
|
||||
float shadowThreshold, float shadowSmoothness, bool useWorldLight, Vector3 fakeLightDir)
|
||||
: base(elementName, elementGuid, tags, parentElement, themeBundleName, objectName, isStatic)
|
||||
public class BasicEnvironmentObject_BM : EnvironmentObject_BM
|
||||
{
|
||||
|
||||
this.shadowThreshold = shadowThreshold;
|
||||
this.shadowSmoothness = shadowSmoothness;
|
||||
this.useWorldLight = useWorldLight;
|
||||
this.fakeLightDir = fakeLightDir;
|
||||
}
|
||||
public float shadowThreshold;
|
||||
public float shadowSmoothness;
|
||||
public bool useWorldLight;
|
||||
public Vector3 fakeLightDir;
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = BasicEnvironmentObject.GenerateElement(elementName, elementGuid, tags, false,
|
||||
themeBundleName, objectName, GetElement(attachedElementGuid), isStatic,
|
||||
shadowThreshold, shadowSmoothness, useWorldLight, fakeLightDir);
|
||||
}
|
||||
public BasicEnvironmentObject_BM()
|
||||
{
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return BasicEnvironmentObject.GenerateElement(elementName, Guid.NewGuid(), tags, false,
|
||||
themeBundleName, objectName, parent, isStatic,
|
||||
shadowThreshold, shadowSmoothness, useWorldLight, fakeLightDir);
|
||||
public BasicEnvironmentObject_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM parentElement,
|
||||
string themeBundleName, string objectName, bool isStatic,
|
||||
float shadowThreshold, float shadowSmoothness, bool useWorldLight, Vector3 fakeLightDir)
|
||||
: base(elementName, elementGuid, tags, parentElement, themeBundleName, objectName, isStatic)
|
||||
{
|
||||
|
||||
this.shadowThreshold = shadowThreshold;
|
||||
this.shadowSmoothness = shadowSmoothness;
|
||||
this.useWorldLight = useWorldLight;
|
||||
this.fakeLightDir = fakeLightDir;
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = BasicEnvironmentObject.GenerateElement(elementName, elementGuid, tags, false,
|
||||
themeBundleName, objectName, GetElement(attachedElementGuid), isStatic,
|
||||
shadowThreshold, shadowSmoothness, useWorldLight, fakeLightDir);
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return BasicEnvironmentObject.GenerateElement(elementName, Guid.NewGuid(), tags, false,
|
||||
themeBundleName, objectName, parent, isStatic,
|
||||
shadowThreshold, shadowSmoothness, useWorldLight, fakeLightDir);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user