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 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); } /// /// 工具生成方法 /// 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())); } }