Commit c7a51212 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 efb7fb72 d3c18749
......@@ -38,7 +38,7 @@ MonoBehaviour:
moveSpeed: 30
maxJumpCount: 0
mass: 1
gravity: 3
gravity: 5
waterMoveState:
jumpForce: 15
smoothing: 0.03
......
fileFormatVersion: 2
guid: c8cb9794b39691c4b97290d4816afd9b
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: 128
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:
......@@ -1243,10 +1243,10 @@ MonoBehaviour:
m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ReferenceResolution: {x: 1920, y: 1080}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -74,6 +74,7 @@ public class PlayerAnimation : MonoBehaviour
switch (r_State.GetCurrentElement())
{
case InfusedElement.None:
print("RESET");
if(m_ScalingActive)ScaleReset();
if (m_RotationActive)
......@@ -84,8 +85,12 @@ public class PlayerAnimation : MonoBehaviour
break;
case InfusedElement.Air:
print("AIR");
m_CurrentAirCharges = r_State.GetCharges();
if (m_ScalingActive) ScalePlayer();
if (m_ScalingActive)
{
ScalePlayer();
}
/*if(m_isRotating) {
SetRotationOrbsActive(true, r_State.GetCharges());
......@@ -148,21 +153,27 @@ public class PlayerAnimation : MonoBehaviour
public void ScalePlayer()
{
m_CurrentAirCharges = r_State.GetCharges();
int diff = m_CurrentAirCharges - m_PreviousAirCharges;
//Debug.Log("current: " + currentCharges + " previous: " + m_PreviousCharges + " difference: " + diff);
if (!m_isAnimating || m_isAnimating)
{
if (diff > 0)
{
StartCoroutine(ScaleUp(m_PreviousAirCharges, m_CurrentAirCharges));
}
else
{
StartCoroutine(ScaleDown(m_PreviousAirCharges, m_CurrentAirCharges));
}
}
var scaleFactor = 1.0f + m_CurrentAirCharges * 0.2f;
var direction = Mathf.Sign(this.gameObject.transform.localScale.x);
var newScale = new Vector3(direction * scaleFactor * m_OriginScale.x, scaleFactor * m_OriginScale.x, 0.0f);
this.gameObject.transform.localScale = newScale;
m_PreviousAirCharges = m_CurrentAirCharges;
// m_CurrentAirCharges = r_State.GetCharges();
// int diff = m_CurrentAirCharges - m_PreviousAirCharges;
// //Debug.Log("current: " + currentCharges + " previous: " + m_PreviousCharges + " difference: " + diff);
// if (!m_isAnimating || m_isAnimating)
// {
// if (diff > 0)
// {
// StartCoroutine(ScaleUp(m_PreviousAirCharges, m_CurrentAirCharges));
// }
// else
// {
// StartCoroutine(ScaleDown(m_PreviousAirCharges, m_CurrentAirCharges));
// }
// }
//
// m_PreviousAirCharges = m_CurrentAirCharges;
}
private void ScaleReset()
......@@ -172,23 +183,23 @@ public class PlayerAnimation : MonoBehaviour
transform.localScale = s;
}
private IEnumerator ScaleUp(float from, float to)
{
m_isAnimating = true;
float newSize = m_SizePerCharge * Mathf.Abs((to - from));
transform.localScale += new Vector3(newSize * Mathf.Sign(transform.localScale.x), newSize, newSize);
yield return null;
m_isAnimating = false;
}
private IEnumerator ScaleDown(float from, float to)
{
m_isAnimating = true;
float newSize = m_SizePerCharge * Mathf.Abs((to - from));
transform.localScale -= new Vector3(newSize * Mathf.Sign(transform.localScale.x), newSize, newSize);
yield return null;
m_isAnimating = false;
}
// private IEnumerator ScaleUp(float from, float to)
// {
// m_isAnimating = true;
// float newSize = m_SizePerCharge * Mathf.Abs((to - from));
// transform.localScale += new Vector3(newSize * Mathf.Sign(transform.localScale.x), newSize, newSize);
// yield return null;
// m_isAnimating = false;
// }
//
// private IEnumerator ScaleDown(float from, float to)
// {
// m_isAnimating = true;
// float newSize = m_SizePerCharge * Mathf.Abs((to - from));
// transform.localScale -= new Vector3(newSize * Mathf.Sign(transform.localScale.x), newSize, newSize);
// yield return null;
// m_isAnimating = false;
// }
/*private IEnumerator ScaleUp(float from, float to)
......
......@@ -45,6 +45,11 @@ namespace _Game.Scripts.Player
_waterAttack.enabled = false;
}
private void OnDisable()
{
state.UpdateElement(InfusedElement.None);
}
private void Update()
{
if (Input.GetButtonDown("Fire1"))
......
......@@ -33,7 +33,7 @@ TagManager:
- Enemy
- MovableObject
- EnemyAttack
-
- Background
-
-
-
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment