Adding a ton of materials and textures, and adding terrain!

This commit is contained in:
Matt F 2026-05-26 23:59:57 -07:00
parent 3568936359
commit a911d0f13e
784 changed files with 32877 additions and 707 deletions

View file

@ -0,0 +1,43 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 12146, guid: 0000000000000000e000000000000000, type: 0}
m_Name: NewBrush
m_EditorClassIdentifier: UnityEditor.dll::UnityEditor.Brush
m_Mask: {fileID: 10307, guid: 0000000000000000f000000000000000, type: 0}
m_Falloff:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 1
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_RadiusScale: 1.4849247
m_BlackWhiteRemapMin: 0
m_BlackWhiteRemapMax: 1
m_InvertRemapRange: 0

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bc72e6111abbe4a4ab43da679d4bd9a5
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -103,16 +103,15 @@ namespace TD.Gameplay
public override void OnNetworkSpawn()
{
if (IsServer)
if (Instance != null && Instance != this)
{
if (Instance != null && Instance != this)
{
Debug.LogError("[TowerPlacementManager] Multiple instances detected. " +
"Only one TowerPlacementManager should exist per scene.");
}
Instance = this;
Debug.Log("[TowerPlacementManager] Server ready.");
Debug.LogError("[TowerPlacementManager] Multiple instances detected. " +
"Only one TowerPlacementManager should exist per scene.");
}
Instance = this;
if (IsServer)
Debug.Log("[TowerPlacementManager] Server ready.");
}
public override void OnNetworkDespawn()

View file

@ -48,6 +48,10 @@ namespace TD.UI
private Button joinButton;
private Button quitButton;
private Button quickStartButton;
private VisualElement hostPanel;
private TextField hostPortField;
private Button hostConfirmButton;
private Button hostCancelButton;
private VisualElement joinPanel;
private TextField joinAddressField;
private TextField joinPortField;
@ -109,6 +113,42 @@ namespace TD.UI
buttonColumn.Add(quitButton);
buttonColumn.Add(quickStartButton);
// Host sub-panel — hidden until Host is clicked. Holds the port field
// and the Start Host / Cancel buttons.
hostPanel = new VisualElement();
hostPanel.style.flexDirection = FlexDirection.Column;
hostPanel.style.alignItems = Align.Center;
hostPanel.style.marginTop = 24;
hostPanel.style.paddingTop = 16;
hostPanel.style.paddingBottom = 16;
hostPanel.style.paddingLeft = 24;
hostPanel.style.paddingRight = 24;
hostPanel.style.backgroundColor = new Color(0f, 0f, 0f, 0.4f);
hostPanel.style.display = DisplayStyle.None;
root.Add(hostPanel);
hostPortField = new TextField("Port");
hostPortField.value = defaultPort.ToString();
hostPortField.style.width = 280;
StyleJoinFieldText(hostPortField);
hostPanel.Add(hostPortField);
var hostButtons = new VisualElement();
hostButtons.style.flexDirection = FlexDirection.Row;
hostButtons.style.marginTop = 12;
hostPanel.Add(hostButtons);
hostConfirmButton = new Button(OnHostConfirmClicked) { text = "Start Host" };
hostConfirmButton.style.minWidth = 120;
hostConfirmButton.style.height = 32;
hostConfirmButton.style.marginRight = 8;
hostButtons.Add(hostConfirmButton);
hostCancelButton = new Button(OnHostCancelClicked) { text = "Cancel" };
hostCancelButton.style.minWidth = 120;
hostCancelButton.style.height = 32;
hostButtons.Add(hostCancelButton);
// Join sub-panel — hidden until Join is clicked. Holds the IP+port
// fields and the Connect / Cancel buttons.
joinPanel = new VisualElement();
@ -187,19 +227,37 @@ namespace TD.UI
private void OnHostClicked()
{
statusLabel.text = "Starting host…";
if (!NetworkBootstrap.StartHost(defaultPort))
hostPanel.style.display = hostPanel.style.display == DisplayStyle.None
? DisplayStyle.Flex
: DisplayStyle.None;
}
private void OnHostConfirmClicked()
{
ushort port = defaultPort;
if (!string.IsNullOrWhiteSpace(hostPortField.value)
&& ushort.TryParse(hostPortField.value.Trim(), out var parsed))
{
port = parsed;
}
statusLabel.text = $"Starting host on port {port}…";
if (!NetworkBootstrap.StartHost(port))
{
statusLabel.text = "Failed to start host. Check the console.";
return;
}
// After StartHost the local peer is the server + client. Trigger
// the networked scene load to take everyone to the Lobby. NGO
// replicates this to any future-joining clients automatically.
hostPanel.style.display = DisplayStyle.None;
NetworkBootstrap.LoadSceneAsHost(SceneNames.Lobby);
}
private void OnHostCancelClicked()
{
hostPanel.style.display = DisplayStyle.None;
statusLabel.text = string.Empty;
}
private void OnJoinClicked()
{
// Toggle the join sub-panel.