public void MoveSelection(GameObject what, bool nowEquipUI)
{
Debug.Log("Move selection " + what.name + " " + what.transform.localPosition + " " + what.transform.position);
if (nowEquipUI)
{
SelectMark.transform.position = new Vector3(what.transform.position.x - MarkXEquipUI,
what.transform.position.y, SelectMark.transform.position.z);
SelectBack.transform.position = new Vector3(what.transform.position.x,
what.transform.position.y, SelectBack.transform.position.z);
}
}
public void OnSelect(BaseEventData eventData)
{
SealManageUI.Instance.MoveSelection(gameObject, true);
}
Why this code not work at first time when each slot gameobject instantiated,
but works well when move selection by keyboard arrow up/down key after wrong placement?