(client) feat:右键菜单全局与UI分离,Building生成支持,双层地图重写
This commit is contained in:
36
Client/Assets/Scripts/Entity/Building.cs
Normal file
36
Client/Assets/Scripts/Entity/Building.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using Base;
|
||||
using Data;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Entity
|
||||
{
|
||||
public class Building:Entity
|
||||
{
|
||||
public override void SetTarget(Vector3 pos)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void UpdatePlayerControls()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.W))
|
||||
{
|
||||
transform.position += Vector3.up;
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.A))
|
||||
{
|
||||
transform.position += Vector3.left;
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.S))
|
||||
{
|
||||
transform.position += Vector3.down;
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.D))
|
||||
{
|
||||
transform.position += Vector3.right;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/Entity/Building.cs.meta
Normal file
3
Client/Assets/Scripts/Entity/Building.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ea66d65f9414d18988cbdc1a322e334
|
||||
timeCreated: 1754650409
|
@ -1,10 +0,0 @@
|
||||
namespace Entity
|
||||
{
|
||||
public class BuildingBase:Entity
|
||||
{
|
||||
public override void TryMove()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb881a08fe004eb4ab0a6fa9d5d86d33
|
||||
timeCreated: 1753100586
|
@ -1,12 +0,0 @@
|
||||
using Data;
|
||||
|
||||
namespace Entity
|
||||
{
|
||||
public class BuildingEntity:Entity
|
||||
{
|
||||
void Init(BuildingDef def)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 703125e2813a463d9b714841a3f9995f
|
||||
timeCreated: 1753702932
|
@ -214,7 +214,7 @@ namespace Entity
|
||||
currentJob.Update();
|
||||
}
|
||||
|
||||
private void UpdatePlayerControls()
|
||||
protected virtual void UpdatePlayerControls()
|
||||
{
|
||||
// 检测 Shift 键状态
|
||||
var isHoldingShift = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift);
|
||||
|
@ -90,7 +90,7 @@ namespace Entity
|
||||
// 检测是否按下的是鼠标右键
|
||||
if (Input.GetMouseButtonDown(1)) // 鼠标右键对应的是按钮索引 1
|
||||
{
|
||||
var rightMenu = Prefab.RightMenuPrefab.Instance;
|
||||
var rightMenu = Base.RightMenu.Instance;
|
||||
rightMenu.Init(GetMenu());
|
||||
rightMenu.transform.position = Input.mousePosition;
|
||||
rightMenu.Show();
|
||||
|
Reference in New Issue
Block a user