Commit bd3cce18 authored by Isa's avatar Isa
parents 4d524d25 24c814f0
......@@ -12,17 +12,17 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 353b156b7c59b1c45a8767d7500b31fb, type: 3}
m_Name: PlayerState
m_EditorClassIdentifier:
currentInfusedElement: 0
currentInfusedElement: 2
currentMoveState:
jumpForce: 15
jumpForce: 10
smoothing: 0.03
airControl: 1
canSwim: 1
moveSpeed: 30
moveSpeed: 20
maxJumpCount: 1
mass: 1
gravity: 3
movementStates: {fileID: 11400000, guid: c757aad6925b37a46b916f609fa9012b, type: 2}
onElementInfused: {fileID: 11400000, guid: 7e5b80a8353af1846a878c3a997bdb4a, type: 2}
onChargeChange: {fileID: 11400000, guid: 6ec6544f645a9d1458383b111fcaf8b6, type: 2}
charges: 0
charges: 1
......@@ -143,3 +143,4 @@ MonoBehaviour:
m_EditorClassIdentifier:
destroyTime: 3
pushFactor: 5
pushEnemyFactor: 1000
......@@ -48,7 +48,7 @@ Rigidbody2D:
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 10000
m_Mass: 1
m_LinearDrag: 5
m_AngularDrag: 0.05
m_GravityScale: 5
......
......@@ -15,6 +15,7 @@ GameObject:
- component: {fileID: 5627041003248903908}
- component: {fileID: 8217090596470256212}
- component: {fileID: 820980056}
- component: {fileID: 4551173074651665413}
m_Layer: 14
m_Name: Feuer-Gegner
m_TagString: Fire
......@@ -49,7 +50,7 @@ Rigidbody2D:
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 10000
m_Mass: 1
m_LinearDrag: 5
m_AngularDrag: 0.05
m_GravityScale: 3
......@@ -177,6 +178,24 @@ Animator:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!114 &4551173074651665413
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1634356314439590}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3c0ce2eb523274b6fa61fccbf0227d85, type: 3}
m_Name:
m_EditorClassIdentifier:
m_MaxLife: 1
LostLife:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!1 &8738143122139646636
GameObject:
m_ObjectHideFlags: 0
......
......@@ -50,7 +50,7 @@ Rigidbody2D:
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 10
m_Mass: 1
m_LinearDrag: 5
m_AngularDrag: 0.05
m_GravityScale: 5
......
......@@ -51,7 +51,7 @@ Rigidbody2D:
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 3
m_Mass: 1
m_LinearDrag: 5
m_AngularDrag: 0.05
m_GravityScale: 0
......
......@@ -4139,7 +4139,7 @@ BoxCollider2D:
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 2, y: 2}
m_Size: {x: 5, y: 4}
m_EdgeRadius: 0
--- !u!50 &209653169
Rigidbody2D:
......@@ -10799,15 +10799,20 @@ PrefabInstance:
propertyPath: m_TagString
value: Interactive
objectReference: {fileID: 0}
- target: {fileID: 6240296448730384320, guid: a0c6081106659114387502f3e4d51362,
type: 3}
propertyPath: m_Layer
value: 15
objectReference: {fileID: 0}
- target: {fileID: 7732554449417407852, guid: a0c6081106659114387502f3e4d51362,
type: 3}
propertyPath: m_LocalPosition.x
value: 141.3
value: 141.22
objectReference: {fileID: 0}
- target: {fileID: 7732554449417407852, guid: a0c6081106659114387502f3e4d51362,
type: 3}
propertyPath: m_LocalPosition.y
value: 92.59
value: 92.72
objectReference: {fileID: 0}
- target: {fileID: 7732554449417407852, guid: a0c6081106659114387502f3e4d51362,
type: 3}
......@@ -10869,6 +10874,26 @@ PrefabInstance:
propertyPath: force
value: 10
objectReference: {fileID: 0}
- target: {fileID: 6184296985288555399, guid: a0c6081106659114387502f3e4d51362,
type: 3}
propertyPath: m_Layer
value: 15
objectReference: {fileID: 0}
- target: {fileID: 3590286897431027205, guid: a0c6081106659114387502f3e4d51362,
type: 3}
propertyPath: m_IsTrigger
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3590286897431027205, guid: a0c6081106659114387502f3e4d51362,
type: 3}
propertyPath: m_Size.x
value: 6
objectReference: {fileID: 0}
- target: {fileID: 3590286897431027205, guid: a0c6081106659114387502f3e4d51362,
type: 3}
propertyPath: m_Size.y
value: 6
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a0c6081106659114387502f3e4d51362, type: 3}
--- !u!4 &554033098 stripped
......@@ -15471,7 +15496,7 @@ Camera:
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 24375
m_Bits: 57143
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
......@@ -29915,7 +29940,7 @@ PrefabInstance:
- target: {fileID: 52145075018362291, guid: 2e3528907311e438dab0d393127aa332,
type: 3}
propertyPath: m_GroundedOffset.y
value: -0.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 52145075018362291, guid: 2e3528907311e438dab0d393127aa332,
type: 3}
......@@ -31290,6 +31315,11 @@ PrefabInstance:
propertyPath: m_TagString
value: Interactive
objectReference: {fileID: 0}
- target: {fileID: 6240296448730384320, guid: a0c6081106659114387502f3e4d51362,
type: 3}
propertyPath: m_Layer
value: 15
objectReference: {fileID: 0}
- target: {fileID: 7732554449417407852, guid: a0c6081106659114387502f3e4d51362,
type: 3}
propertyPath: m_LocalPosition.x
......@@ -37613,6 +37643,11 @@ PrefabInstance:
propertyPath: m_TagString
value: Interactive
objectReference: {fileID: 0}
- target: {fileID: 6240296448730384320, guid: a0c6081106659114387502f3e4d51362,
type: 3}
propertyPath: m_Layer
value: 15
objectReference: {fileID: 0}
- target: {fileID: 7732554449417407852, guid: a0c6081106659114387502f3e4d51362,
type: 3}
propertyPath: m_LocalPosition.x
......@@ -90,7 +90,7 @@ public class AI_DashAttack : WeightedAction
IEnumerator windUp(Vector3 attackdir)
{
float updateTarget = windUpTime;
float currentTime = 0.0f;
//float currentTime = 0.0f;
//do
//{
......
......@@ -12,7 +12,7 @@ namespace _Game.Scripts.Level_Hazards
_rigidbody2D = this.GetComponentInParent<Rigidbody2D>();
}
private void OnCollisionEnter2D(Collision2D other)
private void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.layer == LayerMask.NameToLayer("Player") || other.gameObject.layer == LayerMask.NameToLayer("Enemy") ||
other.gameObject.CompareTag("Fire"))
......@@ -22,13 +22,13 @@ namespace _Game.Scripts.Level_Hazards
}
}
private void OnCollisionExit2D(Collision2D other)
private void OnTriggerExit2D(Collider2D other)
{
if (other.gameObject.layer == LayerMask.NameToLayer("Player") || other.gameObject.layer == LayerMask.NameToLayer("Enemy") ||
other.gameObject.CompareTag("Fire"))
{
_rigidbody2D.velocity = Vector2.zero;
_rigidbody2D.bodyType = RigidbodyType2D.Dynamic;
_rigidbody2D.velocity = Vector2.zero;
}
}
}
......
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
......@@ -42,8 +43,8 @@ public class MovementController : MonoBehaviour
private ContactFilter2D m_ContactFilter2D;
private Vector3 m_CurrentGroundNormal;
private bool m_isMoving = false;
private bool m_isJumping = false;
//private bool m_isMoving = false;
//private bool m_isJumping = false;
private Vector2 m_Movement = Vector2.zero;
[Header("Events")] [Space]
......
......@@ -6,6 +6,7 @@ namespace _Game.Scripts.Player.PlayerAttacks.Water
{
public float destroyTime = 2.0f;
public float pushFactor = 1.0f;
public float pushEnemyFactor = 1.0f;
private float _startTime;
private float _deltaTime;
private float _newScaleFactor;
......@@ -44,15 +45,34 @@ namespace _Game.Scripts.Player.PlayerAttacks.Water
{
if (other.gameObject.layer == LayerMask.NameToLayer("MovableObject"))
{
if (Mathf.Abs(_rigidbody2D.velocity.x) > 0.0001f)
if (Mathf.Abs(_rigidbody2D.velocity.x) > 0.0f)
{
var projectileVelocityX = _rigidbody2D.velocity.x / Mathf.Abs(_rigidbody2D.velocity.x);
print(projectileVelocityX);
var velocity = _rigidbody2D.velocity;
var projectileVelocityX = velocity.x / Mathf.Abs(velocity.x);
other.gameObject.GetComponent<Rigidbody2D>().velocity = new Vector3(projectileVelocityX * pushFactor, 0.0f, 0.0f);
Destroy();
}
}
Destroy();
else if (other.gameObject.layer == LayerMask.NameToLayer("Enemy"))
{
if (other.gameObject.CompareTag("Fire"))
{
other.gameObject.GetComponent<Life>().Damage(1);
}
if (Mathf.Abs(_rigidbody2D.velocity.x) > 0.0f)
{
var velocity = _rigidbody2D.velocity;
var projectileVelocityX = velocity.x / Mathf.Abs(velocity.x);
other.gameObject.GetComponent<Rigidbody2D>().AddForce(new Vector2(projectileVelocityX * pushEnemyFactor, 0.0f));
}
Destroy();
}
else if (other.gameObject.CompareTag("DestroyableByFire"))
{
Destroy();
}
}
}
......
......@@ -30,7 +30,7 @@ TagManager:
- ElementalAttacks
- BackgroundTileMap
- Enemy
-
- MovableObject
-
-
-
......
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