2025-7-17

This commit is contained in:
2025-07-17 11:17:40 +08:00
parent bfed80d452
commit 5c65c85ec4
26 changed files with 13 additions and 40 deletions

View File

@@ -9,35 +9,5 @@ using Verse;
namespace WulaFallenEmpire
{
[StaticConstructorOnStartup]
public class Building_Wula_DarkEnergy_Engine : Building_GravEngine
{
// 子类自己的静态只读字段
private static readonly string _childStaticValue = "Child Value";
private static readonly CachedMaterial Wula_DarkEnergy_OrbMat = new CachedMaterial("Wula/Building/Wula_DarkEnergy_Engine_Orb", ShaderDatabase.Cutout);
// 通过实例属性暴露静态值
protected override string InstanceValue => _childStaticValue;
private static readonly CachedMaterial OrbMat = new CachedMaterial("Wula/Building/Wula_DarkEnergy_Engine_Orb", ShaderDatabase.Cutout);
}
public abstract class Building_Wula_DarkEnergy_Engine_Parent : Building_GravEngine
{
// 受保护的抽象属性(实例级别)
protected abstract string InstanceValue { get; }
// 公共访问点
public void PrintValue()
{
Console.WriteLine(InstanceValue);
}
}
public class Child : Parent
{
// 子类自己的静态只读字段
private static readonly string _childStaticValue = "Child Value";
// 通过实例属性暴露静态值
protected override string InstanceValue => _childStaticValue;
}
}