There’s a problem with my project and I am new in coding C#. Everytime I play/run the project on unity, it runs properly but then when I build it on my mobile phone (android), everytime I touch the drop down button, it doesn’t display the buttons under that drop down. Can anyone please help me to solve this? I tried searching solutions on the internet but I cant get the right solution. Thank you so much! Here’s my code:
using UnityEngine;
using UnityEngine.EventSystems;
using System.Collections;
public class Dropdown : MonoBehaviour
{
public RectTransform container;
public bool isOpen;
void Start ()
{
container = transform.Find ("Container").GetComponent<RectTransform>();
}
void Update ()
{
if (isOpen)
{
Vector3 scale = container.localScale;
scale.y = Mathf.Lerp (scale.y, 1, Time.deltaTime * 12);
container.localScale = scale;
}
else
{
Vector3 scale = container.localScale;
scale.y = Mathf.Lerp (scale.y, 0, Time.deltaTime * 12);
container.localScale = scale;
}
}
void OnMouseDown()
{
isOpen = true;
}
void OnMouseUp()
{
isOpen = false;
}
}