同步主题包
This commit is contained in:
@@ -6,7 +6,7 @@ using UnityEngine;
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap
|
||||
{
|
||||
[System.Serializable]
|
||||
public class DTMFramesFloor_BM : EnvironmentObject_BM
|
||||
public class DTMRandomGridFloor_BM : EnvironmentObject_BM
|
||||
{
|
||||
public float patternSizeX = 100.0f;
|
||||
public float patternSizeY = 100.0f;
|
||||
@@ -22,11 +22,11 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap
|
||||
public float outerBorderColorA = 1f;
|
||||
public float outerBorderWidth = 0.02f;
|
||||
|
||||
public DTMFramesFloor_BM()
|
||||
public DTMRandomGridFloor_BM()
|
||||
{
|
||||
}
|
||||
|
||||
public DTMFramesFloor_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement,
|
||||
public DTMRandomGridFloor_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement,
|
||||
string themeBundleName, string objectName, bool isStatic,
|
||||
float patternSizeX, float patternSizeY, float gridDensity,
|
||||
float timeAngle, float stepA, float stepB,
|
||||
@@ -53,7 +53,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap
|
||||
{
|
||||
Color outerColor = new Color(outerBorderColorR, outerBorderColorG, outerBorderColorB, outerBorderColorA);
|
||||
|
||||
matchedElement = DTMFramesFloor.GenerateElement(elementName, elementGuid, tags, false,
|
||||
matchedElement = DTMRandomGridFloor.GenerateElement(elementName, elementGuid, tags, false,
|
||||
themeBundleName, objectName, GetElement(attachedElementGuid), isStatic,
|
||||
patternSizeX, patternSizeY, gridDensity,
|
||||
timeAngle, stepA, stepB,
|
||||
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap
|
||||
{
|
||||
[System.Serializable]
|
||||
public class DTMRandomGridTube_BM : EnvironmentObject_BM
|
||||
{
|
||||
public float patternSizeX = 2.0f;
|
||||
public float patternSizeY = 2.0f;
|
||||
public float gridDensity = 1.0f;
|
||||
public float timeAngle = 1.0f;
|
||||
|
||||
public float stepA = 0.293f;
|
||||
public float stepB = 0.345f;
|
||||
|
||||
public float seamRotation = -90f;
|
||||
public float seamFadeWidth = 0.2f;
|
||||
public float seamFadeSmoothness = 1.0f;
|
||||
|
||||
public float fadeFar = 100f;
|
||||
public float fadeNear = 20f;
|
||||
public float tubeRadius = 10f;
|
||||
|
||||
public DTMRandomGridTube_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public DTMRandomGridTube_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement,
|
||||
string themeBundleName, string objectName, bool isStatic,
|
||||
float patternSizeX, float patternSizeY, float gridDensity,
|
||||
float timeAngle, float stepA, float stepB,
|
||||
float seamRotation, float seamFadeWidth, float seamFadeSmoothness,
|
||||
float fadeFar, float fadeNear, float tubeRadius)
|
||||
: base(elementName, elementGuid, tags, attachedElement, themeBundleName, objectName, isStatic)
|
||||
{
|
||||
this.patternSizeX = patternSizeX;
|
||||
this.patternSizeY = patternSizeY;
|
||||
this.gridDensity = gridDensity;
|
||||
this.timeAngle = timeAngle;
|
||||
this.stepA = stepA;
|
||||
this.stepB = stepB;
|
||||
this.seamRotation = seamRotation;
|
||||
this.seamFadeWidth = seamFadeWidth;
|
||||
this.seamFadeSmoothness = seamFadeSmoothness;
|
||||
this.fadeFar = fadeFar;
|
||||
this.fadeNear = fadeNear;
|
||||
this.tubeRadius = tubeRadius;
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = DTMRandomGridTube.GenerateElement(elementName, elementGuid, tags, false,
|
||||
themeBundleName, objectName, GetElement(attachedElementGuid), isStatic,
|
||||
patternSizeX, patternSizeY, gridDensity, timeAngle,
|
||||
stepA, stepB,
|
||||
seamRotation, seamFadeWidth, seamFadeSmoothness,
|
||||
fadeFar, fadeNear, tubeRadius);
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return DTMRandomGridTube.GenerateElement(elementName, Guid.NewGuid(), tags, true,
|
||||
themeBundleName, objectName, parent, isStatic,
|
||||
patternSizeX, patternSizeY, gridDensity, timeAngle,
|
||||
stepA, stepB,
|
||||
seamRotation, seamFadeWidth, seamFadeSmoothness,
|
||||
fadeFar, fadeNear, tubeRadius);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 35dc54bd0cb8de44088324424a895a98
|
||||
@@ -0,0 +1,132 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap
|
||||
{
|
||||
[System.Serializable]
|
||||
public class DTMStarrySkybox_BM : EnvironmentObject_BM
|
||||
{
|
||||
// --- Sky ---
|
||||
public float skyColorR = 0.1f, skyColorG = 0.0f, skyColorB = 0.3f, skyColorA = 1f;
|
||||
public float horizonR = 0.2f, horizonG = 0.4f, horizonB = 0.8f, horizonA = 1f;
|
||||
public float horizonStrength = 2f;
|
||||
public float horizonSkyHeight = 0.7f;
|
||||
|
||||
// --- Stars ---
|
||||
public bool useStarMap = true;
|
||||
public float starDensity = 30f;
|
||||
public float starSize = 75f;
|
||||
public float starColorR = 1f, starColorG = 1f, starColorB = 1f, starColorA = 1f;
|
||||
public bool preventStarsInFrontOfSun = true;
|
||||
public string starMapTextureName = "None";
|
||||
|
||||
// --- Sun Mask ---
|
||||
public bool haveSun = false;
|
||||
public string sunMaskTextureName = "None";
|
||||
public float sunMaskSize = 0.02f;
|
||||
public float sunMaskSpherize = 13.2f;
|
||||
public float sunDiscSize = 1f;
|
||||
public float sunColorOneR = 0.4f, sunColorOneG = 0.2f, sunColorOneB = 0.6f, sunColorOneA = 1f;
|
||||
public float sunColorTwoR = 0.1f, sunColorTwoG = 0.2f, sunColorTwoB = 0.4f, sunColorTwoA = 1f;
|
||||
public float sunGradientStrength = 3.7f;
|
||||
public float sunGradientHeight = 1.23f;
|
||||
|
||||
// --- Fog ---
|
||||
public float fogHeight = 1f;
|
||||
public float fogPower = 0.5f;
|
||||
public float fogContrast = 40f;
|
||||
|
||||
public DTMStarrySkybox_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public DTMStarrySkybox_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement,
|
||||
string themeBundleName, string objectName, bool isStatic,
|
||||
float skyColorR, float skyColorG, float skyColorB, float skyColorA,
|
||||
float horizonR, float horizonG, float horizonB, float horizonA,
|
||||
float horizonStrength, float horizonSkyHeight,
|
||||
bool useStarMap, float starDensity, float starSize,
|
||||
float starColorR, float starColorG, float starColorB, float starColorA,
|
||||
bool preventStarsInFrontOfSun, string starMapTextureName,
|
||||
bool haveSun, string sunMaskTextureName,
|
||||
float sunMaskSize, float sunMaskSpherize, float sunDiscSize,
|
||||
float sunColorOneR, float sunColorOneG, float sunColorOneB, float sunColorOneA,
|
||||
float sunColorTwoR, float sunColorTwoG, float sunColorTwoB, float sunColorTwoA,
|
||||
float sunGradientStrength, float sunGradientHeight,
|
||||
float fogHeight, float fogPower, float fogContrast)
|
||||
: base(elementName, elementGuid, tags, attachedElement, themeBundleName, objectName, isStatic)
|
||||
{
|
||||
this.skyColorR = skyColorR; this.skyColorG = skyColorG; this.skyColorB = skyColorB; this.skyColorA = skyColorA;
|
||||
this.horizonR = horizonR; this.horizonG = horizonG; this.horizonB = horizonB; this.horizonA = horizonA;
|
||||
this.horizonStrength = horizonStrength;
|
||||
this.horizonSkyHeight = horizonSkyHeight;
|
||||
this.useStarMap = useStarMap;
|
||||
this.starDensity = starDensity;
|
||||
this.starSize = starSize;
|
||||
this.starColorR = starColorR; this.starColorG = starColorG; this.starColorB = starColorB; this.starColorA = starColorA;
|
||||
this.preventStarsInFrontOfSun = preventStarsInFrontOfSun;
|
||||
this.starMapTextureName = starMapTextureName;
|
||||
this.haveSun = haveSun;
|
||||
this.sunMaskTextureName = sunMaskTextureName;
|
||||
this.sunMaskSize = sunMaskSize;
|
||||
this.sunMaskSpherize = sunMaskSpherize;
|
||||
this.sunDiscSize = sunDiscSize;
|
||||
this.sunColorOneR = sunColorOneR; this.sunColorOneG = sunColorOneG; this.sunColorOneB = sunColorOneB; this.sunColorOneA = sunColorOneA;
|
||||
this.sunColorTwoR = sunColorTwoR; this.sunColorTwoG = sunColorTwoG; this.sunColorTwoB = sunColorTwoB; this.sunColorTwoA = sunColorTwoA;
|
||||
this.sunGradientStrength = sunGradientStrength;
|
||||
this.sunGradientHeight = sunGradientHeight;
|
||||
this.fogHeight = fogHeight;
|
||||
this.fogPower = fogPower;
|
||||
this.fogContrast = fogContrast;
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = DTMStarrySkybox.GenerateElement(
|
||||
elementName, elementGuid, tags, false,
|
||||
themeBundleName, objectName, GetElement(attachedElementGuid), isStatic,
|
||||
// Sky
|
||||
new Color(skyColorR, skyColorG, skyColorB, skyColorA),
|
||||
new Color(horizonR, horizonG, horizonB, horizonA),
|
||||
horizonStrength, horizonSkyHeight,
|
||||
// Stars
|
||||
useStarMap, starDensity, starSize,
|
||||
new Color(starColorR, starColorG, starColorB, starColorA),
|
||||
preventStarsInFrontOfSun, starMapTextureName,
|
||||
// Sun
|
||||
haveSun, sunMaskTextureName,
|
||||
sunMaskSize, sunMaskSpherize, sunDiscSize,
|
||||
new Color(sunColorOneR, sunColorOneG, sunColorOneB, sunColorOneA),
|
||||
new Color(sunColorTwoR, sunColorTwoG, sunColorTwoB, sunColorTwoA),
|
||||
sunGradientStrength, sunGradientHeight,
|
||||
// Fog
|
||||
fogHeight, fogPower, fogContrast);
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return DTMStarrySkybox.GenerateElement(
|
||||
elementName, Guid.NewGuid(), tags, true,
|
||||
themeBundleName, objectName, parent, isStatic,
|
||||
// Sky
|
||||
new Color(skyColorR, skyColorG, skyColorB, skyColorA),
|
||||
new Color(horizonR, horizonG, horizonB, horizonA),
|
||||
horizonStrength, horizonSkyHeight,
|
||||
// Stars
|
||||
useStarMap, starDensity, starSize,
|
||||
new Color(starColorR, starColorG, starColorB, starColorA),
|
||||
preventStarsInFrontOfSun, starMapTextureName,
|
||||
// Sun
|
||||
haveSun, sunMaskTextureName,
|
||||
sunMaskSize, sunMaskSpherize, sunDiscSize,
|
||||
new Color(sunColorOneR, sunColorOneG, sunColorOneB, sunColorOneA),
|
||||
new Color(sunColorTwoR, sunColorTwoG, sunColorTwoB, sunColorTwoA),
|
||||
sunGradientStrength, sunGradientHeight,
|
||||
// Fog
|
||||
fogHeight, fogPower, fogContrast);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c6f85c2da670a484ea48cb01c2b0e8c8
|
||||
@@ -4,12 +4,12 @@ using Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public partial class DTMFramesFloor
|
||||
public partial class DTMRandomGridFloor
|
||||
{
|
||||
#region [Editor] Inspection & Save
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new DTMFramesFloor_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM,
|
||||
matchedBM = new DTMRandomGridFloor_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM,
|
||||
themeBundleName, objectName, isStatic,
|
||||
patternSizeX, patternSizeY, gridDensity,
|
||||
timeAngle, stepA, stepB,
|
||||
@@ -0,0 +1,45 @@
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public partial class DTMRandomGridTube
|
||||
{
|
||||
#region [Editor] Inspection & Save
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new DTMRandomGridTube_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM,
|
||||
themeBundleName, objectName, isStatic,
|
||||
patternSizeX, patternSizeY, gridDensity,
|
||||
timeAngle, stepA, stepB,
|
||||
seamRotation, seamFadeWidth, seamFadeSmoothness,
|
||||
fadeFar, fadeNear, tubeRadius);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
base.SetUpInspector();
|
||||
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("DTMRandomGridTube");
|
||||
var subcontainer = container.GenerateSubcontainer(3);
|
||||
|
||||
inspector.GenerateInputField(this, subcontainer, "Pattern Size X", nameof(patternSizeX)).AddListenerFunction(UpdateMaterialProperties);
|
||||
inspector.GenerateInputField(this, subcontainer, "Pattern Size Y", nameof(patternSizeY)).AddListenerFunction(UpdateMaterialProperties);
|
||||
inspector.GenerateInputField(this, subcontainer, "Grid Density", nameof(gridDensity)).AddListenerFunction(UpdateMaterialProperties);
|
||||
inspector.GenerateInputField(this, subcontainer, "Time Angle", nameof(timeAngle)).AddListenerFunction(UpdateMaterialProperties);
|
||||
inspector.GenerateInputField(this, subcontainer, "Step A", nameof(stepA)).AddListenerFunction(UpdateMaterialProperties);
|
||||
inspector.GenerateInputField(this, subcontainer, "Step B", nameof(stepB)).AddListenerFunction(UpdateMaterialProperties);
|
||||
|
||||
inspector.GenerateInputField(this, subcontainer, "Seam Rotation", nameof(seamRotation)).AddListenerFunction(UpdateMaterialProperties);
|
||||
inspector.GenerateInputField(this, subcontainer, "Seam Fade Width", nameof(seamFadeWidth)).AddListenerFunction(UpdateMaterialProperties);
|
||||
inspector.GenerateInputField(this, subcontainer, "Seam Fade Smoothness", nameof(seamFadeSmoothness)).AddListenerFunction(UpdateMaterialProperties);
|
||||
|
||||
inspector.GenerateInputField(this, subcontainer, "Fade Far", nameof(fadeFar)).AddListenerFunction(UpdateMaterialProperties);
|
||||
inspector.GenerateInputField(this, subcontainer, "Fade Near", nameof(fadeNear)).AddListenerFunction(UpdateMaterialProperties);
|
||||
inspector.GenerateInputField(this, subcontainer, "Tube Radius", nameof(tubeRadius)).AddListenerFunction(UpdateMaterialProperties);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f030580b278b8545a96aeb3edf757b0
|
||||
@@ -0,0 +1,79 @@
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public partial class DTMStarrySkybox
|
||||
{
|
||||
#region [Editor] Inspection & Save
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new DTMStarrySkybox_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM,
|
||||
themeBundleName, objectName, isStatic,
|
||||
// Sky
|
||||
skyColor.r, skyColor.g, skyColor.b, skyColor.a,
|
||||
horizon.r, horizon.g, horizon.b, horizon.a,
|
||||
horizonStrength, horizonSkyHeight,
|
||||
// Stars
|
||||
useStarMap, starDensity, starSize,
|
||||
starColor.r, starColor.g, starColor.b, starColor.a,
|
||||
preventStarsInFrontOfSun, starMapTextureName,
|
||||
// Sun
|
||||
haveSun, sunMaskTextureName,
|
||||
sunMaskSize, sunMaskSpherize, sunDiscSize,
|
||||
sunColorOne.r, sunColorOne.g, sunColorOne.b, sunColorOne.a,
|
||||
sunColorTwo.r, sunColorTwo.g, sunColorTwo.b, sunColorTwo.a,
|
||||
sunGradientStrength, sunGradientHeight,
|
||||
// Fog
|
||||
fogHeight, fogPower, fogContrast);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
base.SetUpInspector();
|
||||
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
|
||||
// --- Sky ---
|
||||
var skyContainer = inspector.GenerateContainer("DTMStarrySkybox - Sky");
|
||||
var skyFields = skyContainer.GenerateSubcontainer(3);
|
||||
inspector.GenerateBaseColorPicker(this, skyFields, "Sky Color", nameof(skyColor)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateBaseColorPicker(this, skyFields, "Horizon", nameof(horizon)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, skyFields, "Horizon Strength", nameof(horizonStrength)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, skyFields, "Horizon Sky Height", nameof(horizonSkyHeight)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
|
||||
// --- Stars ---
|
||||
var starsContainer = inspector.GenerateContainer("DTMStarrySkybox - Stars");
|
||||
var starsFields = starsContainer.GenerateSubcontainer(3);
|
||||
inspector.GenerateToggle(this, starsFields, "Use Star Map", nameof(useStarMap)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, starsFields, "Star Map Texture Name", nameof(starMapTextureName)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, starsFields, "Star Density", nameof(starDensity)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, starsFields, "Star Size", nameof(starSize)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateBaseColorPicker(this, starsFields, "Star Color", nameof(starColor)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateToggle(this, starsFields, "Prevent Stars In Front Of Sun", nameof(preventStarsInFrontOfSun)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
|
||||
// --- Sun ---
|
||||
var sunContainer = inspector.GenerateContainer("DTMStarrySkybox - Sun");
|
||||
var sunFields = sunContainer.GenerateSubcontainer(3);
|
||||
inspector.GenerateToggle(this, sunFields, "Have Sun", nameof(haveSun)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, sunFields, "Sun Mask Texture Name", nameof(sunMaskTextureName)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, sunFields, "Sun Mask Size", nameof(sunMaskSize)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, sunFields, "Sun Mask Spherize", nameof(sunMaskSpherize)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, sunFields, "Sun Disc Size", nameof(sunDiscSize)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateBaseColorPicker(this, sunFields, "Sun Color One", nameof(sunColorOne)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateBaseColorPicker(this, sunFields, "Sun Color Two", nameof(sunColorTwo)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, sunFields, "Sun Gradient Strength", nameof(sunGradientStrength)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, sunFields, "Sun Gradient Height", nameof(sunGradientHeight)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
|
||||
// --- Fog ---
|
||||
var fogContainer = inspector.GenerateContainer("DTMStarrySkybox - Fog");
|
||||
var fogFields = fogContainer.GenerateSubcontainer(3);
|
||||
inspector.GenerateInputField(this, fogFields, "Fog Height", nameof(fogHeight)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, fogFields, "Fog Power", nameof(fogPower)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, fogFields, "Fog Contrast", nameof(fogContrast)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7904b9c51462de946adf3571362ac933
|
||||
@@ -5,7 +5,7 @@ using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public partial class DTMFramesFloor : EnvironmentObject
|
||||
public partial class DTMRandomGridFloor : EnvironmentObject
|
||||
{
|
||||
#region [暴露属性字段] Exposed Fields
|
||||
public float patternSizeX;
|
||||
@@ -23,7 +23,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
#endregion
|
||||
|
||||
#region [生命周期与工厂] Lifecycle & Factory
|
||||
public static DTMFramesFloor GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
public static DTMRandomGridFloor GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, string themeBundleName, string objectName, GameElement parentElement,
|
||||
bool isStatic,
|
||||
float patternSizeX, float patternSizeY, float gridDensity,
|
||||
@@ -32,21 +32,21 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
Color outerBorderColor,
|
||||
float outerBorderWidth)
|
||||
{
|
||||
DTMFramesFloor framesFloor = EnvironmentObject.GenerateElement(elementName, id, tags,
|
||||
isFirstGenerated, themeBundleName, objectName, parentElement, isStatic).GetComponent<DTMFramesFloor>();
|
||||
DTMRandomGridFloor randomGridFloor = EnvironmentObject.GenerateElement(elementName, id, tags,
|
||||
isFirstGenerated, themeBundleName, objectName, parentElement, isStatic).GetComponent<DTMRandomGridFloor>();
|
||||
|
||||
framesFloor.patternSizeX = patternSizeX;
|
||||
framesFloor.patternSizeY = patternSizeY;
|
||||
framesFloor.gridDensity = gridDensity;
|
||||
framesFloor.timeAngle = timeAngle;
|
||||
framesFloor.stepA = stepA;
|
||||
framesFloor.stepB = stepB;
|
||||
randomGridFloor.patternSizeX = patternSizeX;
|
||||
randomGridFloor.patternSizeY = patternSizeY;
|
||||
randomGridFloor.gridDensity = gridDensity;
|
||||
randomGridFloor.timeAngle = timeAngle;
|
||||
randomGridFloor.stepA = stepA;
|
||||
randomGridFloor.stepB = stepB;
|
||||
|
||||
framesFloor.enableOuterBorder = enableOuterBorder;
|
||||
framesFloor.outerBorderColor = outerBorderColor;
|
||||
framesFloor.outerBorderWidth = outerBorderWidth;
|
||||
randomGridFloor.enableOuterBorder = enableOuterBorder;
|
||||
randomGridFloor.outerBorderColor = outerBorderColor;
|
||||
randomGridFloor.outerBorderWidth = outerBorderWidth;
|
||||
|
||||
return framesFloor;
|
||||
return randomGridFloor;
|
||||
}
|
||||
|
||||
public override void FirstSetUpObject(bool isFirstGenerated)
|
||||
@@ -0,0 +1,117 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public partial class DTMRandomGridTube : EnvironmentObject
|
||||
{
|
||||
#region [暴露属性字段] Exposed Fields
|
||||
public float patternSizeX = 2.0f;
|
||||
public float patternSizeY = 2.0f;
|
||||
public float gridDensity = 1.0f;
|
||||
public float timeAngle = 1.0f;
|
||||
|
||||
public float stepA = 0.293f;
|
||||
public float stepB = 0.345f;
|
||||
|
||||
public float seamRotation = -90f;
|
||||
public float seamFadeWidth = 0.2f;
|
||||
public float seamFadeSmoothness = 1.0f;
|
||||
|
||||
public float fadeFar = 100f;
|
||||
public float fadeNear = 20f;
|
||||
public float tubeRadius = 10f;
|
||||
|
||||
public Renderer meshRenderer;
|
||||
#endregion
|
||||
|
||||
#region [生命周期与工厂] Lifecycle & Factory
|
||||
public static DTMRandomGridTube GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, string themeBundleName, string objectName, GameElement parentElement,
|
||||
bool isStatic,
|
||||
float patternSizeX, float patternSizeY, float gridDensity,
|
||||
float timeAngle, float stepA, float stepB,
|
||||
float seamRotation, float seamFadeWidth, float seamFadeSmoothness,
|
||||
float fadeFar, float fadeNear, float tubeRadius)
|
||||
{
|
||||
DTMRandomGridTube randomGridTube = EnvironmentObject.GenerateElement(elementName, id, tags,
|
||||
isFirstGenerated, themeBundleName, objectName, parentElement, isStatic).GetComponent<DTMRandomGridTube>();
|
||||
|
||||
randomGridTube.patternSizeX = patternSizeX;
|
||||
randomGridTube.patternSizeY = patternSizeY;
|
||||
randomGridTube.gridDensity = gridDensity;
|
||||
randomGridTube.timeAngle = timeAngle;
|
||||
|
||||
randomGridTube.stepA = stepA;
|
||||
randomGridTube.stepB = stepB;
|
||||
|
||||
randomGridTube.seamRotation = seamRotation;
|
||||
randomGridTube.seamFadeWidth = seamFadeWidth;
|
||||
randomGridTube.seamFadeSmoothness = seamFadeSmoothness;
|
||||
|
||||
randomGridTube.fadeFar = fadeFar;
|
||||
randomGridTube.fadeNear = fadeNear;
|
||||
randomGridTube.tubeRadius = tubeRadius;
|
||||
|
||||
return randomGridTube;
|
||||
}
|
||||
|
||||
public override void FirstSetUpObject(bool isFirstGenerated)
|
||||
{
|
||||
if (meshRenderer == null)
|
||||
meshRenderer = GetComponentInChildren<Renderer>();
|
||||
|
||||
if (meshRenderer != null)
|
||||
{
|
||||
meshRenderer.InitializeShader(); // 实例化材质 / Instantiate material
|
||||
UpdateMaterialProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDirtyRefresh(Dictionary<string, bool> flags)
|
||||
{
|
||||
UpdateMaterialProperties();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [效果核心逻辑] Core Effect Logic
|
||||
public void UpdateMaterialProperties()
|
||||
{
|
||||
if (meshRenderer != null && meshRenderer.material != null)
|
||||
{
|
||||
Material mat = meshRenderer.material;
|
||||
|
||||
mat.SetVector("_PatternSize", new Vector4(patternSizeX, patternSizeY, 0, 0));
|
||||
mat.SetFloat("_GridDensity", gridDensity);
|
||||
mat.SetFloat("_TimeAngle", timeAngle);
|
||||
|
||||
mat.SetFloat("_StepA", stepA);
|
||||
mat.SetFloat("_StepB", stepB);
|
||||
|
||||
mat.SetFloat("_SeamRotation", seamRotation);
|
||||
mat.SetFloat("_SeamFadeWidth", seamFadeWidth);
|
||||
mat.SetFloat("_SeamFadeSmoothness", seamFadeSmoothness);
|
||||
|
||||
mat.SetFloat("_FadeFar", fadeFar);
|
||||
mat.SetFloat("_FadeNear", fadeNear);
|
||||
mat.SetFloat("_TubeRadius", tubeRadius);
|
||||
|
||||
// Sync color mapped from unified generic submodule
|
||||
mat.SetColor("_Color0", colorSubmodule.currentBaseColor);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
// Sync environment color changes
|
||||
if (meshRenderer != null && meshRenderer.material != null)
|
||||
{
|
||||
meshRenderer.material.SetColor("_Color0", colorSubmodule.currentBaseColor);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 26a21b12ae64bfc43aa9129823e862ac
|
||||
@@ -0,0 +1,201 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
/// <summary>
|
||||
/// 游星空天空盒环境物体,加载 DTM_Skybox_Starry 材质并将其设置为场景天空盒,
|
||||
/// 同时暴露天空盒 Shader 的全量参数以接受 PropertyAnimation 动态控制。
|
||||
/// </summary>
|
||||
public partial class DTMStarrySkybox : EnvironmentObject
|
||||
{
|
||||
#region [暴露属性字段] Exposed Fields
|
||||
|
||||
// 天空盒材质(运行时实例)
|
||||
[NonSerialized] public Material skyboxMaterial;
|
||||
|
||||
// --- Sky ---
|
||||
public Color skyColor = Color.blue;
|
||||
public Color horizon = Color.cyan;
|
||||
public float horizonStrength = 2f;
|
||||
public float horizonSkyHeight = 0.7f;
|
||||
|
||||
// --- Stars ---
|
||||
public bool useStarMap = true;
|
||||
public float starDensity = 30f;
|
||||
public float starSize = 75f;
|
||||
public Color starColor = Color.white;
|
||||
public bool preventStarsInFrontOfSun = true;
|
||||
// 通过 ThemeBundle 字符串名称查找贴图
|
||||
public string starMapTextureName = "None";
|
||||
|
||||
// --- Sun Mask ---
|
||||
public bool haveSun = false;
|
||||
public string sunMaskTextureName = "None";
|
||||
public float sunMaskSize = 0.02f;
|
||||
public float sunMaskSpherize = 13.2f;
|
||||
public float sunDiscSize = 1f;
|
||||
public Color sunColorOne = Color.white;
|
||||
public Color sunColorTwo = Color.white;
|
||||
public float sunGradientStrength = 3.7f;
|
||||
public float sunGradientHeight = 1.23f;
|
||||
|
||||
// --- Fog ---
|
||||
public float fogHeight = 1f;
|
||||
public float fogPower = 0.5f;
|
||||
public float fogContrast = 40f;
|
||||
|
||||
#endregion
|
||||
|
||||
#region [生命周期与工厂] Lifecycle & Factory
|
||||
|
||||
public static DTMStarrySkybox GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, string themeBundleName, string objectName, GameElement parentElement,
|
||||
bool isStatic,
|
||||
// Sky
|
||||
Color skyColor, Color horizon, float horizonStrength, float horizonSkyHeight,
|
||||
// Stars
|
||||
bool useStarMap, float starDensity, float starSize, Color starColor,
|
||||
bool preventStarsInFrontOfSun, string starMapTextureName,
|
||||
// Sun
|
||||
bool haveSun, string sunMaskTextureName,
|
||||
float sunMaskSize, float sunMaskSpherize, float sunDiscSize,
|
||||
Color sunColorOne, Color sunColorTwo, float sunGradientStrength, float sunGradientHeight,
|
||||
// Fog
|
||||
float fogHeight, float fogPower, float fogContrast)
|
||||
{
|
||||
DTMStarrySkybox skybox = EnvironmentObject.GenerateElement(elementName, id, tags,
|
||||
isFirstGenerated, themeBundleName, objectName, parentElement, isStatic)
|
||||
.GetComponent<DTMStarrySkybox>();
|
||||
|
||||
skybox.skyColor = skyColor;
|
||||
skybox.horizon = horizon;
|
||||
skybox.horizonStrength = horizonStrength;
|
||||
skybox.horizonSkyHeight = horizonSkyHeight;
|
||||
|
||||
skybox.useStarMap = useStarMap;
|
||||
skybox.starDensity = starDensity;
|
||||
skybox.starSize = starSize;
|
||||
skybox.starColor = starColor;
|
||||
skybox.preventStarsInFrontOfSun = preventStarsInFrontOfSun;
|
||||
skybox.starMapTextureName = starMapTextureName;
|
||||
|
||||
skybox.haveSun = haveSun;
|
||||
skybox.sunMaskTextureName = sunMaskTextureName;
|
||||
skybox.sunMaskSize = sunMaskSize;
|
||||
skybox.sunMaskSpherize = sunMaskSpherize;
|
||||
skybox.sunDiscSize = sunDiscSize;
|
||||
skybox.sunColorOne = sunColorOne;
|
||||
skybox.sunColorTwo = sunColorTwo;
|
||||
skybox.sunGradientStrength = sunGradientStrength;
|
||||
skybox.sunGradientHeight = sunGradientHeight;
|
||||
|
||||
skybox.fogHeight = fogHeight;
|
||||
skybox.fogPower = fogPower;
|
||||
skybox.fogContrast = fogContrast;
|
||||
|
||||
return skybox;
|
||||
}
|
||||
|
||||
public override void FirstSetUpObject(bool isFirstGenerated)
|
||||
{
|
||||
// 从 ThemeBundle 中加载天空盒材质并实例化,赋给场景天空盒
|
||||
Material sourceMat = ThemeBundleManager.instance.GetObject<Material>(themeBundleName, "DTM_Skybox_Starry");
|
||||
if (sourceMat != null)
|
||||
{
|
||||
skyboxMaterial = new Material(sourceMat); // 实例化,隔离修改
|
||||
RenderSettings.skybox = skyboxMaterial;
|
||||
Debug.Log($"[DTMStarrySkybox] 成功加载并应用天空盒材质 'DTM_Skybox_Starry' 作为场景天空盒。");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"[DTMStarrySkybox] 无法在 ThemeBundle '{themeBundleName}' 中找到 'DTM_Skybox_Starry' 材质!");
|
||||
return;
|
||||
}
|
||||
|
||||
UpdateSkyboxProperties();
|
||||
}
|
||||
|
||||
public override void OnDirtyRefresh(Dictionary<string, bool> flags)
|
||||
{
|
||||
UpdateSkyboxProperties();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region [效果核心逻辑] Core Effect Logic
|
||||
|
||||
/// <summary>
|
||||
/// 将所有本地缓存参数一次性批量写入天空盒材质,并通知 DynamicGI 刷新。
|
||||
/// </summary>
|
||||
public void UpdateSkyboxProperties()
|
||||
{
|
||||
if (skyboxMaterial == null) return;
|
||||
|
||||
// -- Sky --
|
||||
skyboxMaterial.SetColor("_SkyColor", skyColor);
|
||||
skyboxMaterial.SetColor("_Horizon", horizon);
|
||||
skyboxMaterial.SetFloat("_HorizonStrength", horizonStrength);
|
||||
skyboxMaterial.SetFloat("_HorizonSkyHeight", horizonSkyHeight);
|
||||
|
||||
// -- Stars --
|
||||
skyboxMaterial.SetFloat("_UseStarMap", useStarMap ? 1f : 0f);
|
||||
skyboxMaterial.SetFloat("_StarDensity", starDensity);
|
||||
skyboxMaterial.SetFloat("_StarSize", starSize);
|
||||
skyboxMaterial.SetColor("_StarColor", starColor);
|
||||
skyboxMaterial.SetFloat("_PreventStarsInFrontOfSun", preventStarsInFrontOfSun ? 1f : 0f);
|
||||
|
||||
// 星图贴图通过 ThemeBundle 按名称查找
|
||||
if (!string.IsNullOrEmpty(starMapTextureName) && starMapTextureName != "None")
|
||||
{
|
||||
Texture2D starMap = ThemeBundleManager.instance.GetObject<Texture2D>(themeBundleName, starMapTextureName);
|
||||
if (starMap != null) skyboxMaterial.SetTexture("_StarMap", starMap);
|
||||
}
|
||||
|
||||
// -- Sun Mask --
|
||||
skyboxMaterial.SetFloat("_HaveSun", haveSun ? 1f : 0f);
|
||||
|
||||
if (!string.IsNullOrEmpty(sunMaskTextureName) && sunMaskTextureName != "None")
|
||||
{
|
||||
Texture2D sunMask = ThemeBundleManager.instance.GetObject<Texture2D>(themeBundleName, sunMaskTextureName);
|
||||
if (sunMask != null) skyboxMaterial.SetTexture("_SunMask", sunMask);
|
||||
}
|
||||
|
||||
skyboxMaterial.SetFloat("_SunMaskSize", sunMaskSize);
|
||||
skyboxMaterial.SetFloat("_SunMaskSpherize", sunMaskSpherize);
|
||||
skyboxMaterial.SetFloat("_SunDiscSize", sunDiscSize);
|
||||
skyboxMaterial.SetColor("_SunColorOne", sunColorOne);
|
||||
skyboxMaterial.SetColor("_SunColorTwo", sunColorTwo);
|
||||
skyboxMaterial.SetFloat("_SunGradientStrength", sunGradientStrength);
|
||||
skyboxMaterial.SetFloat("_SunGradientHeight", sunGradientHeight);
|
||||
|
||||
// -- Fog --
|
||||
skyboxMaterial.SetFloat("_FogHeight", fogHeight);
|
||||
skyboxMaterial.SetFloat("_FogPower", fogPower);
|
||||
skyboxMaterial.SetFloat("_FogContrast", fogContrast);
|
||||
|
||||
// 通知引擎重烤全局间接光
|
||||
DynamicGI.UpdateEnvironment();
|
||||
}
|
||||
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
if (skyboxMaterial != null)
|
||||
{
|
||||
RenderSettings.skybox = skyboxMaterial;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
base.OnDelete();
|
||||
// 还原场景天空盒,防止场景切换后残留
|
||||
RenderSettings.skybox = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3fe829cad763c61439c6596ef1e4c181
|
||||
Reference in New Issue
Block a user