113 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			113 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			C#
		
	
	
	
| using System.Collections;
 | |
| using System.Collections.Generic;
 | |
| using UnityEngine;
 | |
| using UnityEngine.UI;
 | |
| public class GameManager_Tools : MonoBehaviour
 | |
| {
 | |
|     public List<Tools_object_UI> tool_Objects_UI = new List<Tools_object_UI>();
 | |
|     public GameObject target;
 | |
|     //public Button button;
 | |
|     public GameObject 묏야충겼_content;
 | |
|     public List<Tools_object_UI> 攣횅묏야;
 | |
|     //[HideInInspector]
 | |
|     public string toolsname;
 | |
|     private int 묏야朞嶝돤롸 = 0;
 | |
|     // Start is called before the first frame update
 | |
|     void Start()
 | |
|     {
 | |
|         
 | |
|        
 | |
|         
 | |
|         // button.onClick.AddListener(change_toolsbutton);
 | |
|     }
 | |
| 
 | |
|     // Update is called once per frame
 | |
|     void Update()
 | |
|     {
 | |
|         
 | |
|     }
 | |
|     public void Remove_tool_Objects_Base(GameObject gameObject) 
 | |
|     {
 | |
|         tool_Objects_UI.Remove(gameObject.GetComponent<Tools_object_UI>());
 | |
| 
 | |
| 
 | |
|     }
 | |
|     public void change_toolsbutton() {
 | |
|         if (묏야충겼_content == null)
 | |
|         {
 | |
| 
 | |
|             묏야충겼_content = GameObject.Find("Don'Destory").GetComponent<HoldToolsCheck>().묏야충겼;
 | |
| 
 | |
| 
 | |
| 
 | |
|         }
 | |
|         var load =  Resources.Load("Prefab/묏야객큐");
 | |
|         GameObject 묏야객큐 = Instantiate(load) as GameObject;
 | |
|         묏야객큐.transform.SetParent(묏야충겼_content.transform);
 | |
|         tool_Objects_UI.Add(묏야객큐.GetComponent<Tools_object_UI>());
 | |
|         묏야객큐.transform.localScale = new Vector3(1, 1, 1);
 | |
|         묏야객큐.transform.localPosition = new Vector3(0, 0, 0);
 | |
|         묏야객큐.transform.localEulerAngles = new Vector3(0, 0, 0);
 | |
|        // 묏야객큐.GetComponent<Tools_object_UI>().sprite_name = toolsname;
 | |
|         묏야객큐.GetComponent<Tools_object_UI>().targetobject = target;
 | |
|         target = null;
 | |
|        // Debug.Log(묏야객큐.GetComponent<Tools_object_UI>().sprite_name);
 | |
|         묏야객큐.GetComponent<Tools_object_UI>().UI_name = toolsname;
 | |
|         묏야객큐.GetComponent<Tools_object_UI>().change();
 | |
| 
 | |
|     }
 | |
|     public void Reload() {
 | |
| 
 | |
|         
 | |
|     
 | |
|     
 | |
|     }
 | |
|     public void fenshu_check() {
 | |
| 
 | |
| 
 | |
| 
 | |
|         for (int i = 0; i < 攣횅묏야.Count; i++)
 | |
|         {
 | |
|             for (int g = 0; g < tool_Objects_UI.Count; g++)
 | |
|             {
 | |
|                 if (tool_Objects_UI[g] = 攣횅묏야[i])
 | |
| 
 | |
|                 { 
 | |
|                     
 | |
|                     묏야朞嶝돤롸 += 1; 
 | |
|                 
 | |
|                 
 | |
|                 
 | |
|                 
 | |
|                 }
 | |
|             }
 | |
| 
 | |
| 
 | |
| 
 | |
|         }
 | |
| 
 | |
|         for (int i = 0; i < tool_Objects_UI.Count; i++)
 | |
|         {
 | |
| 
 | |
|             GameObject.Find("Don'Destory").GetComponent<HoldToolsCheck>().넣唐묏야.Add(tool_Objects_UI[i].UI_name);
 | |
| 
 | |
| 
 | |
|         }
 | |
|        
 | |
|       
 | |
|         if (GameObject.Find("Don'Destory").GetComponent<HoldToolsCheck>().綠돤롸 == false)
 | |
|         {
 | |
|             GameObject.Find("Don'Destory").GetComponent<HoldToolsCheck>().묏야朞嶝돤롸 = 묏야朞嶝돤롸;
 | |
|             GameObject.Find("Don'Destory").GetComponent<HoldToolsCheck>().綠돤롸 = true;
 | |
| 
 | |
|         }
 | |
|     }
 | |
|     public void ResToolsUI()
 | |
|     { 
 | |
|     
 | |
|     
 | |
|     
 | |
|     
 | |
|     }
 | |
| }
 |