105 lines
2.3 KiB
C#
105 lines
2.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
using UnityEngine.Events;
|
|
using System;
|
|
|
|
public class ToolsButton_click_count : MonoBehaviour
|
|
{
|
|
public string[] 밑균膠竟;
|
|
public string[] 역폘膠竟;
|
|
public string 뚤壇묏야;
|
|
// public string[] 뇰랙렘랬;
|
|
|
|
/// <summary>
|
|
/// 객큐속潼鹿빈왠齡膠竟역폘밑균돨렘랬
|
|
/// </summary>
|
|
//[SerializeField]
|
|
// private UnityEvent events;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
GetComponent<Button>().onClick.AddListener(onclick);
|
|
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
public void Fangfa() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
public void onclick() {
|
|
GameObject.Find("묏야芎충겼").SetActive(false);
|
|
var load = Resources.Load("Prefab/Tools/"+ 뚤壇묏야);
|
|
GameObject 묏야 = Instantiate(load) as GameObject;
|
|
묏야.transform.SetParent(GameObject.Find("Tools").transform);
|
|
묏야.transform.localScale = new Vector3(1, 1, 1);
|
|
묏야.transform.localPosition = 묏야.GetComponent<Tool_objects_base>().inHandPos;
|
|
묏야.transform.localEulerAngles = 묏야.GetComponent<Tool_objects_base>().inHandRot;
|
|
|
|
|
|
var load2 = Resources.Load("Prefab/Tools/묏야澗폅객큐");
|
|
GameObject 묏야으왠齡객큐 = Instantiate(load2) as GameObject;
|
|
묏야으왠齡객큐.transform.SetParent(GameObject.Find("묏야澗쀼객큐북섞").transform);
|
|
묏야으왠齡객큐.GetComponent<ToolsReceive_UICount>().toolgo = 묏야;
|
|
|
|
|
|
//events?.Invoke();
|
|
GameObject[] gameObjects = Resources.FindObjectsOfTypeAll<GameObject>();
|
|
|
|
|
|
for (int i = 0; i < 밑균膠竟.Length; i++)
|
|
{
|
|
for (int g = 0; g < gameObjects.Length; g++)
|
|
{
|
|
|
|
if (gameObjects[g].name == 밑균膠竟[i])
|
|
{
|
|
|
|
|
|
gameObjects[g].SetActive(false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
for (int i = 0; i < 역폘膠竟.Length; i++)
|
|
{
|
|
for (int g = 0; g < gameObjects.Length; g++)
|
|
{
|
|
|
|
if (gameObjects[g].name == 역폘膠竟[i])
|
|
{
|
|
|
|
|
|
gameObjects[g].SetActive(true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|