using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using CommonScript;
public class LoaclInterObjectWatch : MonoBehaviour
{
private Transform Localwatch;
private GameObject clone;
public bool 是否旋转 = true;
///
/// 单独显示初始位置和坐标
///
public Vector3 showPosition;
public Vector3 showRot;
public Vector3 localscale=new Vector3 (1,1,1);
///
/// 单独观察的UI界面
///
private GameObject 单独观察;
Button 关闭按钮;
Transform MAINui;
GameObject PlayerCamera;
// Start is called before the first frame update
void Start()
{
Localwatch = GameObject.Find("Localwatch").transform;
EventTriggerListener.Get(gameObject).onClick += g =>
{
onClick();
};
//onClick();
}
// Update is called once per frame
void Update()
{
}
public void onClick() {
///生成UI
MAINui = GameObject.Find("MainUI").transform;
var load = Resources.Load("Prefab/单独观察");
单独观察 = Instantiate(load) as GameObject;
单独观察.transform.SetParent(MAINui);
单独观察.transform.localPosition = new Vector3(0, 0, 0);
单独观察.GetComponent().offsetMax = new Vector2(0, 0);
单独观察.GetComponent().offsetMin = new Vector2(0, 0);
单独观察.transform.localEulerAngles = new Vector3(0, 0, 0);
单独观察.transform.localScale = new Vector3(1, 1, 1);
关闭按钮 = GameObject.Find("LocalDestory").GetComponent