From 8b53c20699b036da2157e20993c8c8af72001aba Mon Sep 17 00:00:00 2001 From: Carlos Date: Wed, 3 Oct 2018 04:16:42 +0200 Subject: [PATCH] Fixed lock first weapond in machine --- .../Animations/HUD/ResourceMachineOn.anim | 9 ++- ShowPT/Assets/Scenes/Game.unity | 66 ++++++++++++++++++- ShowPT/Assets/Scripts/UpdateHudMachine.cs | 19 ++++++ .../Assets/Scripts/UpdateHudMachine.cs.meta | 13 ++++ 4 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 ShowPT/Assets/Scripts/UpdateHudMachine.cs create mode 100644 ShowPT/Assets/Scripts/UpdateHudMachine.cs.meta diff --git a/ShowPT/Assets/Graphical Resources/Animations/HUD/ResourceMachineOn.anim b/ShowPT/Assets/Graphical Resources/Animations/HUD/ResourceMachineOn.anim index 19bf6bcc..b98f6548 100644 --- a/ShowPT/Assets/Graphical Resources/Animations/HUD/ResourceMachineOn.anim +++ b/ShowPT/Assets/Graphical Resources/Animations/HUD/ResourceMachineOn.anim @@ -2881,4 +2881,11 @@ AnimationClip: m_HasGenericRootTransform: 0 m_HasMotionFloatCurves: 0 m_GenerateMotionCurves: 0 - m_Events: [] + m_Events: + - time: 1.3333334 + functionName: updateHUD + data: + objectReferenceParameter: {fileID: 0} + floatParameter: 0 + intParameter: 0 + messageOptions: 0 diff --git a/ShowPT/Assets/Scenes/Game.unity b/ShowPT/Assets/Scenes/Game.unity index 0978f2dc..ec81a2d7 100644 --- a/ShowPT/Assets/Scenes/Game.unity +++ b/ShowPT/Assets/Scenes/Game.unity @@ -47710,6 +47710,22 @@ ParticleSystem: m_PostInfinity: 2 m_RotationOrder: 4 vectorLabel1_3: W +--- !u!1 &448336370 stripped +GameObject: + m_PrefabParentObject: {fileID: 1168040546144384, guid: 93a6c15518400ae478bba9a29fd1dd68, + type: 2} + m_PrefabInternal: {fileID: 1552626871} +--- !u!114 &448336375 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 448336370} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ae9499bada560f44685a159089fdd5e5, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &449649761 GameObject: m_ObjectHideFlags: 0 @@ -58041,6 +58057,22 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: explosionForce: 700 +--- !u!1 &617557270 stripped +GameObject: + m_PrefabParentObject: {fileID: 1459550404800550, guid: 93a6c15518400ae478bba9a29fd1dd68, + type: 2} + m_PrefabInternal: {fileID: 1552626871} +--- !u!114 &617557275 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 617557270} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ae9499bada560f44685a159089fdd5e5, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!4 &617665154 stripped Transform: m_PrefabParentObject: {fileID: 400084, guid: aeb9298774497194b9592af367d19efc, type: 3} @@ -105361,6 +105393,22 @@ Transform: m_Father: {fileID: 1198274853} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1103495742 stripped +GameObject: + m_PrefabParentObject: {fileID: 1758304154275152, guid: 93a6c15518400ae478bba9a29fd1dd68, + type: 2} + m_PrefabInternal: {fileID: 1552626871} +--- !u!114 &1103495747 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1103495742} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ae9499bada560f44685a159089fdd5e5, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1103782082 GameObject: m_ObjectHideFlags: 0 @@ -149994,6 +150042,22 @@ Animator: m_WarningMessage: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 +--- !u!1 &1537344068 stripped +GameObject: + m_PrefabParentObject: {fileID: 1577464265470752, guid: 93a6c15518400ae478bba9a29fd1dd68, + type: 2} + m_PrefabInternal: {fileID: 1552626871} +--- !u!114 &1537344073 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1537344068} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ae9499bada560f44685a159089fdd5e5, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1538630641 GameObject: m_ObjectHideFlags: 0 @@ -175655,7 +175719,7 @@ Prefab: - target: {fileID: 114497096684429664, guid: 020030e7ca02d944eb8625b1fd8c4c5b, type: 2} propertyPath: m_Enabled - value: 1 + value: 0 objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114587176421123022, guid: 020030e7ca02d944eb8625b1fd8c4c5b, type: 2} diff --git a/ShowPT/Assets/Scripts/UpdateHudMachine.cs b/ShowPT/Assets/Scripts/UpdateHudMachine.cs new file mode 100644 index 00000000..ea338fba --- /dev/null +++ b/ShowPT/Assets/Scripts/UpdateHudMachine.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class UpdateHudMachine : MonoBehaviour +{ + private ResourceMachineController resourceMachineController; + + // Use this for initialization + void Start () + { + resourceMachineController = transform.GetComponentInChildren(); + } + + // Update is called once per frame + public void updateHUD () { + resourceMachineController.updateSelected(0); + } +} diff --git a/ShowPT/Assets/Scripts/UpdateHudMachine.cs.meta b/ShowPT/Assets/Scripts/UpdateHudMachine.cs.meta new file mode 100644 index 00000000..a53b8656 --- /dev/null +++ b/ShowPT/Assets/Scripts/UpdateHudMachine.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ae9499bada560f44685a159089fdd5e5 +timeCreated: 1538532502 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: