public void DropPassanger() { if (selected) { selected.gameObject.SetActive(true); selected = null; Destroy(moveOne); moveOne = null; } }
public void OnPassengerClicked(PointerEventData eventData, DPassenger psg) { if (!selected && psg.IsClicked(eventData)) { selected = psg; this.moveOne = GameObject.Instantiate(selected.gameObject); moveOne.transform.parent = this.transform; selected.gameObject.SetActive(false); moveOne.GetComponent <RectTransform>().pivot = new Vector2(0.5f, 0.5f); } else { DropPassanger(); } }