Adding tons of new functionality
Decals, ghost textures, placement functionality, builder stub ins, a new camera system, and more.
This commit is contained in:
parent
56dc775c68
commit
a63cce53e2
54 changed files with 4817 additions and 238 deletions
|
|
@ -0,0 +1,37 @@
|
|||
// Assets/_Project/Scripts/Gameplay/TowerPlacementTestTrigger.cs
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using TD.Towers;
|
||||
|
||||
namespace TD.Gameplay
|
||||
{
|
||||
/// <summary>
|
||||
/// TEMPORARY test helper. Press 1 to begin placing the assigned tower.
|
||||
/// Will be replaced by HUD tower buttons in a later path. Delete this script
|
||||
/// once the HUD is wired up.
|
||||
/// </summary>
|
||||
public class TowerPlacementTestTrigger : MonoBehaviour
|
||||
{
|
||||
[Tooltip("The TowerDefinition to place when '1' is pressed.")]
|
||||
[SerializeField] private TowerDefinition towerToPlace;
|
||||
|
||||
[Tooltip("The tower type ID. Must match the index of this TowerDefinition in " +
|
||||
"TowerPlacementManager.towerDefinitions[]. Default 1 (slot 0 is reserved).")]
|
||||
[SerializeField] private int towerTypeId = 1;
|
||||
|
||||
[Tooltip("The TowerPlacementController to drive.")]
|
||||
[SerializeField] private TowerPlacementController controller;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
var kb = Keyboard.current;
|
||||
if (kb == null || controller == null || towerToPlace == null) return;
|
||||
|
||||
if (kb.digit1Key.wasPressedThisFrame)
|
||||
{
|
||||
controller.BeginPlacement(towerToPlace, towerTypeId);
|
||||
Debug.Log($"[TestTrigger] BeginPlacement({towerToPlace.DisplayName}, id={towerTypeId})");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue