Program.cs 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.b = "SomeTestVal";
  19. dbgComponent.complex.someValue = 19;
  20. dbgComponent.complex.anotherValue = "AnotherValue";
  21. dbgComponent.complex2.someValue2 = 21;
  22. dbgComponent.complex2.anotherValue2 = "AnotherValue2";
  23. dbgComponent.otherComponent = dbgComponent2;
  24. dbgComponent.otherSO = otherSO;
  25. //dbgComponent.zeArray = new int[5][][];
  26. //dbgComponent.zeList = new List<DbgSerzObj>();
  27. //dbgComponent.zeDict = new Dictionary<string, int>();
  28. //dbgComponent.zeList.Add(new DbgSerzObj());
  29. //dbgComponent.zeList.Add(new DbgSerzObj());
  30. //dbgComponent.zeList.Add(new DbgSerzObj(101, ""));
  31. //dbgComponent.zeList.Add(new DbgSerzObj());
  32. //dbgComponent.zeDict["supSup"] = 10001;
  33. //dbgComponent.zeDict["lolz"] = 696969;
  34. //var enumerator = dbgComponent.zeDict.GetEnumerator();
  35. //int all = 0;
  36. //while (enumerator.MoveNext())
  37. //{
  38. // all += enumerator.Current.Value;
  39. //}
  40. //for (int i = 0; i < dbgComponent.zeArray.Length; i++)
  41. //{
  42. // dbgComponent.zeArray[i] = new int[6][];
  43. // for (int j = 0; j < dbgComponent.zeArray[i].Length; j++)
  44. // dbgComponent.zeArray[i][j] = new int[7];
  45. //}
  46. //dbgComponent.zeArray[4][1][3] = 129;
  47. dbgTestComponentClone(so);
  48. for (int i = 0; i < so.GetNumChildren(); i++)
  49. {
  50. SceneObject childSO = so.GetChild(i);
  51. DbgComponent otherComponent = childSO.GetComponent<DbgComponent>();
  52. reportDbgValue(otherComponent.a, otherComponent.b, otherComponent.complex.someValue,
  53. otherComponent.complex2.anotherValue2);
  54. //reportDbgValue(childSO.GetComponent<DbgComponent>().zeDict["lolz"], childSO.GetComponent<DbgComponent>().zeList[2].someValue, childSO.GetComponent<DbgComponent>().zeArray[4][1][3], typeof(DbgComponent));
  55. }
  56. //Color newColor = Color.red;
  57. //dbgStyle.textColor = newColor;
  58. //Color myColor = dbgStyle.textColor;
  59. //dbgStyle.textColor = myColor;
  60. }
  61. [MethodImpl(MethodImplOptions.InternalCall)]
  62. private static extern void dbgTestComponentClone(SceneObject so);
  63. [MethodImpl(MethodImplOptions.InternalCall)]
  64. private static extern void reportDbgValue(int a, string b, int a2, string b2);
  65. }
  66. }