Files
ichni_Official/Assets/ThemeBundles/Basic/Scripts/EnvironmentObjects/DirectionalLight.cs
SoulliesOfficial 7580c4d87c 大更
2026-03-14 03:13:10 -04:00

67 lines
2.3 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using Ichni.RhythmGame.Beatmap;
using Ichni.RhythmGame.ThemeBundles.Basic.Beatmap;
using UnityEngine;
namespace Ichni.RhythmGame.ThemeBundles.Basic
{
public partial class DirectionalLight : EnvironmentObject
{
[SerializeField]
private Light directionalLight;
public float intensity;
public bool castShadows;
public static DirectionalLight GenerateElement(string elementName, Guid id, List<string> tags,
bool isFirstGenerated, GameElement parentElement, string themeBundleName, string objectName,
bool isStatic, float intensity, bool castShadows)
{
DirectionalLight dirLight = EnvironmentObject.GenerateElement(elementName, id, tags,
isFirstGenerated, themeBundleName, objectName, parentElement, isStatic).GetComponent<DirectionalLight>();
dirLight.intensity = intensity;
dirLight.castShadows = castShadows;
return dirLight;
}
public override void Refresh()
{
base.Refresh();
directionalLight.color = colorSubmodule.currentBaseColor;
directionalLight.intensity = intensity;
directionalLight.shadows = castShadows ? LightShadows.Soft : LightShadows.None;
}
}
namespace Beatmap
{
public class DirectionalLight_BM : EnvironmentObject_BM
{
public float intensity;
public bool castShadows;
public DirectionalLight_BM()
{
}
public DirectionalLight_BM(string elementName, Guid id, List<string> tags,
GameElement_BM parent, string themeBundleName, string objectName, bool isStatic,
float intensity, bool castShadows) :
base(elementName, id, tags, parent, themeBundleName, objectName, isStatic)
{
this.intensity = intensity;
this.castShadows = castShadows;
}
public override void ExecuteBM()
{
matchedElement = DirectionalLight.GenerateElement(elementName, elementGuid, tags, false,
GetElement(attachedElementGuid), themeBundleName, objectName, isStatic, intensity, castShadows);
}
}
}
}