Browse Source

Adding Inspector Field Test

Josh Engebretson 10 years ago
parent
commit
a54cf1c1f5

+ 1 - 0
TestInspectorFields/.gitignore

@@ -0,0 +1 @@
+Cache/*

+ 5 - 0
TestInspectorFields/Resources.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "ab827e37c96ea0d9e783ea0eeb78cef6",
+	"FolderImporter": {}
+}

+ 5 - 0
TestInspectorFields/Resources/Components.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "ccab48e737ac6aeeb86fe45547ad4d9e",
+	"FolderImporter": {}
+}

+ 25 - 0
TestInspectorFields/Resources/Components/Star.js

@@ -0,0 +1,25 @@
+"atomic component";
+
+var inspectorFields = {
+  booleanField: true,
+  numberField: 1.0,
+  stringField: "Hello",
+  varField: [Atomic.VAR_INT, 42],
+  vector2Field: [Atomic.VAR_VECTOR2, [1, 2]],
+  vector3Field: [Atomic.VAR_VECTOR3, [1, 2, 3]],
+  quaternionField: [Atomic.VAR_QUATERNION, [1, 0, 0, 0]],
+  colorField: [Atomic.VAR_COLOR, [1, 2, 3, 4]],
+  texture2DNoDefault: ["Texture2D"],
+  sprite2D: ["Sprite2D", "Sprites/star.png"],
+  intEnumField: [Atomic.VAR_INT, { 0: "Peaceful", 1: "Friendly", 2: "Aggressive"}, 0]
+}
+
+module.exports = function(self) {
+
+  self.update = function(timeStep) {
+
+    self.node.rotate2D(timeStep * 75 * self.numberField);
+
+  }
+
+}

+ 7 - 0
TestInspectorFields/Resources/Components/Star.js.asset

@@ -0,0 +1,7 @@
+{
+	"version": 1,
+	"guid": "74b74051add6eda1624a6ea7cefc91ea",
+	"JavascriptImporter": {
+		"IsComponentFile": true
+	}
+}

+ 5 - 0
TestInspectorFields/Resources/Scenes.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "f31590e65d363f5e906c61acd0a3907d",
+	"FolderImporter": {}
+}

+ 45 - 0
TestInspectorFields/Resources/Scenes/Scene.scene

@@ -0,0 +1,45 @@
+<?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="364" />
+	<attribute name="Next Replicated Component ID" value="1978" />
+	<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="1976" />
+	<node id="361">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Camera" />
+		<attribute name="Position" value="0 0 -5" />
+		<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="8" />
+		</component>
+	</node>
+	<node id="363">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Node" />
+		<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="StaticSprite2D" id="1975">
+			<attribute name="Sprite" value="Sprite2D;Sprites/star.png" />
+		</component>
+		<component type="JSComponent" id="1977">
+			<attribute name="ComponentFile" value="JSComponentFile;Components/Star.js" />
+		</component>
+	</node>
+</scene>

+ 5 - 0
TestInspectorFields/Resources/Scenes/Scene.scene.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "a21492aa151d8362f18de37e234984fd",
+	"SceneImporter": {}
+}

+ 5 - 0
TestInspectorFields/Resources/Scripts.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "b197f12988bc97939a744f3abfb821e4",
+	"FolderImporter": {}
+}

+ 3 - 0
TestInspectorFields/Resources/Scripts/main.js

@@ -0,0 +1,3 @@
+// This script is the main entry point of the game
+
+Atomic.player.loadScene("Scenes/Scene.scene");

+ 7 - 0
TestInspectorFields/Resources/Scripts/main.js.asset

@@ -0,0 +1,7 @@
+{
+	"version": 1,
+	"guid": "72328cec321d85d889b5d094f2e4c9fa",
+	"JavascriptImporter": {
+		"IsComponentFile": false
+	}
+}

+ 5 - 0
TestInspectorFields/Resources/Sprites.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "5bc04a045b1d79ba4ac81edc7957af17",
+	"FolderImporter": {}
+}

BIN
TestInspectorFields/Resources/Sprites/star.png


+ 5 - 0
TestInspectorFields/Resources/Sprites/star.png.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "e5bbf26fceca5a42fd738943de71604e",
+	"TextureImporter": {}
+}

+ 0 - 0
TestInspectorFields/TestInspectorFields.atomic