Merge remote-tracking branch 'origin/dev' into jason

This commit is contained in:
Jason Durand 01 2022-04-02 01:15:56 -04:00
commit 10f36045f8
6 changed files with 493 additions and 110 deletions

View File

@ -52,8 +52,8 @@ MonoBehaviour:
m_EditorClassIdentifier:
icon: {fileID: 1979632679604795359}
indexInMinionList: 0
selectedColor: {r: 1, g: 1, b: 1, a: 0}
unSelectedColor: {r: 0.6792453, g: 0.6792453, b: 0.6792453, a: 0}
selectedColor: {r: 1, g: 1, b: 1, a: 1}
unSelectedColor: {r: 0.6792453, g: 0.6792453, b: 0.6792453, a: 1}
--- !u!1 &1979632679258755678
GameObject:
m_ObjectHideFlags: 0

View File

@ -123,6 +123,81 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &313298547
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 313298548}
- component: {fileID: 313298550}
- component: {fileID: 313298549}
m_Layer: 5
m_Name: Fill
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &313298548
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 313298547}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1877036977}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &313298549
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 313298547}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.6603774, g: 0.14017446, b: 0.14017446, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &313298550
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 313298547}
m_CullTransparentMesh: 1
--- !u!1 &363646698
GameObject:
m_ObjectHideFlags: 0
@ -209,6 +284,7 @@ GameObject:
- component: {fileID: 1302468887}
- component: {fileID: 1302468889}
- component: {fileID: 1302468888}
- component: {fileID: 1302468890}
m_Layer: 5
m_Name: Minion Bar
m_TagString: Untagged
@ -226,10 +302,9 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1739165038}
m_Children: []
m_Father: {fileID: 2126071660}
m_RootOrder: 0
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
@ -274,8 +349,185 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 81a29b049c6380f4abb3c18ed121efcd, type: 3}
m_Name:
m_EditorClassIdentifier:
minionTypes: []
minionTypes:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
minionIconPrefab: {fileID: 1979632678310270257, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
--- !u!114 &1302468890
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1302468886}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Actions: {fileID: -944628639613478452, guid: 3f999e92409efaa4fa202b3263fc7ba4, type: 3}
m_NotificationBehavior: 2
m_UIInputModule: {fileID: 0}
m_DeviceLostEvent:
m_PersistentCalls:
m_Calls: []
m_DeviceRegainedEvent:
m_PersistentCalls:
m_Calls: []
m_ControlsChangedEvent:
m_PersistentCalls:
m_Calls: []
m_ActionEvents:
- m_PersistentCalls:
m_Calls: []
m_ActionId: 1071c237-0382-46b6-9750-c39a686354f8
m_ActionName: Player/Move[/Keyboard/w,/Keyboard/upArrow,/Keyboard/s,/Keyboard/downArrow,/Keyboard/a,/Keyboard/leftArrow,/Keyboard/d,/Keyboard/rightArrow]
- m_PersistentCalls:
m_Calls: []
m_ActionId: eefb12f1-0980-4e79-a169-5b8d9c5f8909
m_ActionName: Player/Jump[/Keyboard/space]
- m_PersistentCalls:
m_Calls: []
m_ActionId: bd3662a8-0f8c-46c3-a035-be5ce123a673
m_ActionName: Player/Suck[/Keyboard/e]
- m_PersistentCalls:
m_Calls: []
m_ActionId: bba4f6e1-6e22-4374-b248-2e5bc19a3705
m_ActionName: UI/Navigate[/Keyboard/w,/Keyboard/upArrow,/Keyboard/s,/Keyboard/downArrow,/Keyboard/a,/Keyboard/leftArrow,/Keyboard/d,/Keyboard/rightArrow]
- m_PersistentCalls:
m_Calls: []
m_ActionId: f0db3b44-2fa0-4228-9bca-9c384c0d12c6
m_ActionName: UI/Submit[/Keyboard/enter]
- m_PersistentCalls:
m_Calls: []
m_ActionId: baf9b26e-f035-4332-98a0-35730b6f70c8
m_ActionName: UI/Cancel[/Keyboard/escape]
- m_PersistentCalls:
m_Calls: []
m_ActionId: 17b66829-f839-44f5-9544-2693e69f7dea
m_ActionName: UI/Point[/Mouse/position]
- m_PersistentCalls:
m_Calls: []
m_ActionId: 1ebf91c2-c166-4c56-84b5-b441c4bc0788
m_ActionName: UI/Click[/Mouse/leftButton]
- m_PersistentCalls:
m_Calls: []
m_ActionId: e6c07a73-7275-4cad-b986-88f211037618
m_ActionName: UI/ScrollWheel[/Mouse/scroll]
- m_PersistentCalls:
m_Calls: []
m_ActionId: 2664e5d8-ab63-41f4-b614-5aaa91e73447
m_ActionName: UI/MiddleClick[/Mouse/middleButton]
- m_PersistentCalls:
m_Calls: []
m_ActionId: 056609de-e1b8-4db5-be6d-089e2e870adf
m_ActionName: UI/RightClick[/Mouse/rightButton]
- m_PersistentCalls:
m_Calls: []
m_ActionId: e6b3fe0b-f8c4-43f6-8c25-939569ff5b0e
m_ActionName: UI/TrackedDevicePosition
- m_PersistentCalls:
m_Calls: []
m_ActionId: 6e7e8be9-9198-4490-bb0c-a25fa63601b6
m_ActionName: UI/TrackedDeviceOrientation
- m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1302468889}
m_TargetAssemblyTypeName: MinionBar, Assembly-CSharp
m_MethodName: ChangeSelectedIcon
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_ActionId: d0405457-c534-4103-a0b6-cf113432b467
m_ActionName: Player/SwitchMinion[/Keyboard/q,/Keyboard/e,/XInputControllerWindows/leftShoulder,/XInputControllerWindows/rightShoulder]
m_NeverAutoSwitchControlSchemes: 0
m_DefaultControlScheme:
m_DefaultActionMap: Player
m_SplitScreenIndex: -1
m_Camera: {fileID: 0}
--- !u!1 &1535968660
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1535968661}
- component: {fileID: 1535968663}
- component: {fileID: 1535968662}
m_Layer: 5
m_Name: BG
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1535968661
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1535968660}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1877036977}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1535968662
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1535968660}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &1535968663
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1535968660}
m_CullTransparentMesh: 1
--- !u!1 &1612282031
GameObject:
m_ObjectHideFlags: 0
@ -359,11 +611,108 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!224 &1739165038 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
m_PrefabInstance: {fileID: 1979632678971496540}
--- !u!1 &1877036976
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1877036977}
- component: {fileID: 1877036978}
- component: {fileID: 1877036979}
m_Layer: 5
m_Name: Player Health Bar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1877036977
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1877036976}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1535968661}
- {fileID: 313298548}
m_Father: {fileID: 2126071660}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 10, y: -10}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0, y: 1}
--- !u!114 &1877036978
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1877036976}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 0
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 0}
m_FillRect: {fileID: 313298548}
m_HandleRect: {fileID: 0}
m_Direction: 0
m_MinValue: 0
m_MaxValue: 1
m_WholeNumbers: 0
m_Value: 1
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
--- !u!114 &1877036979
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1877036976}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: aadb67b8f73573a44b31b015f38561ee, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &2126071656
GameObject:
m_ObjectHideFlags: 0
@ -455,6 +804,7 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1877036977}
- {fileID: 1302468887}
m_Father: {fileID: 0}
m_RootOrder: 2
@ -464,100 +814,3 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1001 &1979632678971496540
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1302468887}
m_Modifications:
- target: {fileID: 1979632678310270257, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_Name
value: Minion Icon
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_SizeDelta.x
value: 60
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_SizeDelta.y
value: 60
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1979632678310270258, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2fee1ea5c97c5a04bb2c5f1f685fc92e, type: 3}

View File

@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class HealthBar : MonoBehaviour {
Slider slider;
void Awake() {
slider = GetComponentInChildren<Slider>();
slider.value = 1f;
}
// Set health to a fraction between 0 and 1
public void SetHealthFraction(float value) {
if(value < 0f) {
slider.value = 0f;
} else if(value > 1f) {
slider.value = 1f;
} else {
slider.value = value;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: aadb67b8f73573a44b31b015f38561ee
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class MinionBar : MonoBehaviour {
@ -17,15 +18,32 @@ public class MinionBar : MonoBehaviour {
minionIcons[i] = newIconObj.GetComponent<MinionIcon>();
// minionIcons[i].icon = minionTypes.icon; // TODO
minionIcons[i].indexInMinionList = i;
minionIcons[currentIndex].UnSelect();
minionIcons[i].UnSelect();
}
minionIcons[currentIndex].Select();
}
public void ChangeSelectedIcon(int delta) {
public void ChangeSelectedIcon(InputAction.CallbackContext context) {
float floatDelta = context.ReadValue<float>();
int delta = 0;
if(floatDelta > 0.5f) {
delta = 1;
} else if(floatDelta < -0.5f) {
delta = -1;
}
minionIcons[currentIndex].UnSelect();
currentIndex = (currentIndex + delta) % minionTypes.Length;
currentIndex += delta;
if(currentIndex >= minionIcons.Length) {
currentIndex = 0;
} else if(currentIndex < 0) {
currentIndex = minionIcons.Length - 1;
}
minionIcons[currentIndex].Select();
// print("new selected minion type : " + currentIndex.ToString());
}
public Object GetCurrentMinion() {

View File

@ -31,6 +31,15 @@
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "SwitchMinion",
"type": "PassThrough",
"id": "d0405457-c534-4103-a0b6-cf113432b467",
"expectedControlType": "Axis",
"processors": "",
"interactions": "",
"initialStateCheck": false
}
],
"bindings": [
@ -209,6 +218,72 @@
"action": "Suck",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "QE",
"id": "7f731b6b-09d5-4df1-88b2-d5f24f5fdd8f",
"path": "1DAxis",
"interactions": "",
"processors": "",
"groups": "",
"action": "SwitchMinion",
"isComposite": true,
"isPartOfComposite": false
},
{
"name": "negative",
"id": "92a7acbf-263d-4b34-9b92-b4fd097ac639",
"path": "<Keyboard>/q",
"interactions": "",
"processors": "",
"groups": "",
"action": "SwitchMinion",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "positive",
"id": "c12b1f77-64b3-4626-8f69-02f43f77a73a",
"path": "<Keyboard>/e",
"interactions": "",
"processors": "",
"groups": "",
"action": "SwitchMinion",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "Bumpers",
"id": "c2a550ee-5ab5-4368-8e31-d29870aa7be0",
"path": "1DAxis",
"interactions": "",
"processors": "",
"groups": "",
"action": "SwitchMinion",
"isComposite": true,
"isPartOfComposite": false
},
{
"name": "negative",
"id": "1a0d3183-498e-4a7f-bf51-8b9dd889e653",
"path": "<Gamepad>/leftShoulder",
"interactions": "",
"processors": "",
"groups": "",
"action": "SwitchMinion",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "positive",
"id": "c1f320ef-6e29-4026-a29d-74e1fea256cb",
"path": "<Gamepad>/rightShoulder",
"interactions": "",
"processors": "",
"groups": "",
"action": "SwitchMinion",
"isComposite": false,
"isPartOfComposite": true
}
]
},