using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; public class OnboardInstanceCtrl : DragIcon { CreaterType type; protected override void Update() { base.Update(); if (Input.GetMouseButtonDown(0)) { GetMouseRaycastAll(); for (int i = 0; i < results.Count; i++) { CarIconInstanceCtrl carInstance= results[i].gameObject.GetComponent(); if (carInstance) { carInstance.AddOnboardGO(text_IconName.text,type); Destroy(this.gameObject); return; } } } if (Input.GetMouseButtonDown(1)) { Destroy(this.gameObject); } } public override void SetUpdateIconMsg(object msg,string msgType="") { this.type = (CreaterType)msg ; } }