You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.1 KiB
33 lines
1.1 KiB
4 years ago
|
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<Toggle>().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<Canvas>().renderMode = RenderMode.ScreenSpaceCamera;
|
||
|
}
|
||
|
MessageDispatcher.SendMessage("DrewEnd", GetComponent<UICloneType>().cloneObjType);
|
||
|
}
|
||
|
}
|
||
|
}
|