mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-04-26 02:00:54 -05:00
Implemented tooltips when hovering over an item
Added some placeholder images for the items in the game made small adjustments to grapple
This commit is contained in:
parent
3b451b97e9
commit
7526d16f75
|
|
@ -92,7 +92,7 @@ GameObject:
|
|||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5926263001551059217
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -109,7 +109,7 @@ RectTransform:
|
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 2.14, y: 0.05}
|
||||
m_AnchoredPosition: {x: -1.1, y: 0.05}
|
||||
m_SizeDelta: {x: 50.06, y: 38.95}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4598139096192699238
|
||||
|
|
@ -184,7 +184,7 @@ RectTransform:
|
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: -14.9}
|
||||
m_AnchoredPosition: {x: 0, y: -24.5}
|
||||
m_SizeDelta: {x: 10, y: 20}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2852435069663319190
|
||||
|
|
@ -263,7 +263,7 @@ RectTransform:
|
|||
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: 11.7}
|
||||
m_AnchoredPosition: {x: -0.79999924, y: 20.8}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8447329698570405360
|
||||
|
|
@ -320,6 +320,7 @@ GameObject:
|
|||
- component: {fileID: 8447329698821624898}
|
||||
- component: {fileID: 8447329698821624899}
|
||||
- component: {fileID: 8447329698821624896}
|
||||
- component: {fileID: 4761166964501886857}
|
||||
m_Layer: 5
|
||||
m_Name: ItemButtonPrefab
|
||||
m_TagString: Untagged
|
||||
|
|
@ -432,3 +433,16 @@ MonoBehaviour:
|
|||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &4761166964501886857
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8447329698821624902}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Delegates: []
|
||||
|
|
|
|||
|
|
@ -1460,6 +1460,7 @@ RectTransform:
|
|||
- {fileID: 697221495148640912}
|
||||
- {fileID: 1354363586255247205}
|
||||
- {fileID: 1795553190}
|
||||
- {fileID: 1940408589166091606}
|
||||
m_Father: {fileID: 2890392181480129904}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
|
|
@ -1744,6 +1745,57 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
itemOptPrefab: {fileID: 8447329698821624902, guid: 51a78c57dc85625428c8f1e6448d113f, type: 3}
|
||||
tooltip: {fileID: 0}
|
||||
--- !u!1 &3548362138872994707
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1940408589166091606}
|
||||
- component: {fileID: 2362000826974438061}
|
||||
m_Layer: 0
|
||||
m_Name: ItemToolTip
|
||||
m_TagString: ItemToolTip
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1940408589166091606
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3548362138872994707}
|
||||
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: 7119411616833668051}
|
||||
- {fileID: 2914135550224794992}
|
||||
m_Father: {fileID: 7654765330931903944}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -352, y: 424}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &2362000826974438061
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3548362138872994707}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e05f2efa35eb1c448a50c01fd550ede7, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &3651501461169106465
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -1922,6 +1974,81 @@ CanvasRenderer:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3975031492042563123}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &4147883257800441090
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7119411616833668051}
|
||||
- component: {fileID: 6630021293889268234}
|
||||
- component: {fileID: 3065999160318194414}
|
||||
m_Layer: 0
|
||||
m_Name: Background
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &7119411616833668051
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4147883257800441090}
|
||||
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: 1940408589166091606}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -2.8183, y: 0}
|
||||
m_SizeDelta: {x: 325.1004, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6630021293889268234
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4147883257800441090}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3065999160318194414
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4147883257800441090}
|
||||
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: 1, g: 1, b: 1, 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!1 &4248081166335110465
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -2144,6 +2271,85 @@ MonoBehaviour:
|
|||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &4825862359276003384
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2914135550224794992}
|
||||
- component: {fileID: 7179199273450519475}
|
||||
- component: {fileID: 1931036265039930982}
|
||||
m_Layer: 0
|
||||
m_Name: Text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2914135550224794992
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4825862359276003384}
|
||||
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: 1940408589166091606}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 11.2}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7179199273450519475
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4825862359276003384}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1931036265039930982
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4825862359276003384}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, 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_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 14
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: PlaceHolder Tooltip
|
||||
--- !u!1 &6980124757043343321
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -2771,6 +2977,11 @@ PrefabInstance:
|
|||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 25b0bd1c83713d44ab76eaa07a6357fa, type: 3}
|
||||
--- !u!224 &3732651221136882027 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 2004584391902020887, guid: 25b0bd1c83713d44ab76eaa07a6357fa, type: 3}
|
||||
m_PrefabInstance: {fileID: 2890392183042899068}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &5410293111695408891 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 7136380821082899079, guid: 25b0bd1c83713d44ab76eaa07a6357fa, type: 3}
|
||||
|
|
@ -2782,11 +2993,6 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 311c1a64d12df464ab0b856d2aa3e5ae, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!224 &3732651221136882027 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 2004584391902020887, guid: 25b0bd1c83713d44ab76eaa07a6357fa, type: 3}
|
||||
m_PrefabInstance: {fileID: 2890392183042899068}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &6471307727058244567
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
|||
|
|
@ -1,13 +1,19 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
[CreateAssetMenu]
|
||||
public class Item: ScriptableObject {
|
||||
|
||||
//Set item characteristics
|
||||
public int id;
|
||||
public string itemName;
|
||||
public string description;
|
||||
public Sprite itemSprite;
|
||||
[Space]
|
||||
|
||||
//Set item values
|
||||
public float maxVelM;
|
||||
public float minVelM;
|
||||
public float curVelM;
|
||||
|
|
@ -19,7 +25,8 @@ public class Item: ScriptableObject {
|
|||
public float recovTimeM;
|
||||
public float playerGravM;
|
||||
public int costM;
|
||||
|
||||
|
||||
//Updates player values to equip the item
|
||||
public virtual void Equip(PlayerStats p, GameObject player){
|
||||
if(maxVelM != 0){
|
||||
p.MaxVel += maxVelM;
|
||||
|
|
@ -50,6 +57,7 @@ public class Item: ScriptableObject {
|
|||
}
|
||||
}
|
||||
|
||||
//Updates player values to unequip the item
|
||||
public virtual void Unequip(PlayerStats p, GameObject player){
|
||||
if(maxVelM != 0){
|
||||
p.MaxVel -= maxVelM;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ MonoBehaviour:
|
|||
id: 7
|
||||
itemName: Glider
|
||||
description: Player Will Fall slower
|
||||
itemSprite: {fileID: 7798176430303134427, guid: 7f448051c9c906545bfd88ed2754392b, type: 3}
|
||||
maxVelM: 0
|
||||
minVelM: 0
|
||||
curVelM: 0
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ MonoBehaviour:
|
|||
id: 8
|
||||
itemName: Grapple
|
||||
description: Allows the use of a grapple
|
||||
itemSprite: {fileID: -7389470788071104723, guid: 7f448051c9c906545bfd88ed2754392b, type: 3}
|
||||
maxVelM: 0
|
||||
minVelM: 0
|
||||
curVelM: 0
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ MonoBehaviour:
|
|||
id: 10
|
||||
itemName: Nitro
|
||||
description: Boosts player speed
|
||||
itemSprite: {fileID: -295526885773654649, guid: 7f448051c9c906545bfd88ed2754392b, type: 3}
|
||||
maxVelM: 0
|
||||
minVelM: 0
|
||||
curVelM: 0
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ MonoBehaviour:
|
|||
id: 2
|
||||
itemName: Roller Skates
|
||||
description: More Slidey But Faster
|
||||
itemSprite: {fileID: -3696225328785611619, guid: 7f448051c9c906545bfd88ed2754392b, type: 3}
|
||||
maxVelM: 15
|
||||
minVelM: 0
|
||||
curVelM: 0
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ MonoBehaviour:
|
|||
id: 3
|
||||
itemName: Springs
|
||||
description: Jump Higher
|
||||
itemSprite: {fileID: 3996138432854981312, guid: 7f448051c9c906545bfd88ed2754392b, type: 3}
|
||||
maxVelM: 0
|
||||
minVelM: 0
|
||||
curVelM: 0
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ MonoBehaviour:
|
|||
id: 5
|
||||
itemName: Triple Jump
|
||||
description: Player gets an extra jump but has less jump height
|
||||
itemSprite: {fileID: -8809284872407378732, guid: 7f448051c9c906545bfd88ed2754392b, type: 3}
|
||||
maxVelM: 0
|
||||
minVelM: 0
|
||||
curVelM: 0
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ MonoBehaviour:
|
|||
id: 6
|
||||
itemName: Wall Run
|
||||
description: Allows player to run on walls
|
||||
itemSprite: {fileID: -7634698977955767800, guid: 7f448051c9c906545bfd88ed2754392b, type: 3}
|
||||
maxVelM: 0
|
||||
minVelM: 0
|
||||
curVelM: 0
|
||||
|
|
@ -33,4 +34,3 @@ MonoBehaviour:
|
|||
hasNitroM: 0
|
||||
hasDashM: 0
|
||||
cooldownM: 0
|
||||
scriptM: {fileID: 11500000, guid: 535009eaa735a4c4e95c6fc270e32741, type: 3}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class InvSceneSettings : MonoBehaviour
|
|||
//Changes Button Texts
|
||||
iOpt.transform.Find("Name").GetComponent<Text>().text = item.Value.itemName;
|
||||
iOpt.transform.Find("Cost").GetComponent<Text>().text = item.Value.costM.ToString();
|
||||
//iOpt.GetComponentInChildren<Image>() = item.image; // IMPLEMENT WHEN ITEM OBJECT CONTAIN IMAGE REFERENCE
|
||||
iOpt.transform.Find("ItemImg").GetComponent<Image>().sprite = item.Value.itemSprite; // IMPLEMENT WHEN ITEM OBJECT CONTAIN IMAGE REFERENCE
|
||||
|
||||
index++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class LobbyItems : MonoBehaviour
|
||||
{
|
||||
|
|
@ -15,7 +16,8 @@ public class LobbyItems : MonoBehaviour
|
|||
|
||||
private PlayerStats pStats;
|
||||
|
||||
InventoryManager invMan;
|
||||
InventoryManager invMan;
|
||||
public Tooltip tooltip;
|
||||
Vector3 position;
|
||||
private int pointsLeft;
|
||||
|
||||
|
|
@ -27,6 +29,7 @@ public class LobbyItems : MonoBehaviour
|
|||
player = pPar.transform.Find("PlayerModel").gameObject;
|
||||
pStats = player.GetComponent<PlayerStats>();
|
||||
glueGooSlider = GameObject.Find("GlueGoo").GetComponent<Slider>();
|
||||
tooltip = GameObject.Find("ItemTooltip").GetComponent<Tooltip>();
|
||||
lobbyUI = this.gameObject.GetComponent<LobbyUI>();
|
||||
pInv = player.GetComponent<PlayerInventory>();
|
||||
player.GetComponent<PlayerMovement>().enabled = false;
|
||||
|
|
@ -69,11 +72,24 @@ public class LobbyItems : MonoBehaviour
|
|||
|
||||
//Button Adds item if it can
|
||||
iOpt.GetComponent<Button>().onClick.AddListener(delegate{lobbyUI.EquipItems(item.Value, UpdateObject(item.Value.costM, item.Value, iOpt));});
|
||||
|
||||
//On Hover display tooltip on exit disable
|
||||
EventTrigger.Entry tooltipEntry = new EventTrigger.Entry();
|
||||
EventTrigger.Entry tooltipExit = new EventTrigger.Entry();
|
||||
|
||||
tooltipEntry.eventID = EventTriggerType.PointerEnter;
|
||||
tooltipExit.eventID = EventTriggerType.PointerExit;
|
||||
|
||||
tooltipEntry.callback.AddListener((data) => {tooltip.ShowTooltip(item.Value.description);});
|
||||
tooltipExit.callback.AddListener((data) => {tooltip.HideTooltip();});
|
||||
|
||||
iOpt.GetComponent<EventTrigger>().triggers.Add(tooltipEntry);
|
||||
iOpt.GetComponent<EventTrigger>().triggers.Add(tooltipExit);
|
||||
|
||||
//Changes Button Texts
|
||||
iOpt.transform.Find("Name").GetComponent<Text>().text = item.Value.itemName;
|
||||
iOpt.transform.Find("Cost").GetComponent<Text>().text = item.Value.costM.ToString();
|
||||
//iOpt.GetComponentInChildren<Image>() = item.image; // IMPLEMENT WHEN ITEM OBJECT CONTAIN IMAGE REFERENCE
|
||||
iOpt.transform.Find("ItemImg").GetComponent<Image>().sprite = item.Value.itemSprite; // IMPLEMENT WHEN ITEM OBJECT CONTAIN IMAGE REFERENCE
|
||||
|
||||
index++;
|
||||
}
|
||||
|
|
|
|||
24
Assets/Scripts/UI/Lobby/Tooltip.cs
Normal file
24
Assets/Scripts/UI/Lobby/Tooltip.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class Tooltip : MonoBehaviour
|
||||
{
|
||||
|
||||
private Text tooltipText;
|
||||
|
||||
private void Start(){
|
||||
tooltipText = transform.Find("Text").GetComponent<Text>();
|
||||
HideTooltip();
|
||||
}
|
||||
|
||||
public void ShowTooltip(string curTooltip){
|
||||
gameObject.SetActive(true);
|
||||
tooltipText.text = curTooltip;
|
||||
}
|
||||
|
||||
public void HideTooltip(){
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/UI/Lobby/Tooltip.cs.meta
Normal file
11
Assets/Scripts/UI/Lobby/Tooltip.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e05f2efa35eb1c448a50c01fd550ede7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Sprites/Lobby/ItemSprites.png
Normal file
BIN
Assets/Sprites/Lobby/ItemSprites.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 779 KiB |
283
Assets/Sprites/Lobby/ItemSprites.png.meta
Normal file
283
Assets/Sprites/Lobby/ItemSprites.png.meta
Normal file
|
|
@ -0,0 +1,283 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7f448051c9c906545bfd88ed2754392b
|
||||
TextureImporter:
|
||||
internalIDToNameTable:
|
||||
- first:
|
||||
213: -3696225328785611619
|
||||
second: RollerSkates
|
||||
- first:
|
||||
213: -7634698977955767800
|
||||
second: Wallrun
|
||||
- first:
|
||||
213: 3996138432854981312
|
||||
second: Springs
|
||||
- first:
|
||||
213: -7389470788071104723
|
||||
second: GrapplingHook
|
||||
- first:
|
||||
213: -8809284872407378732
|
||||
second: TripleJump
|
||||
- first:
|
||||
213: 7798176430303134427
|
||||
second: Glider
|
||||
- first:
|
||||
213: -295526885773654649
|
||||
second: Nitro
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 2
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites:
|
||||
- serializedVersion: 2
|
||||
name: RollerSkates
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 159
|
||||
y: 637
|
||||
width: 492
|
||||
height: 553
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: d94aeeb95ae54bcc0800000000000000
|
||||
internalID: -3696225328785611619
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: Wallrun
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 167
|
||||
y: 144
|
||||
width: 515
|
||||
height: 420
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 3, z: 0, w: 0}
|
||||
outline:
|
||||
- - {x: -296.26367, y: 267.5}
|
||||
- {x: -291.5, y: -267.5}
|
||||
- {x: -45.5, y: -267.5}
|
||||
- {x: 71.5, y: -267.5}
|
||||
- {x: 200.5, y: -214.5}
|
||||
- {x: 296.5, y: -181.5}
|
||||
- {x: 296.5, y: 267.5}
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: 80a98ebdab91c0690800000000000000
|
||||
internalID: -7634698977955767800
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: Springs
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1473
|
||||
y: 673
|
||||
width: 387
|
||||
height: 614
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: 0ca7b937bb2257730800000000000000
|
||||
internalID: 3996138432854981312
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: GrapplingHook
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 750
|
||||
y: 657
|
||||
width: 591
|
||||
height: 531
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: d2f55e62873537990800000000000000
|
||||
internalID: -7389470788071104723
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: TripleJump
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 899
|
||||
y: 30
|
||||
width: 561
|
||||
height: 639
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: 4d49fe605122fb580800000000000000
|
||||
internalID: -8809284872407378732
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: Glider
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 2003
|
||||
y: 720
|
||||
width: 753
|
||||
height: 412
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: bd2ca089520b83c60800000000000000
|
||||
internalID: 7798176430303134427
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: Nitro
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1725
|
||||
y: 144
|
||||
width: 750
|
||||
height: 356
|
||||
alignment: 0
|
||||
pivot: {x: 0, y: 0}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: 78542e7fcd316ebf0800000000000000
|
||||
internalID: -295526885773654649
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: f1b95cbc2f2782f4faf111c9d12f131f
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -9,16 +9,16 @@ EditorUserSettings:
|
|||
value: 22424703114646680e0b0227036c78111b125507233d28242c20137df7ee3d2cfb
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-1:
|
||||
value: 22424703114646680e0b0227036c731f1415016439262f2434
|
||||
value: 22424703114646680e0b0227036c7b151b180b6501273035202c1327d1e33136e7a923e7ee2e26
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-2:
|
||||
value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-3:
|
||||
value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb
|
||||
value: 22424703114646680e0b0227036c731f1415016439262f2434
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-4:
|
||||
value: 22424703114646680e0b0227036c7b151b180b6501273035202c1327d1e33136e7a923e7ee2e26
|
||||
value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb
|
||||
flags: 0
|
||||
vcSharedLogLevel:
|
||||
value: 0d5e400f0650
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user