113 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			113 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			C#
		
	
	
	
| 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(데뗌밖뀁);
 | ||
|     }
 | ||
| }
 |