lonestar

0x10c-inspired space game based on the DCPU-16
git clone git://squid-tech.com/lonestar.git
Log | Files | Refs | README

commit 3a4bf04df672b532298b07762a24dc75fe6db71f
parent 2455154cc927f14a608befce6226322f6d91f96a
Author: Josh Moore <jxm5210@rit.edu>
Date:   Tue, 19 Nov 2019 19:00:59 -0500

Refactor DeviceScript for extensibility

Diffstat:
Dsrc/LoneStar/Assets/Devices/LightDevice/DeviceScript.cs | 63---------------------------------------------------------------
Dsrc/LoneStar/Assets/Devices/LightDevice/DeviceScript.cs.meta | 11-----------
Msrc/LoneStar/Assets/Devices/LightDevice/LightDevice.prefab | 7+++++--
Msrc/LoneStar/Assets/Scenes/SampleScene.unity | 602+++++++++++++++++++++++++++++++++++++++----------------------------------------
Msrc/LoneStar/Assets/Scripts/DCPU16Controller.cs | 2+-
5 files changed, 302 insertions(+), 383 deletions(-)

diff --git a/src/LoneStar/Assets/Devices/LightDevice/DeviceScript.cs b/src/LoneStar/Assets/Devices/LightDevice/DeviceScript.cs @@ -1,63 +0,0 @@ -´╗┐using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using Mirror; - -// LIGHT SPECS -// A = 0 light off -// A = 1 light on - -public class DeviceScript : NetworkBehaviour -{ - // the ID of the company that manufactures this device - const uint MANUFACTURER_ID = 0xDEADBEEF; - // the device ID of this device - const uint DEVICE_ID = 0xAAAABBBB; - // hardware version - const ushort DEVICE_VERSION = 0x0001; - - void Start() - { - this.gameObject.transform.Find("Sphere").GetComponent<Renderer>().material.color = Color.white; - } - - // handle a hardware interrupt - // GP_REG corresponds to the general-purpose DCPU registers - public void HWI(GameObject dcpu, ushort[] GP_REG) - { - if (GP_REG[0] == 1) - { - this.gameObject.transform.Find("PointLight").GetComponent<Light>().enabled = true; - this.gameObject.transform.Find("Sphere").gameObject.GetComponent<Renderer>().material.color = this.gameObject.transform.Find("PointLight").GetComponent<Light>().color; - } - else - { - this.gameObject.transform.Find("PointLight").GetComponent<Light>().enabled = false; - this.gameObject.transform.Find("Sphere").gameObject.GetComponent<Renderer>().material.color = Color.white; - } - } - - // respond to request for hardware information - public void HWQ(GameObject dcpu, ushort[] GP_REG) - { - ushort[] info = new ushort[8]; - - // hardware ID (registers A+(B<<16)) - info[0] = (ushort)(DEVICE_ID & 0xFFFF); - info[1] = (ushort)((DEVICE_ID >> 16) & 0xFFFF); - - // device version (register C) - info[2] = DEVICE_VERSION; - - // manufacturer ID (registers X+(Y<<16)) - info[3] = (ushort)(MANUFACTURER_ID & 0xFFFF); - info[4] = (ushort)((MANUFACTURER_ID >> 16) & 0xFFFF); - - info[5] = GP_REG[5]; - info[6] = GP_REG[6]; - info[7] = GP_REG[7]; - - // return the information to the requesting DCPU - dcpu.GetComponent<DCPU16Controller>().returnHW(info); - } -} diff --git a/src/LoneStar/Assets/Devices/LightDevice/DeviceScript.cs.meta b/src/LoneStar/Assets/Devices/LightDevice/DeviceScript.cs.meta @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: cfffeb104851e534a86226facc3354a7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/LoneStar/Assets/Devices/LightDevice/LightDevice.prefab b/src/LoneStar/Assets/Devices/LightDevice/LightDevice.prefab @@ -10,7 +10,7 @@ GameObject: m_Component: - component: {fileID: 7157367172244747167} - component: {fileID: 7157367172244747165} - - component: {fileID: 6064729815770853023} + - component: {fileID: 5935737454363145752} m_Layer: 0 m_Name: LightDevice m_TagString: Untagged @@ -50,7 +50,7 @@ MonoBehaviour: serverOnly: 0 m_AssetId: m_SceneId: 0 ---- !u!114 &6064729815770853023 +--- !u!114 &5935737454363145752 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -64,6 +64,9 @@ MonoBehaviour: m_EditorClassIdentifier: syncMode: 0 syncInterval: 0.1 + MANUFACTURER_ID: 0 + DEVICE_ID: 0 + DEVICE_VERSION: 0 --- !u!1 &7157367172630647504 GameObject: m_ObjectHideFlags: 0 diff --git a/src/LoneStar/Assets/Scenes/SampleScene.unity b/src/LoneStar/Assets/Scenes/SampleScene.unity @@ -213,105 +213,6 @@ Transform: m_Father: {fileID: 223974227} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &90792816 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 7157367172244747160, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_Name - value: LightDevice (1) - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalPosition.x - value: -3.05 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalPosition.y - value: 0.838 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalPosition.z - value: -3.012 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_RootOrder - value: 4 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747165, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_SceneId - value: 2181645215 - objectReference: {fileID: 0} - - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_Color.b - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_Color.g - value: 0.38176292 - objectReference: {fileID: 0} - - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_Enabled - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_Intensity - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_BounceIntensity - value: 1 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} --- !u!1 &181700529 GameObject: m_ObjectHideFlags: 0 @@ -533,102 +434,8 @@ Transform: - {fileID: 47079378} - {fileID: 610458616} m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &467561572 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 7157367172244747160, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_Name - value: LightDevice (3) - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalPosition.x - value: 1.02 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalPosition.y - value: 0.838 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalPosition.z - value: -3.07 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_RootOrder - value: 6 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7157367172244747165, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_SceneId - value: 2225361569 - objectReference: {fileID: 0} - - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_Enabled - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_Color.b - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_Color.r - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, - type: 3} - propertyPath: m_Color.g - value: 0.6279521 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} --- !u!1 &480843791 GameObject: m_ObjectHideFlags: 0 @@ -722,99 +529,7 @@ Transform: m_Father: {fileID: 223974227} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 90, y: 90, z: 0} ---- !u!1 &558530548 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 558530552} - - component: {fileID: 558530551} - - component: {fileID: 558530550} - - component: {fileID: 558530549} - m_Layer: 0 - m_Name: 4 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!65 &558530549 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 558530548} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &558530550 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 558530548} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!33 &558530551 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 558530548} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &558530552 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 558530548} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -2.109, y: -1.0120001, z: -4.616} - m_LocalScale: {x: 0.13958, y: 0.058621, z: 0.18218777} - m_Children: [] - m_Father: {fileID: 804914385} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &563760763 +--- !u!1001 &525625050 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 @@ -824,22 +539,22 @@ PrefabInstance: - target: {fileID: 7157367172244747160, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} propertyPath: m_Name - value: LightDevice + value: LightDevice (4) objectReference: {fileID: 0} - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} propertyPath: m_LocalPosition.x - value: -1.02 + value: -3.019 objectReference: {fileID: 0} - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} propertyPath: m_LocalPosition.y - value: 0.838 + value: 0.74 objectReference: {fileID: 0} - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} propertyPath: m_LocalPosition.z - value: -3.06 + value: -3.9353232 objectReference: {fileID: 0} - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} @@ -864,7 +579,7 @@ PrefabInstance: - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} propertyPath: m_RootOrder - value: 1 + value: 6 objectReference: {fileID: 0} - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} @@ -884,22 +599,22 @@ PrefabInstance: - target: {fileID: 7157367172244747165, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} propertyPath: m_SceneId - value: 3072076613 + value: 1030593115 objectReference: {fileID: 0} - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} - propertyPath: m_Color.r - value: 0.20388949 + propertyPath: m_Color.b + value: 0.18140125 objectReference: {fileID: 0} - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} - propertyPath: m_Color.g - value: 1 + propertyPath: m_Color.r + value: 0 objectReference: {fileID: 0} - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} - propertyPath: m_Color.b - value: 0 + propertyPath: m_Color.g + value: 1 objectReference: {fileID: 0} - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} @@ -908,6 +623,98 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} +--- !u!1 &558530548 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 558530552} + - component: {fileID: 558530551} + - component: {fileID: 558530550} + - component: {fileID: 558530549} + m_Layer: 0 + m_Name: 4 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &558530549 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 558530548} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &558530550 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 558530548} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &558530551 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 558530548} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &558530552 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 558530548} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2.109, y: -1.0120001, z: -4.616} + m_LocalScale: {x: 0.13958, y: 0.058621, z: 0.18218777} + m_Children: [] + m_Father: {fileID: 804914385} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &610458614 GameObject: m_ObjectHideFlags: 0 @@ -1198,7 +1005,7 @@ Transform: - {fileID: 1255924688} - {fileID: 804914385} m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1038438291 MonoBehaviour: @@ -1215,7 +1022,7 @@ MonoBehaviour: syncMode: 0 syncInterval: 0.1 POWER: 0 ---- !u!1001 &1124624719 +--- !u!1001 &1063856807 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 @@ -1225,22 +1032,22 @@ PrefabInstance: - target: {fileID: 7157367172244747160, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} propertyPath: m_Name - value: LightDevice (2) + value: LightDevice (3) objectReference: {fileID: 0} - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} propertyPath: m_LocalPosition.x - value: 3 + value: 3.015 objectReference: {fileID: 0} - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} propertyPath: m_LocalPosition.y - value: 0.838 + value: 0.74 objectReference: {fileID: 0} - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} propertyPath: m_LocalPosition.z - value: -3.012 + value: -3.9353232 objectReference: {fileID: 0} - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} @@ -1285,7 +1092,7 @@ PrefabInstance: - target: {fileID: 7157367172244747165, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} propertyPath: m_SceneId - value: 903629006 + value: 266228895 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} @@ -1752,6 +1559,95 @@ Transform: m_Father: {fileID: 223974227} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 90, y: -90, z: 0} +--- !u!1001 &1494425958 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 7157367172244747160, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_Name + value: LightDevice (2) + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalPosition.x + value: -1.02 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalPosition.y + value: 0.74 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalPosition.z + value: -3.9353232 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_RootOrder + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747165, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_SceneId + value: 4286942692 + objectReference: {fileID: 0} + - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_Color.b + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_Color.g + value: 0.13504837 + objectReference: {fileID: 0} + - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} --- !u!1 &1611669224 GameObject: m_ObjectHideFlags: 0 @@ -1844,6 +1740,100 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1611669224} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1001 &1619602463 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 7157367172244747160, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_Name + value: LightDevice (1) + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalPosition.x + value: 0.997 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalPosition.y + value: 0.74 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalPosition.z + value: -3.9353232 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747167, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7157367172244747165, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_SceneId + value: 998800392 + objectReference: {fileID: 0} + - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_Color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_Color.r + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_Color.g + value: 0.120030165 + objectReference: {fileID: 0} + - target: {fileID: 7157367173229024532, guid: 6a3ee7b8517f9294885e92176b21e219, + type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 6a3ee7b8517f9294885e92176b21e219, type: 3} --- !u!1 &1712986797 GameObject: m_ObjectHideFlags: 0 diff --git a/src/LoneStar/Assets/Scripts/DCPU16Controller.cs b/src/LoneStar/Assets/Scripts/DCPU16Controller.cs @@ -132,7 +132,7 @@ public class DCPU16Controller : NetworkBehaviour if (plugging == null) { - if (hit.transform.parent.gameObject.GetComponent("DeviceScript") != null) + if (hit.transform.parent.gameObject.GetComponent<DeviceScript>() != null) { // clicked a device to plug in plugging = hit.transform.parent.gameObject;