49 lines
1.1 KiB
C#
49 lines
1.1 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
|
|
public class GameManager : MonoBehaviour
|
|
{
|
|
public static GameManager ins;
|
|
public CameraManager CameraManager;
|
|
List<GameObject> tools;
|
|
[SerializeField] GameObject g1;
|
|
char[] g2 = new char[7] {'(','C','l','o','n','e',')' };
|
|
public void Awake()
|
|
{
|
|
if (ins!=null)
|
|
{
|
|
Destroy(ins);
|
|
return;
|
|
}
|
|
ins = this;
|
|
}
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
ToolsShow(g1);
|
|
}
|
|
/// <summary>
|
|
/// ¹¤¾ßÉú³É·½·¨
|
|
/// </summary>
|
|
public void ToolsShow(GameObject tools)
|
|
{
|
|
GameObject temp = Instantiate(tools);
|
|
string name = Filter(temp.name,g2);
|
|
Debug.Log(name);
|
|
switch (temp.name)
|
|
{
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
public string Filter(string str, char[] charsToRemove)
|
|
{
|
|
return String.Concat(str.Split(charsToRemove.ToArray()));
|
|
}
|
|
}
|