SerializedSceneObject.generated.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //************** Copyright (c) 2016-2019 Marko Pintera ([email protected]). All rights reserved. *******************//
  3. using System;
  4. using System.Runtime.CompilerServices;
  5. using System.Runtime.InteropServices;
  6. using bs;
  7. namespace bs.Editor
  8. {
  9. /** @addtogroup Utility-Editor
  10. * @{
  11. */
  12. /// <summary>
  13. /// Serializes the current state of a scene object and allows that state to be restored. The advantage of using this
  14. /// class versus normal serialization is that the deserialization happens into the original scene object, instead of
  15. /// creating a new scene object.
  16. /// </summary>
  17. [ShowInInspector]
  18. public partial class SerializedSceneObject : ScriptObject
  19. {
  20. private SerializedSceneObject(bool __dummy0) { }
  21. protected SerializedSceneObject() { }
  22. /// <summary>Serializes the current state of the provided scene object.</summary>
  23. /// <param name="sceneObject">Object whose state to serialize.</param>
  24. /// <param name="hierarchy">
  25. /// If true all children of the provided scene object will be serialized as well, otherwise just the provided object will.
  26. /// </param>
  27. public SerializedSceneObject(SceneObject sceneObject, bool hierarchy = false)
  28. {
  29. Internal_SerializedSceneObject(this, sceneObject, hierarchy);
  30. }
  31. /// <summary>
  32. /// Restores the scene object to the state as it was when this object was created. If the scene object was deleted since
  33. /// it will be resurrected.
  34. /// </summary>
  35. public void Restore()
  36. {
  37. Internal_restore(mCachedPtr);
  38. }
  39. [MethodImpl(MethodImplOptions.InternalCall)]
  40. private static extern void Internal_SerializedSceneObject(SerializedSceneObject managedInstance, SceneObject sceneObject, bool hierarchy);
  41. [MethodImpl(MethodImplOptions.InternalCall)]
  42. private static extern void Internal_restore(IntPtr thisPtr);
  43. }
  44. /** @} */
  45. }