少年修仙传客户端基础资源
dabaoji
2025-06-09 8ee0256378cbf5dbc9d76ed10b60b65a844ef4dd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using UnityEngine;
using UnityEditor;
using UnityEngine.UI;
static internal class MenuOptionsEx  {
    [MenuItem("GameObject/UI/NumKeyBoard")]
    public static void AddNumKeyBoard()
    {
        if (Selection.gameObjects == null || Selection.gameObjects.Length == 0) return;
        GameObject go = UILoader.LoadPrefab("NumKeyboard");
        go=GameObject.Instantiate(go);
        go.name = "NumKeyboard";
        Text text = Selection.gameObjects[0].GetComponent<Text>();
        NumKeyBoard keyboard=go.GetComponent<NumKeyBoard>();
        if (keyboard != null) keyboard.targetText = text;
        go.transform.SetParent(Selection.gameObjects[0].transform);
        go.transform.localPosition = Vector3.zero;
        go.transform.localScale = Vector3.one;
    }
}