Commit 79436b70 authored by Michael But's avatar Michael But

Merge branch 'master' of gitlab.fsi.hochschule-trier.de:GameDevWeek/ws-18_19/unity/suck-it

parents 0633109d 479aad87
......@@ -16,6 +16,28 @@ variables:
variables:
- $RUN_NON_RELEASE_BUILDS
.release_build:
artifacts:
expire_in: 1 week
WebGL [Release]:
when: on_success
pages:
when: on_success
start_in:
Deploy Nextcloud:
when: manual
allow_failure: false
start_in:
Release:
when: manual
allow_failure: false
dependencies:
- Deploy Nextcloud
include:
# Base
- https://gitlab.dragonixx.de/Dragonixx/gitlab-ci-toolbox/raw/master/scripts/unity/build-base.yml
......
......@@ -13,7 +13,7 @@ MonoBehaviour:
m_Name: Movement States
m_EditorClassIdentifier: Assembly-CSharp:_Game.Scripts.Scriptable_Object:MovementStates
airMoveState:
jumpForce: 5
jumpForce: 10
smoothing: 0.03
airControl: 1
canSwim: 1
......
......@@ -12,15 +12,17 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 353b156b7c59b1c45a8767d7500b31fb, type: 3}
m_Name: PlayerState
m_EditorClassIdentifier:
currentInfusedElement: 2
currentInfusedElement: 1
currentMoveState:
jumpForce: 10
jumpForce: 15
smoothing: 0.03
airControl: 1
canSwim: 1
moveSpeed: 20
maxJumpCount: 1
maxJumpCount: 2
mass: 1
gravity: 3
movementStates: {fileID: 11400000, guid: c757aad6925b37a46b916f609fa9012b, type: 2}
charges: 2
onElementInfused: {fileID: 11400000, guid: 7e5b80a8353af1846a878c3a997bdb4a, type: 2}
onChargeChange: {fileID: 11400000, guid: 6ec6544f645a9d1458383b111fcaf8b6, type: 2}
charges: 0
fileFormatVersion: 2
guid: f7ec8ad896f47904cb7499a6425f0c4c
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
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
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
Assets/_Game/Graphics/Sprite/HUD/Luft_1.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/Luft_1.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/Luft_1.png
Assets/_Game/Graphics/Sprite/HUD/Luft_1.png
Assets/_Game/Graphics/Sprite/HUD/Luft_1.png
Assets/_Game/Graphics/Sprite/HUD/Luft_1.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/Luft_2.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/Luft_2.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/Luft_2.png
Assets/_Game/Graphics/Sprite/HUD/Luft_2.png
Assets/_Game/Graphics/Sprite/HUD/Luft_2.png
Assets/_Game/Graphics/Sprite/HUD/Luft_2.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/Luft_3.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/Luft_3.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/Luft_3.png
Assets/_Game/Graphics/Sprite/HUD/Luft_3.png
Assets/_Game/Graphics/Sprite/HUD/Luft_3.png
Assets/_Game/Graphics/Sprite/HUD/Luft_3.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/Luft_4.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/Luft_4.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/Luft_4.png
Assets/_Game/Graphics/Sprite/HUD/Luft_4.png
Assets/_Game/Graphics/Sprite/HUD/Luft_4.png
Assets/_Game/Graphics/Sprite/HUD/Luft_4.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/Luft_5.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/Luft_5.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/Luft_5.png
Assets/_Game/Graphics/Sprite/HUD/Luft_5.png
Assets/_Game/Graphics/Sprite/HUD/Luft_5.png
Assets/_Game/Graphics/Sprite/HUD/Luft_5.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/erde_1.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/erde_1.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/erde_1.png
Assets/_Game/Graphics/Sprite/HUD/erde_1.png
Assets/_Game/Graphics/Sprite/HUD/erde_1.png
Assets/_Game/Graphics/Sprite/HUD/erde_1.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/erde_2.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/erde_2.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/erde_2.png
Assets/_Game/Graphics/Sprite/HUD/erde_2.png
Assets/_Game/Graphics/Sprite/HUD/erde_2.png
Assets/_Game/Graphics/Sprite/HUD/erde_2.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/erde_3.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/erde_3.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/erde_3.png
Assets/_Game/Graphics/Sprite/HUD/erde_3.png
Assets/_Game/Graphics/Sprite/HUD/erde_3.png
Assets/_Game/Graphics/Sprite/HUD/erde_3.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/erde_4.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/erde_4.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/erde_4.png
Assets/_Game/Graphics/Sprite/HUD/erde_4.png
Assets/_Game/Graphics/Sprite/HUD/erde_4.png
Assets/_Game/Graphics/Sprite/HUD/erde_4.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/erde_5.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/erde_5.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/erde_5.png
Assets/_Game/Graphics/Sprite/HUD/erde_5.png
Assets/_Game/Graphics/Sprite/HUD/erde_5.png
Assets/_Game/Graphics/Sprite/HUD/erde_5.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/fire_1.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/fire_1.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/fire_1.png
Assets/_Game/Graphics/Sprite/HUD/fire_1.png
Assets/_Game/Graphics/Sprite/HUD/fire_1.png
Assets/_Game/Graphics/Sprite/HUD/fire_1.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/fire_2.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/fire_2.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/fire_2.png
Assets/_Game/Graphics/Sprite/HUD/fire_2.png
Assets/_Game/Graphics/Sprite/HUD/fire_2.png
Assets/_Game/Graphics/Sprite/HUD/fire_2.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/fire_3.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/fire_3.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/fire_3.png
Assets/_Game/Graphics/Sprite/HUD/fire_3.png
Assets/_Game/Graphics/Sprite/HUD/fire_3.png
Assets/_Game/Graphics/Sprite/HUD/fire_3.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/fire_4.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/fire_4.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/fire_4.png
Assets/_Game/Graphics/Sprite/HUD/fire_4.png
Assets/_Game/Graphics/Sprite/HUD/fire_4.png
Assets/_Game/Graphics/Sprite/HUD/fire_4.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/fire_5.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/fire_5.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/fire_5.png
Assets/_Game/Graphics/Sprite/HUD/fire_5.png
Assets/_Game/Graphics/Sprite/HUD/fire_5.png
Assets/_Game/Graphics/Sprite/HUD/fire_5.png
  • 2-up
  • Swipe
  • Onion skin
fileFormatVersion: 2
guid: fceda3bd95cbcc34890b77ed58b7e07e
TextureImporter:
fileIDToRecycleName: {}
fileIDToRecycleName:
21300000: fire_5_0
21300002: fire_5_1
21300004: fire_5_2
21300006: fire_5_3
21300008: fire_5_4
externalObjects: {}
serializedVersion: 9
mipmaps:
......@@ -82,11 +87,111 @@ TextureImporter:
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
sprites:
- serializedVersion: 2
name: fire_5_0
rect:
serializedVersion: 2
x: 22
y: 14
width: 196
height: 196
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: f681a01cf01f3f541b32828838efbc82
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: fire_5_1
rect:
serializedVersion: 2
x: 244
y: 14
width: 196
height: 196
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 5bf806a92fd64b64493694f7ac4f5659
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: fire_5_2
rect:
serializedVersion: 2
x: 468
y: 14
width: 196
height: 196
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 8db3233c44b0e324b9bb72d620915851
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: fire_5_3
rect:
serializedVersion: 2
x: 686
y: 14
width: 196
height: 196
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: bbab3b146372cbb499453e04edf11172
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: fire_5_4
rect:
serializedVersion: 2
x: 910
y: 14
width: 196
height: 196
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: cb4ed6bcfe9c7df4eb47c41031b0204d
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []
spriteID:
spriteID: fd429e4f5c3f717448192609bf7e686f
vertices: []
indices:
edges: []
......
Assets/_Game/Graphics/Sprite/HUD/wasser_1.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/wasser_1.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/wasser_1.png
Assets/_Game/Graphics/Sprite/HUD/wasser_1.png
Assets/_Game/Graphics/Sprite/HUD/wasser_1.png
Assets/_Game/Graphics/Sprite/HUD/wasser_1.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/wasser_2.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/wasser_2.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/wasser_2.png
Assets/_Game/Graphics/Sprite/HUD/wasser_2.png
Assets/_Game/Graphics/Sprite/HUD/wasser_2.png
Assets/_Game/Graphics/Sprite/HUD/wasser_2.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/wasser_3.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/wasser_3.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/wasser_3.png
Assets/_Game/Graphics/Sprite/HUD/wasser_3.png
Assets/_Game/Graphics/Sprite/HUD/wasser_3.png
Assets/_Game/Graphics/Sprite/HUD/wasser_3.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/wasser_4.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/wasser_4.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/wasser_4.png
Assets/_Game/Graphics/Sprite/HUD/wasser_4.png
Assets/_Game/Graphics/Sprite/HUD/wasser_4.png
Assets/_Game/Graphics/Sprite/HUD/wasser_4.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/wasser_5.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/wasser_5.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/wasser_5.png
Assets/_Game/Graphics/Sprite/HUD/wasser_5.png
Assets/_Game/Graphics/Sprite/HUD/wasser_5.png
Assets/_Game/Graphics/Sprite/HUD/wasser_5.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
......@@ -190,10 +190,10 @@ SpriteRenderer:
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingLayerID: -480944179
m_SortingLayer: 2
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 3fc2bbd409bf34ab6af1637bab569da1, type: 3}
m_Sprite: {fileID: 21300000, guid: ecc204495234d40f091d828790c56287, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
......
......@@ -12287,19 +12287,6 @@ PrefabInstance:
propertyPath: m_Pivot.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114817957, guid: 50a0ddec8ac259c46a58a6b5324a759d, type: 3}
propertyPath: m_Name
value: Anzeige
objectReference: {fileID: 0}
- target: {fileID: 388107567, guid: 50a0ddec8ac259c46a58a6b5324a759d, type: 3}
propertyPath: ElementBox
value:
objectReference: {fileID: 0}
- target: {fileID: 388107565, guid: 50a0ddec8ac259c46a58a6b5324a759d, type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: 21300000, guid: 706d34e52b620a34abdffce7a27726a1,
type: 3}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 50a0ddec8ac259c46a58a6b5324a759d, type: 3}
--- !u!1 &1046025670
......
This diff is collapsed.
......@@ -956,6 +956,12 @@ PrefabInstance:
propertyPath: m_MaxJumpCount
value: 2
objectReference: {fileID: 0}
- target: {fileID: 52145075018362291, guid: 2e3528907311e438dab0d393127aa332,
type: 3}
propertyPath: r_State
value:
objectReference: {fileID: 11400000, guid: c5777bcc7b64ce24c9bd65d2c4b7c639,
type: 2}
- target: {fileID: 6060985002925283250, guid: 2e3528907311e438dab0d393127aa332,
type: 3}
propertyPath: lowJumpMultiplier
......@@ -1000,7 +1006,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 83eb4399ff535ee4cbc76de3b8a32e46, type: 3}
m_Name:
m_EditorClassIdentifier:
Cooldown: 0
cooldown: 0
volleySize: 10
launchPower: 10
attackSpeed: 0.1
......@@ -1018,6 +1024,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ad90db0185377664288543ce4696c6b8, type: 3}
m_Name:
m_EditorClassIdentifier:
cooldown: 0
massIncrease: 0
isStomping: 0
--- !u!114 &1876157330
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -1049,8 +1058,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
state: {fileID: 11400000, guid: c5777bcc7b64ce24c9bd65d2c4b7c639, type: 2}
onElementInfused: {fileID: 11400000, guid: 7e5b80a8353af1846a878c3a997bdb4a, type: 2}
onChargeChange: {fileID: 11400000, guid: 6ec6544f645a9d1458383b111fcaf8b6, type: 2}
onElementChanged: {fileID: 0}
--- !u!4 &1876157337 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 52145075018362285, guid: 2e3528907311e438dab0d393127aa332,
......
using UnityEngine;
using _Game.Scripts.Scriptable_Object;
namespace _Game.Scripts.Elements
{
public class InteractionObject : MonoBehaviour
{
[SerializeField] private InfusedElement element;
public void InfuseElement()
{
//this.GetComponent<SpriteRenderer>().color = Color.green;
Debug.Log("Infused " + this.gameObject.tag);
}
public InfusedElement GetElement()
{
return element;
}
}
}
......@@ -5,11 +5,11 @@ using UnityEngine;
[RequireComponent(typeof(MovementController))]
public class InputController : MonoBehaviour {
private MovementController m_Controller;
private MovementController m_Controller;
private float m_XAxis, m_YAxis;
private bool m_Jump = false;
void Start () {
void Start () {
//Sucht nach MovementController auf dem selben Gameobject
m_Controller = GetComponent<MovementController>();
}
......@@ -24,4 +24,4 @@ public class InputController : MonoBehaviour {
//Ruft Move Methode im MovementController auf dient der Bewegung des Charakters
m_Controller.Move(new Vector2(m_XAxis, m_YAxis), m_Jump);
}
}
\ No newline at end of file
}
......@@ -17,8 +17,9 @@ public class MovementController : MonoBehaviour
[SerializeField] private bool m_AirControl = false; // Whether or not a player can steer while jumping;
[SerializeField] private bool m_CanSwim = true;
[Header("Ground Check Control")]
[SerializeField] private LayerMask m_WhatIsGround; // A mask determining what is ground to the character
[Header("Ground Check Control")] [SerializeField]
private LayerMask m_WhatIsGround; // A mask determining what is ground to the character
[SerializeField] private Transform m_GroundCheck; // A position marking where to check if the player is grounded.
[SerializeField] private float m_GroundCheckDistance = 1.5f;
[SerializeField] private float m_GroundedRadius = .2f;
......@@ -47,19 +48,6 @@ public class MovementController : MonoBehaviour
public UnityEvent OnSwimEvent;
public UnityEvent OnJumpEvent;
public void SetMovementParameters(MovementState state)
{
m_JumpForce = state.jumpForce;
m_MovementSmoothing = state.smoothing;
m_AirControl = state.airControl;
m_CanSwim = state.canSwim;
m_Speed = state.moveSpeed;
m_MaxJumpCount = state.maxJumpCount;
m_Rigidbody2D.mass = state.mass;
m_Rigidbody2D.gravityScale = state.gravity;
}
private void Awake()
{
m_Rigidbody2D = GetComponent<Rigidbody2D>();
......@@ -96,7 +84,15 @@ public class MovementController : MonoBehaviour
if (m_RaycastHits2D[i].transform.gameObject == gameObject) continue;
m_Grounded = true;
m_TempJumpCount = m_MaxJumpCount;
if (r_State.GetCurrentElement() != InfusedElement.Air)
{
m_TempJumpCount = m_MaxJumpCount;
}
else
{
m_TempJumpCount = r_State.GetCharges();
}
m_CurrentGroundNormal = m_RaycastHits2D[i].normal;
if (!wasGrounded)
{
......@@ -106,7 +102,6 @@ public class MovementController : MonoBehaviour
}
public void Move(Vector2 move, bool jump)
{
//only control the player if grounded or airControl is turned on
......@@ -136,12 +131,18 @@ public class MovementController : MonoBehaviour
// If the player should jump...
if (jump)
{
if (((m_Grounded) || (m_TempJumpCount > 1) || (m_Swimming && m_CanSwim)) && !m_Jumped)
if (m_Grounded || (m_Swimming && m_CanSwim) && !m_Jumped)
{
m_Grounded = false;
m_Rigidbody2D.velocity = Vector2.up * m_JumpForce;
OnJumpEvent.Invoke();
StartCoroutine(Wait(m_SecondsWaitToJump));
}
else if ((m_TempJumpCount > 0) && !m_Jumped)
{
// Add a vertical force to the player.
m_Grounded = false;
m_TempJumpCount--;
//m_Rigidbody2D.AddForce (new Vector2 (0f, m_JumpForce));
if (r_State.GetCurrentElement() == InfusedElement.Air) r_State.ChangeCharges(-1);
m_Rigidbody2D.velocity = Vector2.up * m_JumpForce;
OnJumpEvent.Invoke();
StartCoroutine(Wait(m_SecondsWaitToJump));
......@@ -152,10 +153,23 @@ public class MovementController : MonoBehaviour
{
m_Rigidbody2D.velocity += Vector2.up * Physics2D.gravity.y * (m_fallMultiplier - 1) * Time.deltaTime;
}
//else if (m_Rigidbody2D.velocity.y > 0 && !Input.GetButton("Jump"))
//{
// m_Rigidbody2D.velocity += Vector2.up * Physics2D.gravity.y * (m_lowJumpMultiplier - 1) * Time.deltaTime;
//}
else if (m_Rigidbody2D.velocity.y > 0 && !Input.GetButton("Jump"))
{
m_Rigidbody2D.velocity += Vector2.up * Physics2D.gravity.y * (m_lowJumpMultiplier - 1) * Time.deltaTime;
}
}
public void UpdateMovementParameters()
{
MovementState state = r_State.GetCurrentMovementState();
m_JumpForce = state.jumpForce;
m_MovementSmoothing = state.smoothing;
m_AirControl = state.airControl;
m_CanSwim = state.canSwim;
m_Speed = state.moveSpeed;
m_MaxJumpCount = state.maxJumpCount;
m_Rigidbody2D.mass = state.mass;
m_Rigidbody2D.gravityScale = state.gravity;
}
public void SetSwimming(bool value)
......@@ -178,6 +192,12 @@ public class MovementController : MonoBehaviour
get => m_Grounded;
}
public float GroundCheckDistance
{
set => m_GroundCheckDistance = value;
get => m_GroundCheckDistance;
}
public void AddJumpCharge(int amount)
{
m_TempJumpCount += amount;
......@@ -203,14 +223,14 @@ public class MovementController : MonoBehaviour
private void OnCollisionEnter2D(Collision2D other)
{
if(other.gameObject.layer == m_WhatIsGround)
m_Airborn = false;
if (other.gameObject.layer == 9)
m_Airborn = false;
}
private void OnCollisionExit2D(Collision2D oth