Modding:Advanced Items/ru: Difference between revisions

From Vintage Story Wiki
(Created page with "<syntaxhighlight lang="c#"> public class TunnlerMod : ModSystem { } </syntaxhighlight>")
(Created page with "Переопределив метод <code>Start(ICoreAPI)</code>, мы можем зарегистрировать наш класс. Функция <code>RegisterItemClass</code> имеет два параметра: первый - идентификатор класса элемента, поскольку именно так мы будем ссылаться на этот класс в наших json-файлах itemtype. Убедитесь, что он иден...")
Tags: Mobile edit Mobile web edit
Line 37: Line 37:
</syntaxhighlight>
</syntaxhighlight>


<div lang="en" dir="ltr" class="mw-content-ltr">
Переопределив метод <code>Start(ICoreAPI)</code>, мы можем зарегистрировать наш класс. Функция <code>RegisterItemClass</code> имеет два параметра: первый - идентификатор класса элемента, поскольку именно так мы будем ссылаться на этот класс в наших json-файлах itemtype. Убедитесь, что он идентичен классу, который мы указали в нашем предыдущем файле активов. Второй параметр - тип нашего элемента класса.
By overriding the <code>Start(ICoreAPI)</code> method, we can register our class. The <code>RegisterItemClass</code> function has two parameters: the first is our item class ID, noteably this is how we link to this class in our itemtype json files. Ensure that this is identical to the class we specified in our earlier asset file. The second parameter is the type of our item class.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">