Fix hold point, radial menu UI need to be fixed
This commit is contained in:
@@ -10,8 +10,13 @@ public class RadialMenuItem : MonoBehaviour
|
||||
[SerializeField]
|
||||
private Button _radialMenuItemPrefab;
|
||||
private Dictionary<RadialMenuActions, RadialMenuActionDescription> _actions;
|
||||
UniTaskCompletionSource<RadialMenuActions> tcs = new UniTaskCompletionSource<RadialMenuActions>();
|
||||
private UniTaskCompletionSource<RadialMenuActions> tcs = new UniTaskCompletionSource<RadialMenuActions>();
|
||||
private float _buttonWidth;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_buttonWidth = _radialMenuItemPrefab.GetComponent<RectTransform>().rect.width;
|
||||
}
|
||||
|
||||
public UniTask<RadialMenuActions> ShowButtons(Dictionary<RadialMenuActions, RadialMenuActionDescription> actions)
|
||||
{
|
||||
@@ -25,14 +30,15 @@ public class RadialMenuItem : MonoBehaviour
|
||||
float posX = Mathf.Sin(theta);
|
||||
float posY = Mathf.Cos(theta);
|
||||
|
||||
button.transform.localPosition = new Vector3(posX, posY, 0) * 100f;
|
||||
button.transform.localPosition = new Vector3(posX, posY, 0) * 150f;
|
||||
|
||||
var textMeshPro = button.GetComponentInChildren<TextMeshProUGUI>();
|
||||
if (textMeshPro != null)
|
||||
{
|
||||
textMeshPro.text = actions.ElementAt(buttonsCount).Value.Description;
|
||||
}
|
||||
AddEvent(button, buttonsCount);
|
||||
|
||||
|
||||
}
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user