update to placing system, you must replace all old glass

This commit is contained in:
2026-05-24 12:57:14 -04:00
parent e69b2eed34
commit 3736b7aaff
5 changed files with 33 additions and 58 deletions

15
LWGlass/.idea/.idea.LWGlass/.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,15 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/contentModel.xml
/.idea.LWGlass.iml
/modules.xml
/projectSettingsUpdater.xml
# Editor-based HTTP Client requests
/httpRequests/
# Ignored default folder with query files
/queries/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

@@ -1,5 +1,5 @@
ID: LWGlass ID: LWGlass
Name: LWGlass Name: LWGlass
Author: Astronand Author: Astronand
Version: 1.0.0 Version: 1.1.0
Priority: 0 Priority: 0

View File

@@ -15,11 +15,7 @@ using UnityEngine;
namespace LWGlass.Client namespace LWGlass.Client
{ {
public class Glass : public class Glass : CircuitBoard
ComponentClientCode<CircuitBoard.IData>,
IColorableClientCode,
IResizableX,
IResizableZ
{ {
[Setting_SliderFloat("LWGlass.Glass.GlassTransparency")] [Setting_SliderFloat("LWGlass.Glass.GlassTransparency")]
public static float GlassTransparency public static float GlassTransparency
@@ -61,7 +57,7 @@ namespace LWGlass.Client
} }
public string ColorsFileKey => "Boards"; public string ColorsFileKey => "Boards";
public float MinColorValue => 0; public float MinColorValue => 0;
/*
public int SizeX public int SizeX
{ {
get => Data.SizeX; get => Data.SizeX;
@@ -78,6 +74,7 @@ namespace LWGlass.Client
} }
public int MinZ => 1; public int MinZ => 1;
public int MaxZ => 80; public int MaxZ => 80;
*/
public float GridIntervalZ => 1f; public float GridIntervalZ => 1f;
protected Material setSharedMaterial() protected Material setSharedMaterial()
@@ -102,56 +99,7 @@ namespace LWGlass.Client
previousSizeZ = SizeZ; previousSizeZ = SizeZ;
obj.transform.localScale = new Vector3(SizeX, .5f, SizeZ) * 0.3f; obj.transform.localScale = new Vector3(SizeX, .5f, SizeZ) * 0.3f;
} }
protected override ChildPlacementInfo GenerateChildPlacementInfo()
{
ChildPlacementInfo childPlacementInfo = new ChildPlacementInfo();
childPlacementInfo.Points = new FixedPlacingPoint[SizeZ * SizeX * 2];
int i = 0;
for (int iX = 0; iX < SizeX; iX++)
{
for (int iZ = 0; iZ < SizeZ; iZ++)
{
childPlacementInfo.Points[i++] = new FixedPlacingPoint()
{
Position = new Vector3(iX, .5f, iZ),
UpDirection = new Vector3(0, 1, 0)
};
childPlacementInfo.Points[i++] = new FixedPlacingPoint()
{
Position = new Vector3(iX, 0, iZ),
UpDirection = new Vector3(0, -1, 0)
};
}
}
//for (int SX1 = 0; SX1 < SizeX; SX1++)
//{
// childPlacementInfo.Points[i++] = new FixedPlacingPoint()
// {
// Position = new Vector3(SX1, 0, -.3f ),
// UpDirection = new Vector3(0, 0, -1)
// };
// childPlacementInfo.Points[i++] = new FixedPlacingPoint()
// {
// Position = new Vector3(SX1, 0, SizeZ+.3f ),
// UpDirection = new Vector3(0, 0, 1)
// };
//}
//for (int SX1 = 0; SX1 < SizeZ; SX1++)
//{
// childPlacementInfo.Points[i++] = new FixedPlacingPoint()
// {
// Position = new Vector3(-.3f, 0, SX1 ),
// UpDirection = new Vector3(-1, 0, 0)
// };
// childPlacementInfo.Points[i++] = new FixedPlacingPoint()
// {
// Position = new Vector3(SizeX+.3f, 0, SX1 ),
// UpDirection = new Vector3(1, 0, 0)
// };
//}
return childPlacementInfo;
}
protected override IDecoration[] GenerateDecorations(Transform parentToCreateDecorationsUnder) protected override IDecoration[] GenerateDecorations(Transform parentToCreateDecorationsUnder)
{ {
var myGameObject = new GameObject("glass"); var myGameObject = new GameObject("glass");
@@ -167,7 +115,7 @@ namespace LWGlass.Client
new Decoration() new Decoration()
{ {
DecorationObject = myGameObject, DecorationObject = myGameObject,
LocalPosition = new Vector3(-.15f, 0, -.15f), LocalPosition = new Vector3(0,0,0),
AutoSetupColliders = true, AutoSetupColliders = true,
} }
}; };