zlua-lua-call-csharp
/zlua-lua-call-csharp
Wywołuje C# z Lua przez korzeń CSharp: tworzy obiekty, czyta i zapisuje składowe, pola, właściwości i zdarzenia.
- Autor
- killop ↗
- Repozytorium
- unity-mcp ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 02.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 02.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Wywołuje C# z Lua przez korzeń CSharp: tworzy obiekty, czyta i zapisuje składowe, pola, właściwości i zdarzenia.
Oryginalny opis (EN)
Calls C# from Lua through the CSharp root: assemblies, types, constructors, static and instance members, fields, properties, and events. Use when writing Lua that touches CSharp, constructs a C# object, or reads and writes C# members.
Jak działa
- Types
- Members
- Events
- Related skills
Podgląd SKILL.md
--- name: zlua-lua-call-csharp description: >- Calls C# from Lua through the CSharp root: assemblies, types, constructors, static and instance members, fields, properties, and events. Use when writing Lua that touches CSharp, constructs a C# object, or reads and writes C# members. --- # Lua calls C# Access public types through the global `CSharp` table. Types bind lazily on first access. A missing member is an error (`zlua: member not found`), not `nil`. There is no runtime walk of the inheritance chain; base members are flattened onto the type at bind time. ## Types ```lua CSharp['AC'] = CSharp['Assembly-CSharp'] local Demo = CSharp.AC.Demo local Panel = CSharp.AC['MyGame.UI.Panel'] -- dotted names need a string key local Nested = CSharp.AC['Outer+Nested'] -- nested types use + local Int32 = CSharp.mscorlib['System.Int32'] ``` Do not write `CSharp.AC.MyGame.UI.Panel`. Only public members are visible. Static and instance metadata are separate tables. ## Members ```lua CSharp.AC.Demo.Add(3, 5) -- static method CSharp.AC.Demo.s_x = 10 -- static field or parameterless property local demo = CSharp.AC.Demo() -- constructor demo:SetX(10) -- instance method; colon passes self demo.x = 20 -- public field or parameterless property print(demo.x) ``` | Syntax | Meaning | |--------|---------| | `Type.Add(a, b)` | Static method | | `Type.Field` / `Type.Prop` | Static field or parameterless property | | `obj:Method()` | Instance method | | `obj.field` | Instance field or parameterless property | Indexers (`this[int]`) dispatch as methods. Do not write `obj[i]` for them. Arrays are the exception; see `zlua-array`. `nil` maps to a reference-type `null`, and the reverse. A non-nullable struct cannot be `nil`. Subclass instances can call public instance members declared on a base type. Static members are reached through the declaring type's table. ## Events There is no event metatable and no `.get` / `.set` sugar. ```lua host:add_OnHealthChanged(onChanged) host:remove_OnHealthChanged(onChanged) -- same function reference ``` Static events use `Type.add_Foo(handler)`. The handler is a Lua function. If code expects `OnX.get`, replace that xLua-style sugar with `add_` / `remove_`. ## Related skills Overloads, default arguments, and signature keys: `zlua-method-overload`. `out` / `ref` / `in`: `zlua-in-ref-out`. Passing structs and marshal attributes: `zlua-marshal`.
Wersje
W bazie nie ma innych skilli o nazwie zlua-lua-call-csharp.
Migawka bazy z 13.11.2026 · wersja paczki 934b16325b34 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 95zlua-csharp-call-lua
Wywołuje Lua z C# przez LuaAppDomain i GetFunction, wiążąc metody modułów Lua z delegatami i przeładowując skrypty. - 95zlua-array
Tworzy i indeksuje tablice C# z poziomu Lua przy pomocy pomocników zlua, konwertując je do tabel i bajtów. - 92write-script-csharp
Prowadzi przez pisanie skryptów w C# zgodnie z konwencjami tej platformy. - 96csharp
Podaje wytyczne budowy aplikacji w C# dla plików .cs, od struktury kodu po obsługę błędów. - 81csharp-ko
Stosuje koreańskie zasady pisania kodu C# przy pracy z plikami .cs, wg konwencji autora jgkim999. - 100grandma3-lua-api
Pomaga pisać i debugować wtyczki oraz skrypty Lua dla grandMA3 z użyciem Object API, dialogów UI i struktury wtyczek XML.