@@ -0,0 +1,75 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: robot_albedo
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: d2da597e454794cdfbdc37e96fe930c4, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.8, g: 0.8, b: 0.8, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,76 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: RocketPlaceholder
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: eb85c47e81fac4f3db62a35ba040f28c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 10
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 3
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _Color: {r: 1, g: 0.4852941, b: 0.4852941, a: 0.472}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -0,0 +1,244 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1945090282521690}
m_IsPrefabParent: 1
--- !u!1 &1135511506768614
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4127824705417478}
- component: {fileID: 114060611881135656}
- component: {fileID: 120831544184463106}
- component: {fileID: 65259261732688452}
m_Layer: 8
m_Name: Lazer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1945090282521690
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4296125747901348}
- component: {fileID: 33798436283663822}
- component: {fileID: 23480477119425724}
- component: {fileID: 64073001854489718}
m_Layer: 0
m_Name: LazerEmitter
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!4 &4127824705417478
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1135511506768614}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.033, y: 1.602, z: 2.89}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4296125747901348}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4296125747901348
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1945090282521690}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -38.71, y: 0.03, z: -184.93}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4127824705417478}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &23480477119425724
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1945090282521690}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 8b7660d8a41ca4a7f8abc7730d12256f, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
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 &33798436283663822
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1945090282521690}
m_Mesh: {fileID: 4300000, guid: 991e2a4f232c9400d83ca29f3c1a5826, type: 3}
--- !u!64 &64073001854489718
MeshCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1945090282521690}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 1
m_InflateMesh: 1
m_SkinWidth: 0.01
m_Mesh: {fileID: 4300000, guid: 991e2a4f232c9400d83ca29f3c1a5826, type: 3}
--- !u!65 &65259261732688452
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1135511506768614}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 45.282944}
m_Center: {x: 0.5, y: 0.5, z: 22.641472}
--- !u!114 &114060611881135656
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1135511506768614}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 03606583db838470399cd65a6451d2a1, type: 3}
m_Name:
m_EditorClassIdentifier:
OnInterval: 1
OffInterval: 1
StartDelay: 0
MaxDistance: 50
LayerMask:
serializedVersion: 2
m_Bits: 4294967039
--- !u!120 &120831544184463106
LineRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1135511506768614}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_MotionVectors: 0
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_Materials:
- {fileID: 2100000, guid: 248e8d80037f945e9ac8cab68e72a2fb, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
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
m_Positions:
- {x: -38.743, y: 1.632, z: -182.04}
- {x: -38.742973, y: 1.6320003, z: -136.75705}
m_Parameters:
serializedVersion: 2
widthMultiplier: 1
widthCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
colorGradient:
serializedVersion: 2
key0: {r: 1, g: 1, b: 1, a: 1}
key1: {r: 1, g: 1, b: 1, a: 1}
key2: {r: 0, g: 0, b: 0, a: 0}
key3: {r: 0, g: 0, b: 0, a: 0}
key4: {r: 0, g: 0, b: 0, a: 0}
key5: {r: 0, g: 0, b: 0, a: 0}
key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 65535
ctime2: 0
ctime3: 0
ctime4: 0
ctime5: 0
ctime6: 0
ctime7: 0
atime0: 0
atime1: 65535
atime2: 0
atime3: 0
atime4: 0
atime5: 0
atime6: 0
atime7: 0
m_Mode: 0
m_NumColorKeys: 2
m_NumAlphaKeys: 2
numCornerVertices: 0
numCapVertices: 0
alignment: 0
textureMode: 0
m_UseWorldSpace: 1
m_Loop: 0
@@ -1169,6 +1169,9 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
Claws: {fileID: 114066247039780058}
OnDeathPrefabs:
- {fileID: 1940662611033690, guid: df7630906209940f4b4e9c52148c8c11, type: 2}
- {fileID: 1243095374089020, guid: 1cbecc620f5f844c6bbbd44637db6c3a, type: 2}
--- !u!114 &114570734964285222
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -141,7 +141,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1726608074248408}
m_LocalRotation: {x: -0.000000059604645, y: -1.134464e-16, z: 1.1344639e-16, w: 1}
m_LocalPosition: {x: 3, y: 3, z: 25.2}
m_LocalPosition: {x: -84.1, y: 3, z: -142}
m_LocalScale: {x: 4.2000003, y: 4.2000003, z: 4.2000003}
m_Children:
- {fileID: 4452894135114260}
@@ -379,14 +379,14 @@ Rigidbody:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1726608074248408}
serializedVersion: 2
m_Mass: 1
m_Mass: 50
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
m_CollisionDetection: 2
--- !u!64 &64024863155943152
MeshCollider:
m_ObjectHideFlags: 1
@@ -216,8 +216,8 @@ Transform:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000662918367624}
m_LocalRotation: {x: -0.000000059604645, y: -1.134464e-16, z: 1.1344639e-16, w: 1}
m_LocalPosition: {x: 4.2, y: 3, z: 37.2}
m_LocalRotation: {x: 0.32768664, y: -0.66499484, z: 0.5524254, w: 0.38108996}
m_LocalPosition: {x: -88, y: 23.62, z: 61.09}
m_LocalScale: {x: 4.2000003, y: 4.2000003, z: 4.2000003}
m_Children:
- {fileID: 4052613788638678}
@@ -230,7 +230,7 @@ Transform:
- {fileID: 4644995766797690}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: 79.89101, y: -124.412, z: -4.828}
--- !u!4 &4202683713253746
Transform:
m_ObjectHideFlags: 1
@@ -667,14 +667,14 @@ Rigidbody:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000662918367624}
serializedVersion: 2
m_Mass: 1
m_Mass: 50
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
m_CollisionDetection: 2
--- !u!64 &64654233661765450
MeshCollider:
m_ObjectHideFlags: 1
@@ -379,14 +379,14 @@ Rigidbody:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1046316144813738}
serializedVersion: 2
m_Mass: 1
m_Mass: 50
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
m_CollisionDetection: 2
--- !u!64 &64758668359051364
MeshCollider:
m_ObjectHideFlags: 1
@@ -235,14 +235,14 @@ Rigidbody:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1584834707164184}
serializedVersion: 2
m_Mass: 1
m_Mass: 50
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
m_CollisionDetection: 2
--- !u!64 &64480520436209872
MeshCollider:
m_ObjectHideFlags: 1
@@ -128,7 +128,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1940293708080768}
m_LocalRotation: {x: -0.000000059604645, y: -1.134464e-16, z: 1.1344639e-16, w: 1}
m_LocalPosition: {x: 17.5, y: 3, z: 8.4}
m_LocalPosition: {x: 9.3, y: 3, z: 21.1}
m_LocalScale: {x: 4.2000003, y: 4.2000003, z: 4.2000003}
m_Children:
- {fileID: 4425363336198158}
@@ -380,14 +380,14 @@ Rigidbody:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1940293708080768}
serializedVersion: 2
m_Mass: 1
m_Mass: 50
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
m_CollisionDetection: 2
--- !u!64 &64525734333214238
MeshCollider:
m_ObjectHideFlags: 1
@@ -163,14 +163,14 @@ Rigidbody:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1696269877823692}
serializedVersion: 2
m_Mass: 1
m_Mass: 50
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
m_CollisionDetection: 2
--- !u!64 &64677001170874734
MeshCollider:
m_ObjectHideFlags: 1

Large diffs are not rendered by default.

@@ -38,12 +38,12 @@ RenderSettings:
m_ReflectionIntensity: 0.64
m_CustomReflection: {fileID: 8900000, guid: b995d4bd9d11078d11005b9844295342, type: 3}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 0.64}
m_IndirectSpecularColor: {r: 0.05187174, g: 0.050842308, b: 0.051641874, a: 0.64}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_GIWorkflowMode: 0
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
@@ -52,7 +52,7 @@ LightmapSettings:
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 8
m_Resolution: 2
@@ -462,7 +462,7 @@ Light:
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 1
m_Flare: {fileID: 12100000, guid: 09ebe82dbd1113c3d000dc0b8d76c639, type: 2}
m_Flare: {fileID: 12100000, guid: 54fbbf098d116effa00081aba8ad6659, type: 2}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
@@ -26,6 +26,7 @@ public class CameraController : MonoBehaviour
void Start ()
{
_currentOrbitDistance = Mathf.Lerp(OrbitDistance.x, OrbitDistance.y, 0.5f);
_y = 180;
}

void Update ()
@@ -0,0 +1,14 @@
using UnityEditor;
using UnityEngine;

[CustomEditor(typeof(Robot))]
public class RobotEditor : Editor
{
public override void OnInspectorGUI()
{
base.OnInspectorGUI();

if(GUILayout.Button("Kill"))
(target as Robot).Kill();
}
}
@@ -0,0 +1,98 @@
using System;
using UnityEngine;

[ExecuteInEditMode]
[RequireComponent(typeof(BoxCollider))]
[RequireComponent(typeof(LineRenderer))]
public class Lazer : MonoBehaviour
{
public float OnInterval = 1f;
public float OffInterval = 1f;
public float StartDelay = 0f;

[Header("Collision")]
public float MaxDistance = 10f;
public LayerMask LayerMask;

private bool _on;
private float _current;
private BoxCollider _collider;
private LineRenderer _lineRenderer;

void Start()
{
_collider = GetComponent<BoxCollider>();
_lineRenderer = GetComponent<LineRenderer>();
_lineRenderer.useWorldSpace = true;
Turn(on: true);
}

void Update()
{
var endPosition = CastEndPosition();

_lineRenderer.SetPositions(new Vector3[]
{
transform.position,
endPosition
});

var length = Vector3.Distance(transform.position, endPosition);
_collider.size = new Vector3(1f, 1f, length);
_collider.center = new Vector3(0.5f, 0.5f, length * 0.5f);

if(!Application.isPlaying)
{
return;
}

if(StartDelay > 0f)
{
StartDelay -= Time.deltaTime;
return;
}

if(!_on)
{
if(_current >= OffInterval)
{
Turn(on: true);
}
}
else
{
if(_current >= OnInterval)
{
Turn(on: false);
}
}
_current += Time.deltaTime;
}

private Vector3 CastEndPosition()
{
RaycastHit hit;
if(Physics.Raycast(transform.position, transform.forward, out hit, MaxDistance, LayerMask))
{
return hit.point;
}

return transform.position + transform.forward * MaxDistance;
}

void Turn(bool on)
{
_on = on;
_current = 0;
_collider.enabled = on;
_lineRenderer.enabled = on;
}

public void OnTriggerEnter(Collider collider)
{
var robot = collider.gameObject.GetComponent<Robot>();
if(robot == null) return;

robot.Kill();
}
}
@@ -9,8 +9,20 @@ public class RocketBuilder : MonoBehaviour
public List<Transform> ExpectedOrderOfObjects;
public Transform HiddenRocketModel;

public TextMesh ProgressTextMesh;

private int _current = 0;

void Start()
{
UpdateProgressText();
}

private void UpdateProgressText()
{
ProgressTextMesh.text = _current + " of 6 Rocket Parts";
}

public bool TryAddObject(GameObject gameObject, Vector3 dropOffPoint)
{
if(_current == ExpectedOrderOfObjects.Count) return false; // Already added all!
@@ -19,6 +31,7 @@ public bool TryAddObject(GameObject gameObject, Vector3 dropOffPoint)
{
StartCoroutine(MoveObjectIntoPlace(gameObject, dropOffPoint));
_current++;
UpdateProgressText();
return true;
}

@@ -82,6 +95,9 @@ private IEnumerator MoveObjectIntoPlace(GameObject gameObject, Vector3 dropOffPo
while(it.MoveNext())
yield return it.Current;

// Hide the placeholder
target.gameObject.SetActive(false);

Debug.Log(gameObject.name + " moved into place!");
}

@@ -13,6 +13,8 @@ void Update()
{
foreach(var ac in Actions)
{
if(Application.isEditor && ac.IgnoreInEditor) continue;

if(Input.GetButtonDown(ac.InputButton))
{
ac.Event.Invoke();
@@ -26,4 +28,5 @@ public class KeyAction
{
public string InputButton;
public UnityEvent Event;
public bool IgnoreInEditor = false;
}
@@ -48,13 +48,18 @@ public void Attach(Transform owner)
_originalParent = Root.parent;
Root.parent = owner;
Rigidbody.isKinematic = true;
Root.GetComponent<Collider>().enabled = false;
_attached = true;
}

public void Detach()
{
Root.parent = _originalParent;
Rigidbody.isKinematic = false;
// Clear out existing forces
Rigidbody.velocity = Vector3.zero;
Rigidbody.angularVelocity = Vector3.zero;
Root.GetComponent<Collider>().enabled = true;
_attached = false;
}
}
@@ -5,13 +5,27 @@
public class Robot : MonoBehaviour
{
public RobotClaws Claws;
public List<GameObject> OnDeathPrefabs;

private bool _alive;

void Start ()
{

_alive = true;
}

public void Kill()
{
if(!_alive) return; // Already dead yo

_alive = false;
GetComponent<RobotController>().enabled = false;

foreach(var prefab in OnDeathPrefabs)
{
Instantiate(prefab, transform.position, Quaternion.identity);
}
}

void Update ()
{
@@ -15,4 +15,4 @@ PhysicsManager:
m_QueriesHitTriggers: 1
m_EnableAdaptiveForce: 0
m_EnablePCM: 1
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_LayerCollisionMatrix: fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
@@ -35,6 +35,8 @@ GraphicsSettings:
- {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}
@@ -13,7 +13,7 @@ TagManager:
- UI
-
-
-
- Lazer
-
-
-