using AX.MessageSystem; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ControlSetArea : MonoBehaviour { GameObject PolygonPlaneChild; GameObject PolyVerticeFather; private void Start() { GetComponent().onValueChanged.AddListener(ClearSetArea); GameObject PolygonPlane = GameObject.Find("Canvas/SetAreaPanel/PolygonPlaneBase").gameObject; PolygonPlaneChild = PolygonPlane.transform.Find("Plane").gameObject; PolyVerticeFather = GameObject.Find("Canvas/SetAreaPanel/PolyVerticeFather").gameObject; } public void ClearSetArea(bool flag) { if (!flag) { PolygonPlaneChild.SetActive(false); foreach (Transform child in PolyVerticeFather.transform) { child.gameObject.SetActive(false); GameObject.Find("Canvas").GetComponent().renderMode = RenderMode.ScreenSpaceCamera; } MessageDispatcher.SendMessage("DrewEnd", GetComponent().cloneObjType); } } }