(client) feat:右键菜单全局与UI分离,Building生成支持,双层地图重写
This commit is contained in:
@ -13,6 +13,9 @@ namespace UI
|
||||
|
||||
public NonReturnCallback currentAction;
|
||||
|
||||
public GameObject focusBox;
|
||||
public bool snapEnabled = false;
|
||||
|
||||
public string Prompt
|
||||
{
|
||||
get => promptText.text;
|
||||
@ -30,7 +33,28 @@ namespace UI
|
||||
{
|
||||
currentAction();
|
||||
}
|
||||
|
||||
if (snapEnabled)
|
||||
{
|
||||
focusBox.transform.position = Utils.MousePosition.GetSnappedWorldPosition();
|
||||
}
|
||||
else
|
||||
{
|
||||
focusBox.transform.position = Utils.MousePosition.GetWorldPosition();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override void Show()
|
||||
{
|
||||
base.Show();
|
||||
focusBox.SetActive(true);
|
||||
}
|
||||
|
||||
override public void Hide()
|
||||
{
|
||||
base.Hide();
|
||||
focusBox.SetActive(false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user