using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MainScript : MonoBehaviour {
string[] str;
static List<string > strTag = new List<string >();
public static void RayScacs()
{
if(Input .GetMouseButtonDown(0))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit[] hits;
hits = Physics.RaycastAll(ray, 1000f);
string[] str = new string[hits.Length];
for (int i = 0; i < hits.Length; i++)
{
str[i] = hits[i].transform.name;
}
if(hits .Length != 0)
{
strTag = new List<string>(str);
}
}
if(Input .GetMouseButtonUp(0))
{
strTag.Clear();
}
}
public static bool cunzai(string name)
{
bool bo = strTag.Contains(name);
return bo;
}
}