/// <summary>
 /// Get or create manager handle (the part in CPP side).
 /// </summary>
 /// <returns>Scene handle.</returns>
 internal IntPtr GetOrCreateHandle()
 {
     if (_handle == IntPtr.Zero)
     {
         _InitializeCbHandle = _Initialize;
         _StartCbHandle      = _Start;
         _DisposeCbHandle    = _Dispose;
         _UpdateCbHandle     = _Update;
         _handle             = _BonEngineBind.BON_Manager_Create(_InitializeCbHandle, _StartCbHandle, _DisposeCbHandle, _UpdateCbHandle, Id);
     }
     return(_handle);
 }
 /// <summary>
 /// Dispose the manager.
 /// </summary>
 public void Dispose()
 {
     if (_handle != IntPtr.Zero)
     {
         _Dispose();
         _BonEngineBind.BON_Manager_Destroy(_handle);
         _InitializeCbHandle = null;
         _StartCbHandle      = null;
         _DisposeCbHandle    = null;
         _UpdateCbHandle     = null;
         _handle             = IntPtr.Zero;
     }
 }
Example #3
0
 /// <summary>
 /// Destroy this scene.
 /// Do not call this on the active scene! You don't need to call this, it will be called automatically.
 /// </summary>
 public void Dispose()
 {
     if (_handle != IntPtr.Zero)
     {
         Log.Info($"[C#] Scene '{SceneName}' is being disposed.");
         _BonEngineBind.BON_Scene_Destroy(_handle);
         _LoadCbHandle        = null;
         _UnloadCbHandle      = null;
         _StartCbHandle       = null;
         _DrawCbHandle        = null;
         _UpdateCbHandle      = null;
         _FixedUpdateCbHandle = null;
     }
 }
Example #4
0
 /// <summary>
 /// Get or create scene handle (the part in CPP side).
 /// </summary>
 /// <returns>Scene handle.</returns>
 internal IntPtr GetOrCreateHandle()
 {
     if (_handle == IntPtr.Zero)
     {
         _LoadCbHandle        = _Load;
         _UnloadCbHandle      = _Unload;
         _StartCbHandle       = _Start;
         _DrawCbHandle        = _Draw;
         _UpdateCbHandle      = _Update;
         _FixedUpdateCbHandle = _FixedUpdate;
         _handle = _BonEngineBind.BON_Scene_Create(
             _LoadCbHandle,
             _UnloadCbHandle,
             _StartCbHandle,
             _DrawCbHandle,
             _UpdateCbHandle,
             _FixedUpdateCbHandle);
     }
     return(_handle);
 }