This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

C# API Reference

Most functions and classes in C# API have the same names and behavior as in C++ API. The main specific features of C# API are the following:

  • Names of all methods in C# start with a capital letter.
  • All C++ setters and getters are represented by properties in C#.
  • In the C# API, you can inherit from Package and Plugin classes only once.

Special Aspects of Pointers#

You should take into account that each class of C# API has methods for managing pointers:

  • IntPtr GetPtr(); — returns the internal pointer.
  • bool IsValidPtr { get; } — returns false if the native object has been destroyed.
  • bool IsNullPtr { get; } — returns true if the native object has been destroyed.
  • void DeleteLater(); — destroys the native object.

Pointers are managed in the same way as in C++.

Differences in Function Exporting#

To export your function from C# to UnigineScript, you should use Interpreter.Function() with different postfixes instead of MakeExternFunction(). The postfix of Function shows the number of arguments (up to 8 arguments) and the type of return value:

  • no postfix - void.
  • i - int.
  • d - double.
  • f - float.
  • s - string.
  • v - Unigine.Variable (the same class as the C++ API Unigine::Variable class).

See also an example of function exporting.

View Documentation by Using Visual Studio#

You can read the documentation of some C# API methods by using the Object Browser in Visual Studio.

  1. In Visual Studio, click View -> Object Browser or press CTRL + W and then J.

    The Object Browser window will open. The Object Browser displays three panes: the Objects pane on the left, the Members pane on the top right, and the Description pane on the bottom right.

  2. Select the UnigineSharp_x64d object in the Object pane and choose the class you want to view.

  3. Specify the member in the Members pane.
  4. If the description for the selected member exists, it will appear in the Description pane.

See Also#

Last update: 03.02.2021
Build: ()