E_ElecCompetition/Electrical_inspectionCompet.../Assets/Script/Interactive objects/LoaclInterObjectWatch.cs

113 lines
2.7 KiB
C#
Raw Blame History

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;
/// <summary>
/// 데뗌鞫刻놓迦貫零뵨麟깃
/// </summary>
public Vector3 showPosition;
public Vector3 showRot;
public Vector3 localscale=new Vector3 (1,1,1);
/// <summary>
/// 데뗌밖뀁돨UI썹충
/// </summary>
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() {
///<2F>냥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<RectTransform>().offsetMax = new Vector2(0, 0);
.GetComponent<RectTransform>().offsetMin = new Vector2(0, 0);
.transform.localEulerAngles = new Vector3(0, 0, 0);
.transform.localScale = new Vector3(1, 1, 1);
= GameObject.Find("LocalDestory").GetComponent<Button>();
///댔역<EB8C94>獗샙쫀쓸
PlayerCamera = GameObject.Find("PlayerCamera");
PlayerCamera.GetComponent<CameraFilterPack_Blur_GaussianBlur>().enabled = true;
///<2F>냥膠竟
clone = Instantiate(gameObject); ;
Destroy(clone.GetComponent<LoaclInterObjectWatch>());
if (clone.GetComponent<HighlightingSystem.Highlighter>()) {
Destroy(clone.GetComponent<HighlightingSystem.Highlighter>());
}
clone.transform.SetParent(Localwatch);
clone.transform.localPosition = showPosition;
clone.transform.localEulerAngles = showRot;
clone.transform.localScale = localscale;
if ( == true)
{
clone.AddComponent<KXScanOperator>();
}
clone.layer = 13;
.onClick.AddListener(desbutton);
}
/// <summary>
/// 饋쁑膠竟깻路零쫀쓸
/// </summary>
public void desbutton() {
PlayerCamera.GetComponent<CameraFilterPack_Blur_GaussianBlur>().enabled = false;
Destroy(clone.gameObject);
Destroy();
}
}