Commit 4a85b43e authored by Sebastian's avatar Sebastian

Experiment für Animation der Wasser-Attacke

parent 4252cd21
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp70</s:String></wpf:ResourceDictionary>
\ No newline at end of file
......@@ -141,4 +141,4 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: de4023dc2d7d96345a45b29dd765644a, type: 3}
m_Name:
m_EditorClassIdentifier:
destroyTime: 2
destroyTime: 3
......@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.18028334, g: 0.22571328, b: 0.3069217, a: 1}
m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
......@@ -402,7 +402,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 392034771}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 1.25, y: -0.25, z: 0}
m_LocalPosition: {x: 0.75, y: -0.375, z: 0}
m_LocalScale: {x: 1, y: 0.5, z: 1}
m_Children: []
m_Father: {fileID: 1876157337}
......@@ -714,6 +714,11 @@ PrefabInstance:
propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
- target: {fileID: 52145075018362284, guid: 2e3528907311e438dab0d393127aa332,
type: 3}
propertyPath: m_GravityScale
value: 1
objectReference: {fileID: 0}
- target: {fileID: 52145075018362285, guid: 2e3528907311e438dab0d393127aa332,
type: 3}
propertyPath: m_LocalPosition.x
......@@ -809,11 +814,6 @@ PrefabInstance:
propertyPath: m_MaxJumpCount
value: 2
objectReference: {fileID: 0}
- target: {fileID: 52145075018362284, guid: 2e3528907311e438dab0d393127aa332,
type: 3}
propertyPath: m_GravityScale
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6060985002925283250, guid: 2e3528907311e438dab0d393127aa332,
type: 3}
propertyPath: lowJumpMultiplier
......@@ -860,7 +860,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
Cooldown: 0
volleySize: 10
launchPower: 20
launchPower: 10
attackSpeed: 0.1
shotSpawn: {fileID: 1992150795}
fireBall: {fileID: 1870586037468468, guid: 61411254df3161c4e81f6c0a4f2cd33c, type: 3}
......
......@@ -105,7 +105,7 @@ public class MovementController : MonoBehaviour
public void Move(Vector2 move, bool jump)
{
Debug.Log(m_Swimming);
//Debug.Log(m_Swimming);
//only control the player if grounded or airControl is turned on
if (m_Grounded || m_AirControl || m_Swimming)
{
......
......@@ -40,8 +40,9 @@ namespace _Game.Scripts.Player.PlayerAttacks.Water
var direction = new Vector3(position.x - transform.position.x, 0.0f, 0.0f);
if (direction.x < 0)
{
projectile.transform.localScale = new Vector3(-projectile.transform.localScale.x,
projectile.transform.localScale.y, 0.0f);
var localScale = projectile.transform.localScale;
localScale = new Vector3(-localScale.x, localScale.y, 0.0f);
projectile.transform.localScale = localScale;
}
projectile.GetComponent<Rigidbody2D>().velocity = direction * launchPower;
yield return new WaitForSeconds(attackSpeed);
......
......@@ -7,31 +7,36 @@ namespace _Game.Scripts.Player.PlayerAttacks.Water
public float destroyTime = 2.0f;
private float _startTime;
private float _deltaTime;
private float _newScaleFactor;
private Vector3 _newScaleVector;
private Vector3 _startingScale;
private Rigidbody2D _rigidbody2D;
private Vector2 _startingVelocity;
private void Start()
{
_startTime = Time.time;
_startingScale = this.gameObject.transform.localScale;
_rigidbody2D = GetComponent<Rigidbody2D>();
_startingVelocity = _rigidbody2D.velocity;
}
private void Update()
{
_deltaTime = Time.time - _startTime;
if (!(_deltaTime > 1.0f)) return;
_deltaTime = (Time.time - _startTime) / destroyTime;
print("t: " + _deltaTime);
_newScaleFactor = _deltaTime * (1 - _deltaTime) * (1 - _deltaTime) / 0.1481481481481f;
print("f(" + _deltaTime + ")= " + _newScaleFactor);
var newScale = new Vector3(_startingScale.x * (2.0f - _deltaTime),
_startingScale.y * (2.0f - _deltaTime),
_startingScale.z * (2.0f - _deltaTime));
_newScaleVector = new Vector3(_newScaleFactor, _newScaleFactor, 0.0f);
this.gameObject.transform.localScale = newScale;
this.gameObject.transform.localScale = _newScaleVector;
_rigidbody2D.velocity = _startingVelocity * (1 - (1 - _deltaTime) * (1 - _deltaTime));
}
private void OnEnable()
{
Invoke("Destroy", destroyTime);
Invoke(nameof(Destroy), destroyTime);
}
private void Destroy()
......
......@@ -235,6 +235,7 @@ PlayerSettings:
tvOSManualSigningProvisioningProfileType: 0
appleEnableAutomaticSigning: 0
iOSRequireARKit: 0
iOSAutomaticallyDetectAndAddCapabilities: 1
appleEnableProMotion: 0
clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea
templatePackageId: com.unity.template.3d@1.0.4
......
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