
Ecran de sélection ok. Bug de latence trop peu importante sur la capture des entrées Reste surement deux trois bugs
40 lines
734 B
C#
40 lines
734 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.EventSystems;
|
|
|
|
public class StayFocusBehavior : MonoBehaviour
|
|
{
|
|
private Transform currentSelection;
|
|
|
|
// Use this for initialization
|
|
void Start()
|
|
{
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
}
|
|
|
|
private void AlignIconWithButton(Transform transform)
|
|
{
|
|
var script = transform.GetComponent<MenuButtonBehavior>();
|
|
if (script != null)
|
|
{
|
|
script.AlignIcon();
|
|
}
|
|
}
|
|
|
|
public void OnRenderObject()
|
|
{
|
|
AlignIconWithButton(currentSelection);
|
|
}
|
|
|
|
public void OnButtonSelected(Transform btn)
|
|
{
|
|
currentSelection = btn;
|
|
}
|
|
|
|
}
|