CSComponent.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Runtime.InteropServices;
  4. namespace AtomicEngine
  5. {
  6. public delegate void AtomicEventDelegate (VariantMap eventData);
  7. public partial class CSComponent : Component
  8. {
  9. public uint ManagedID;
  10. //public CSComponent ()
  11. //{
  12. // nativeInstance = NativeCore.RegisterNative (csb_Atomic_CSComponent_Constructor(), this);
  13. // ComponentCore.RegisterCSComponent (this);
  14. // }
  15. virtual public void Start()
  16. {
  17. }
  18. virtual public void Update(float timeStep)
  19. {
  20. }
  21. public void SendEvent(string eventType, Dictionary<string, object> eventData = null)
  22. {
  23. EventCore.SendEvent (this, eventType);
  24. }
  25. public void SubscribeToEvent(AObject sender, string eventType, AtomicEventDelegate function)
  26. {
  27. EventCore.SubscribeToEvent (this, sender, eventType, function);
  28. }
  29. public void SubscribeToEvent(string eventType, AtomicEventDelegate function)
  30. {
  31. EventCore.SubscribeToEvent (this, null, eventType, function);
  32. }
  33. //[DllImport (Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
  34. //private static extern IntPtr csb_Atomic_CSComponent_Constructor();
  35. }
  36. }