Kaynağa Gözat

Adding pure C# 2D project template

Josh Engebretson 9 yıl önce
ebeveyn
işleme
34a89e3c66

+ 0 - 0
Data/AtomicEditor/ProjectTemplates/Project2D/CSharp/Project2D.atomic


+ 15 - 0
Data/AtomicEditor/ProjectTemplates/Project2D/CSharp/Resources/Components/Spinner.cs

@@ -0,0 +1,15 @@
+using System;
+using AtomicEngine;
+
+public class Spinner : CSComponent
+{
+
+    [Inspector]
+    float speed = 1.0f;    
+
+    void Update(float timeStep)
+    {
+        Node.Roll(speed * timeStep * 75.0f);
+    }
+
+}

+ 5 - 0
Data/AtomicEditor/ProjectTemplates/Project2D/CSharp/Resources/Components/Spinner.cs.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "7d2197a4d7e117426aefe04d33c041bc",
+	"CSharpImporter": null
+}

+ 63 - 0
Data/AtomicEditor/ProjectTemplates/Project2D/CSharp/Resources/Scenes/Scene.scene

@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+<scene id="1">
+	<attribute name="Name" value="" />
+	<attribute name="Time Scale" value="1" />
+	<attribute name="Smoothing Constant" value="50" />
+	<attribute name="Snap Threshold" value="5" />
+	<attribute name="Elapsed Time" value="0" />
+	<attribute name="Next Replicated Node ID" value="371" />
+	<attribute name="Next Replicated Component ID" value="1989" />
+	<attribute name="Next Local Node ID" value="16778496" />
+	<attribute name="Next Local Component ID" value="16777216" />
+	<attribute name="Variables" />
+	<attribute name="Variable Names" value="" />
+	<component type="PhysicsWorld" id="1" />
+	<component type="Octree" id="2" />
+	<component type="DebugRenderer" id="3" />
+	<component type="Renderer2D" id="1980" />
+	<node id="2">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Zone" />
+		<attribute name="Position" value="0 0 0" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="Zone" id="4">
+			<attribute name="Bounding Box Min" value="-10000 -10000 -10000" />
+			<attribute name="Bounding Box Max" value="10000 10000 10000" />
+			<attribute name="Ambient Color" value="0.4 0.4 0.4 1" />
+		</component>
+	</node>
+	<node id="361">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Camera" />
+		<attribute name="Position" value="0 0 0" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="Camera" id="1973">
+			<attribute name="Near Clip" value="0" />
+			<attribute name="Orthographic" value="true" />
+			<attribute name="Orthographic Size" value="5" />
+		</component>
+	</node>
+	<node id="363">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Star" />
+		<attribute name="Position" value="0 0 3.4" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="StaticSprite2D" id="1979">
+			<attribute name="Layer" value="-100" />
+			<attribute name="Sprite" value="Sprite2D;Sprites/star.png" />
+		</component>
+		<component type="CSComponent" id="1988">
+			<attribute name="FieldValues">
+				<variant hash="273365031" type="Float" value="3" />
+			</attribute>
+			<attribute name="Assembly" value="CSComponentAssembly;AtomicProject.dll" />
+			<attribute name="Class" value="Spinner" />
+		</component>
+	</node>
+</scene>

+ 8 - 0
Data/AtomicEditor/ProjectTemplates/Project2D/CSharp/Resources/Scenes/Scene.scene.asset

@@ -0,0 +1,8 @@
+{
+	"version": 1,
+	"guid": "2a57513e778e118da7da6c222caf4d66",
+	"SceneImporter": {
+		"sceneCamRotation": "1 0 0 0",
+		"sceneCamPosition": "0 0 0"
+	}
+}

+ 16 - 0
Data/AtomicEditor/ProjectTemplates/Project2D/CSharp/Resources/Scripts/Program.cs

@@ -0,0 +1,16 @@
+using AtomicEngine;
+using AtomicPlayer;
+
+public static class AtomicMain
+{
+    /// <summary>
+    /// The main entry point for the application.
+    /// </summary>
+    static void Main(string[] args)
+    {
+
+        AtomicNET.GetSubsystem<Player>().LoadScene("Scenes/Scene.scene");
+
+    }
+    
+}

+ 5 - 0
Data/AtomicEditor/ProjectTemplates/Project2D/CSharp/Resources/Scripts/Program.cs.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "c7b1ed8a45b7704ba0fdffc94b582b55",
+	"CSharpImporter": null
+}

BIN
Data/AtomicEditor/ProjectTemplates/Project2D/CSharp/Resources/Sprites/star.png


+ 4 - 0
Data/AtomicEditor/ProjectTemplates/ProjectTemplates.json

@@ -12,6 +12,10 @@
             {
                 "folder": "Project2D/TypeScript",
                 "language": "TypeScript"
+            },
+            {
+                "folder": "Project2D/CSharp",
+                "language": "CSharp"
             }
         ]
     },