Program.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Runtime.CompilerServices;
  4. [assembly: InternalsVisibleTo("MBansheeEditor")]
  5. namespace BansheeEngine
  6. {
  7. class Program
  8. {
  9. static void Main()
  10. {
  11. SceneObject otherSO = new SceneObject("OtherSO");
  12. DbgComponent2 dbgComponent2 = otherSO.AddComponent<DbgComponent2>();
  13. dbgComponent2.a2 = 33;
  14. GUIElementStateStyle dbgStyle = new GUIElementStateStyle();
  15. SceneObject so = new SceneObject("TestSO");
  16. DbgComponent dbgComponent = so.AddComponent<DbgComponent>();
  17. dbgComponent.a = 5;
  18. dbgComponent.complex.someValue = 19;
  19. dbgComponent.complex.anotherValue = "AnotherValue";
  20. dbgComponent.otherComponent = dbgComponent2;
  21. dbgComponent.otherSO = otherSO;
  22. dbgComponent.zeArray = new int[5][][];
  23. for (int i = 0; i < dbgComponent.zeArray.Length; i++)
  24. {
  25. dbgComponent.zeArray[i] = new int[6][];
  26. for (int j = 0; j < dbgComponent.zeArray[i].Length; j++)
  27. dbgComponent.zeArray[i][j] = new int[7];
  28. }
  29. dbgComponent.zeArray[4][1][3] = 129;
  30. dbgTestComponentClone(so);
  31. for (int i = 0; i < so.GetNumChildren(); i++)
  32. {
  33. SceneObject childSO = so.GetChild(i);
  34. reportDbgValue(childSO.GetComponent<DbgComponent>().otherComponent.a2, childSO.GetComponent<DbgComponent>().zeArray[4][1][3], typeof(DbgComponent));
  35. }
  36. //Color newColor = Color.red;
  37. //dbgStyle.textColor = newColor;
  38. //Color myColor = dbgStyle.textColor;
  39. //dbgStyle.textColor = myColor;
  40. }
  41. [MethodImpl(MethodImplOptions.InternalCall)]
  42. private static extern void dbgTestComponentClone(SceneObject so);
  43. [MethodImpl(MethodImplOptions.InternalCall)]
  44. private static extern void reportDbgValue(int dbgVal, int dbgVal2, Type type);
  45. }
  46. }