Josh Engebretson 10 years ago
parent
commit
cb07d75e56
2 changed files with 27 additions and 0 deletions
  1. 21 0
      Build/AtomicSharp/AtomicEngine.cs
  2. 6 0
      Build/AtomicSharp/AtomicSharpTest/Program.cs

+ 21 - 0
Build/AtomicSharp/AtomicEngine.cs

@@ -108,6 +108,14 @@ namespace AtomicEngine
 
 	}
 
+	public partial class Node : Animatable
+	{
+		public T GetComponent<T> (bool recursive  = false) where T:Component
+		{
+			return (T) GetComponent (typeof(T).Name, recursive);
+		}
+		
+	}
 
 	static class NativeCore
 	{
@@ -222,6 +230,19 @@ namespace AtomicEngine
 	[StructLayout (LayoutKind.Sequential, CharSet = CharSet.Ansi)]
 	public struct Color
 	{
+		public Color (float r, float g, float b, float a = 1.0f)
+		{
+			this.r = r;
+			this.g = g;
+			this.b = b;
+			this.a = a;
+		}
+
+		public float r;
+		public float g;
+		public float b;
+		public float a;
+
 	}
 
 	[StructLayout (LayoutKind.Sequential, CharSet = CharSet.Ansi)]

+ 6 - 0
Build/AtomicSharp/AtomicSharpTest/Program.cs

@@ -10,6 +10,12 @@ class MyGame
 
 		player.LoadScene ("Scenes/Scene.scene");		
 
+		var scene = player.CurrentScene;
+
+		var zone = scene.GetComponent <Zone> (true);
+
+		zone.SetAmbientColor( new Color(1, 0, 0) );
+
 		Atomic.Run ();
 
 	}