示例#1
0
        public static void OnNameplateRemoved(Nameplate nameplate, ExEntityLink link)
        {
            NameplateHook hook = link.GetComponent <NameplateHook>();

            if (hook != null)
            {
                NameplateHook.Destroy(hook);
            }
        }
示例#2
0
        public static void OnNameplateChanged(Nameplate nameplate, ExEntityLink link)
        {
            NameplateHook hook = link.Require <NameplateHook>();

            if (hook.name3d == null)
            {
                var prefab = Resources.Load <TextMeshPro>("Nameplate");
                hook.name3d = Instantiate(prefab, hook.transform.position, hook.transform.rotation);
                hook.name3d.transform.SetParent(hook.transform);
            }

            if (hook.nname != nameplate.name)
            {
                hook.nname       = nameplate.name;
                hook.name3d.text = hook.nname;
            }
        }