new movement
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b4dc5f685f8edc4bbba6fb0c8ea39ba
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8851c5995be5f704babebf752d60b4e2
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88c6da05db186cb44a4453fd624b31b2
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -38,7 +38,7 @@ RenderSettings:
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0.56158954, g: 0.7218083, b: 0.8178571, a: 1}
|
||||
m_IndirectSpecularColor: {r: 0.5615895, g: 0.72180885, b: 0.81785697, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
@@ -157,6 +157,127 @@ Transform:
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
|
||||
--- !u!1 &284201298
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 284201299}
|
||||
- component: {fileID: 284201302}
|
||||
- component: {fileID: 284201301}
|
||||
- component: {fileID: 284201300}
|
||||
m_Layer: 5
|
||||
m_Name: Jump
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &284201299
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 284201298}
|
||||
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_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 871711471}
|
||||
m_RootOrder: 2
|
||||
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: 12.5, y: -7}
|
||||
m_SizeDelta: {x: 275, y: 1731.3}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &284201300
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 284201298}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, 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: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 0}
|
||||
m_PressedColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_SelectedColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_DisabledColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
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: 2129484389}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &284201301
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 284201298}
|
||||
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: 0}
|
||||
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: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
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 &284201302
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 284201298}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &481417097
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -281,6 +402,9 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1572233530}
|
||||
- {fileID: 2129484387}
|
||||
- {fileID: 284201299}
|
||||
- {fileID: 2069815690}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 9
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -425,8 +549,12 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
rb: {fileID: 7917514869596290073}
|
||||
jumpforce: 350
|
||||
holdTime: 0.15
|
||||
jumpforce: 10
|
||||
holdTime: 0.2
|
||||
activeControllType: 0
|
||||
leftButton: {fileID: 2129484388}
|
||||
jumpButton: {fileID: 284201300}
|
||||
rightButton: {fileID: 2069815691}
|
||||
--- !u!114 &1201779185
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1174,6 +1302,248 @@ Transform:
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
--- !u!1 &2069815689
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2069815690}
|
||||
- component: {fileID: 2069815693}
|
||||
- component: {fileID: 2069815692}
|
||||
- component: {fileID: 2069815691}
|
||||
m_Layer: 5
|
||||
m_Name: GoRight
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2069815690
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2069815689}
|
||||
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_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 871711471}
|
||||
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: 275, y: 0.0089758}
|
||||
m_SizeDelta: {x: 250, y: 1731.3}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &2069815691
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2069815689}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, 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: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 0}
|
||||
m_PressedColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_SelectedColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_DisabledColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
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: 2129484389}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &2069815692
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2069815689}
|
||||
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: 0}
|
||||
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: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
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 &2069815693
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2069815689}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &2129484386
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2129484387}
|
||||
- component: {fileID: 2129484390}
|
||||
- component: {fileID: 2129484389}
|
||||
- component: {fileID: 2129484388}
|
||||
m_Layer: 5
|
||||
m_Name: GoLeft
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2129484387
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2129484386}
|
||||
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_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 871711471}
|
||||
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: -262.5, y: -0.0089696}
|
||||
m_SizeDelta: {x: 275, y: 1731.3}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &2129484388
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2129484386}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, 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: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 0}
|
||||
m_PressedColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_SelectedColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_DisabledColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
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: 2129484389}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &2129484389
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2129484386}
|
||||
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: 0}
|
||||
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: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
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 &2129484390
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2129484386}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &30613582022879756
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -10397,7 +10767,7 @@ Rigidbody:
|
||||
m_Mass: 1
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0
|
||||
m_UseGravity: 1
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 112
|
||||
@@ -10411,7 +10781,7 @@ CapsuleCollider:
|
||||
m_GameObject: {fileID: 7398140401948337837}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
m_Radius: 1.7212968
|
||||
m_Height: 6.3698125
|
||||
m_Direction: 1
|
||||
|
||||
@@ -6,6 +6,15 @@ public class CoinCounter : MonoBehaviour
|
||||
{
|
||||
public ulong coin = 0; //szedje le db-bol a playerhez a coint
|
||||
|
||||
private DatabaseData dd;
|
||||
|
||||
//get player coin at startup based on username
|
||||
private void Awake() {
|
||||
dd = FindObjectOfType<DatabaseData>();
|
||||
|
||||
//dd.GetCoinData("Playmaker1210");
|
||||
}
|
||||
|
||||
public void AddCoin(ulong number){
|
||||
coin += number;
|
||||
}
|
||||
|
||||
@@ -12,10 +12,13 @@ public class DatabaseData : MonoBehaviour
|
||||
public HighScoreTable hst; //high score table ui
|
||||
public string jsondata; //json szoveg
|
||||
|
||||
private CoinCounter coinc;
|
||||
|
||||
private void Awake() {
|
||||
hst = FindObjectOfType<HighScoreTable>(); //High Score Table referencia
|
||||
htdc = new HighScoreTableDataContainer(); //High Score Table Container objektum
|
||||
players = new PlayerList(); //jatekos lista osztaly
|
||||
coinc = FindObjectOfType<CoinCounter>();
|
||||
}
|
||||
|
||||
private void Start() {
|
||||
@@ -37,6 +40,8 @@ public class DatabaseData : MonoBehaviour
|
||||
public void PostNewScoreData() => StartCoroutine(IPostNewScoreData());
|
||||
public void PostNewPalyaData() => StartCoroutine(IPostNewPalyaData());
|
||||
|
||||
public void GetCoinData(string username) => StartCoroutine(IGetPlayerCoins(username));
|
||||
|
||||
private IEnumerator IGetPlayerData() {
|
||||
input.text = "Loading..."; //ideiglenes szoveg amig nem jelenik meg az adat szoveg
|
||||
|
||||
@@ -66,6 +71,30 @@ public class DatabaseData : MonoBehaviour
|
||||
}
|
||||
|
||||
|
||||
private IEnumerator IGetCurretPlayer(int userid){
|
||||
string uri = "http://localhost:3000/currentplayer";
|
||||
|
||||
var uwr = new UnityWebRequest(uri, "POST");
|
||||
byte[] jsonToSend = new System.Text.UTF8Encoding().GetBytes("{\"bevitel1\":"+userid+"}"); //palya id megadasa
|
||||
uwr.uploadHandler = (UploadHandler)new UploadHandlerRaw(jsonToSend); //felkuldi a palya id-t
|
||||
uwr.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
|
||||
uwr.SetRequestHeader("Content-Type", "application/json");
|
||||
|
||||
yield return uwr.SendWebRequest();
|
||||
|
||||
if (uwr.isNetworkError) {
|
||||
Debug.Log(uwr.error);
|
||||
} else {
|
||||
jsondata = uwr.downloadHandler.text; //json szoveg eltarolasa
|
||||
Debug.Log("current player json: " + jsondata);
|
||||
jsonParser(jsondata); //json adat atalakitasa
|
||||
foreach(var p in players.player) {
|
||||
p.ConvertDate(); //datum eltarolasa es atalakitasa datum tipussa
|
||||
Debug.Log("p_id: " + p.player_id + " username: " + p.player_name + " join date: " + p.joindate.printDate() + "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator IGetHighScoreData(int palya_id){
|
||||
string uri = "http://localhost:3000/toplist";
|
||||
|
||||
@@ -104,7 +133,7 @@ public class DatabaseData : MonoBehaviour
|
||||
Debug.Log(uwr.error);
|
||||
} else {
|
||||
Debug.Log(uwr.downloadHandler.text);
|
||||
|
||||
coinc.coin = ulong.Parse(uwr.downloadHandler.text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class PlayerController : MonoBehaviour
|
||||
{
|
||||
@@ -16,49 +17,78 @@ public class PlayerController : MonoBehaviour
|
||||
private Vector2 startTouchPosition; //erintes kezdo pozicio
|
||||
private Vector2 endTouchPosition; //erintes vegpozicio
|
||||
|
||||
public ControllType activeControllType;
|
||||
|
||||
public Button leftButton;
|
||||
public Button jumpButton;
|
||||
public Button rightButton;
|
||||
|
||||
public enum ControllType
|
||||
{
|
||||
Swipe,
|
||||
Button
|
||||
}
|
||||
|
||||
private void Awake() {
|
||||
cc = FindObjectOfType<CameraController>(); //kamera vezerlo referencia
|
||||
activeControllType = ControllType.Button;
|
||||
}
|
||||
|
||||
public void setControllType(ControllType controlltype){
|
||||
activeControllType = controlltype;
|
||||
}
|
||||
|
||||
private void Update(){
|
||||
//jumping
|
||||
if(Input.touchCount > 0){
|
||||
Touch touch = Input.GetTouch(0); //elso erintes lekerese
|
||||
|
||||
if(activeControllType == ControllType.Swipe){
|
||||
leftButton.gameObject.SetActive(false);
|
||||
jumpButton.gameObject.SetActive(false);
|
||||
rightButton.gameObject.SetActive(false);
|
||||
|
||||
if(touch.phase == TouchPhase.Began){ //ha az erintes elkezdotott
|
||||
isTapped = true;
|
||||
timeSinceLastTap = Time.time;
|
||||
}
|
||||
//jumping
|
||||
if(Input.touchCount > 0){
|
||||
Touch touch = Input.GetTouch(0); //elso erintes lekerese
|
||||
|
||||
if(touch.phase == TouchPhase.Ended){ //ha az erintes befejezodott
|
||||
isTapped = false;
|
||||
timeSinceLastTap = 0f;
|
||||
}
|
||||
if(touch.phase == TouchPhase.Began){ //ha az erintes elkezdotott
|
||||
isTapped = true;
|
||||
timeSinceLastTap = Time.time;
|
||||
}
|
||||
|
||||
if(isTapped && rb.transform.position.y <= 0.16f){
|
||||
if(Time.time - timeSinceLastTap >= holdTime){ //ha nyomva tartotta a beallitott ideig
|
||||
Debug.Log("Long tapped");
|
||||
rb.AddForce(new Vector3(0, jumpforce, 0)); //ugras
|
||||
if(touch.phase == TouchPhase.Ended){ //ha az erintes befejezodott
|
||||
isTapped = false;
|
||||
timeSinceLastTap = 0f;
|
||||
}
|
||||
|
||||
if(isTapped && rb.transform.position.y <= 0.16f){
|
||||
if(Time.time - timeSinceLastTap >= holdTime){ //ha nyomva tartotta a beallitott ideig
|
||||
Debug.Log("Long tapped");
|
||||
jump();
|
||||
isTapped = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//new character controller with swipe lane changing
|
||||
if(Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began){ //elso erintes elkezdodott
|
||||
startTouchPosition = Input.GetTouch(0).position;
|
||||
}
|
||||
if(Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Ended){ //elso erintes befejezodott
|
||||
endTouchPosition = Input.GetTouch(0).position;
|
||||
|
||||
if(endTouchPosition.x < startTouchPosition.x){ //balra huzott
|
||||
//left
|
||||
goLeft();
|
||||
|
||||
}else if(endTouchPosition.x > startTouchPosition.x){ //jobbra huzott
|
||||
//right
|
||||
goRight();
|
||||
//new character controller with swipe lane changing
|
||||
if(Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began){ //elso erintes elkezdodott
|
||||
startTouchPosition = Input.GetTouch(0).position;
|
||||
}
|
||||
if(Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Ended){ //elso erintes befejezodott
|
||||
endTouchPosition = Input.GetTouch(0).position;
|
||||
|
||||
if(endTouchPosition.x < startTouchPosition.x){ //balra huzott
|
||||
//left
|
||||
goLeft();
|
||||
|
||||
}else if(endTouchPosition.x > startTouchPosition.x){ //jobbra huzott
|
||||
//right
|
||||
goRight();
|
||||
}
|
||||
}
|
||||
}else if(activeControllType == ControllType.Button){
|
||||
jumpforce = 2;
|
||||
leftButton.onClick.AddListener(goRight);
|
||||
jumpButton.onClick.AddListener(jump);
|
||||
rightButton.onClick.AddListener(goLeft);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,4 +103,8 @@ public class PlayerController : MonoBehaviour
|
||||
cc.xPostion = 3; //kamera xPozicioja
|
||||
rb.transform.position = new Vector3(rb.transform.position.x - sideMovement, rb.transform.position.y, rb.transform.position.z);
|
||||
}
|
||||
|
||||
private void jump(){
|
||||
rb.AddForce(new Vector3(0, jumpforce, 0)); //ugras
|
||||
}
|
||||
}
|
||||
21
Assets/Scripts/SetButtonSize.cs
Normal file
21
Assets/Scripts/SetButtonSize.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
public class SetButtonSize : MonoBehaviour
|
||||
{
|
||||
public Canvas canvas;
|
||||
public Button leftButton;
|
||||
public Button jumpButton;
|
||||
public Button rightButton;
|
||||
|
||||
private Vector2 canvasSize;
|
||||
|
||||
private void Awake() {
|
||||
canvasSize = new Vector2(canvas.GetComponent<RectTransform>().rect.width, canvas.GetComponent<RectTransform>().rect.height);
|
||||
|
||||
///leftButton
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/SetButtonSize.cs.meta
Normal file
11
Assets/Scripts/SetButtonSize.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e84dc5ac17504204da8ccd1fb2c9bbfe
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -2,7 +2,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using System.Threading;
|
||||
using UnityEditor;
|
||||
|
||||
public class fps : MonoBehaviour
|
||||
{
|
||||
@@ -13,10 +13,12 @@ public class fps : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (Time.unscaledTime > _timer) {
|
||||
int fps = (int)(1f / Time.unscaledDeltaTime);
|
||||
fpsText.text = "FPS: " + fps;
|
||||
_timer = Time.unscaledTime + _hudRefreshRate;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user