using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class SchGame_DropControl : MonoBehaviour, IDropHandler { public Color thisColor; bool haveSet = false; public int indexDay; // Start is called before the first frame update void Start() { transform.Find("NameDay").GetComponentInChildren().color = thisColor; transform.Find("Outline").GetComponentInChildren().color = thisColor; } public void OnDrop(PointerEventData data) { if (!haveSet) { SchGame_DragControl temp = data.pointerDrag.GetComponent(); temp.startingPos = transform.Find("InLine").position; temp.havebeenSet = true; haveSet = true; temp.transform.parent = transform; temp.transform.SetSiblingIndex(2); temp.GetComponent().sizeDelta = new Vector2(250, 55); SchGame_Speach speach = SchGame_Speach.instance; switch (indexDay) { case 0: speach.monday = temp.className; break; case 1: speach.tuesday = temp.className; break; case 2: speach.wednesday = temp.className; break; case 3: speach.thursday = temp.className; break; case 4: speach.friday = temp.className; break; } speach.RefreshText(); } } }