Commit e0613cc9 authored by Isa's avatar Isa

Commit versuch 2

parents 31cc5191 bcab4339
......@@ -13,42 +13,47 @@ MonoBehaviour:
m_Name: Movement States
m_EditorClassIdentifier: Assembly-CSharp:_Game.Scripts.Scriptable_Object:MovementStates
airMoveState:
jumpForce: 0
smoothing: 0
airControl: 0
moveSpeed: 0
maxJumpCount: 0
mass: 0
gravity: 0
jumpForce: 5
smoothing: 0.03
airControl: 1
canSwim: 1
moveSpeed: 30
maxJumpCount: 5
mass: 0.1
gravity: 0.1
earthMoveState:
jumpForce: 0
smoothing: 0
jumpForce: 2
smoothing: 0.03
airControl: 0
moveSpeed: 0
maxJumpCount: 0
mass: 0
gravity: 0
canSwim: 0
moveSpeed: 15
maxJumpCount: 1
mass: 10
gravity: 1
fireMoveState:
jumpForce: 0
smoothing: 0
airControl: 0
moveSpeed: 0
maxJumpCount: 0
mass: 0
gravity: 0
jumpForce: 10
smoothing: 0.03
airControl: 1
canSwim: 0
moveSpeed: 20
maxJumpCount: 1
mass: 1
gravity: 1
waterMoveState:
jumpForce: 0
smoothing: 0
airControl: 0
moveSpeed: 0
maxJumpCount: 0
mass: 0
jumpForce: 7
smoothing: 0.03
airControl: 1
canSwim: 0
moveSpeed: 15
maxJumpCount: 1
mass: 3
gravity: 0
defaultMoveState:
jumpForce: 0
smoothing: 0
airControl: 0
moveSpeed: 0
maxJumpCount: 0
mass: 0
gravity: 0
jumpForce: 10
smoothing: 0.03
airControl: 1
canSwim: 0
moveSpeed: 20
maxJumpCount: 1
mass: 1
gravity: 1
......@@ -46,7 +46,7 @@ TextureImporter:
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 256
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteBorder: {x: 19, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3962879857309384166
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3962879857309384162}
- component: {fileID: 3962879857309384165}
- component: {fileID: 3962879857309384164}
- component: {fileID: 6533165481742465260}
- component: {fileID: 5221703142016690477}
m_Layer: 9
m_Name: EarthDestroyable
m_TagString: DestroyableByFire
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3962879857309384162
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3962879857309384166}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1.69, y: 0.29, z: 0}
m_LocalScale: {x: 3, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &3962879857309384165
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3962879857309384166}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: -614652393
m_SortingLayer: 4
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: d0cee4e8b659c5646ac1e205b88a3256, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!61 &3962879857309384164
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3962879857309384166}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 1, y: 1}
newSize: {x: 1, y: 1}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 1, y: 1}
m_EdgeRadius: 0
--- !u!50 &6533165481742465260
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3962879857309384166}
m_BodyType: 2
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 1
m_LinearDrag: 0
m_AngularDrag: 0.05
m_GravityScale: 1
m_Material: {fileID: 0}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0
--- !u!114 &5221703142016690477
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3962879857309384166}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e402a1ca7e485e41aba8eec20844bb6, type: 3}
m_Name:
m_EditorClassIdentifier:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6240296448730384320
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7732554449417407852}
- component: {fileID: 1297297354442121813}
- component: {fileID: 2063039573222851098}
m_Layer: 9
m_Name: Movable_Thing
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7732554449417407852
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6240296448730384320}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 133.12, y: 41.63, z: -0.017713891}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &1297297354442121813
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6240296448730384320}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: -480944179
m_SortingLayer: 2
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 5bccf13ce09bd43e39c1c3416d5de92c, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 2, y: 2}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!114 &2063039573222851098
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6240296448730384320}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d5c135c3fe901cf4696abeebd2ac1f28, type: 3}
m_Name:
m_EditorClassIdentifier:
force: 0
fileFormatVersion: 2
guid: a0c6081106659114387502f3e4d51362
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
fileFormatVersion: 2
guid: 27e7278dd5a505e4cb27d5799583c014
guid: bb75bae30384cdf4f8c6d84fb0364075
DefaultImporter:
externalObjects: {}
userData:
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using _Game.Scripts.Player.PlayerAttacks.Earth;
public class DestroyObjectByEarth : MonoBehaviour
{
void OnCollisionEnter2D(Collision2D other)
{
if (other.gameObject.GetComponent<PlayerEarthAttack>().isStomping)
{
Destroy(gameObject);
}
}
}
fileFormatVersion: 2
guid: 4e402a1ca7e485e41aba8eec20844bb6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -3,7 +3,7 @@ using System.Collections.Generic;
using UnityEngine;
[RequireComponent (typeof (BoxCollider2D))]
public class DestroyObject : MonoBehaviour {
public class DestroyObjectByFire : MonoBehaviour {
void OnCollisionEnter2D(Collision2D other)
{
......
using UnityEngine;
using System.Collections;
using UnityEngine;
namespace _Game.Scripts.Player.PlayerAttacks.Earth
{
public class PlayerEarthAttack : MonoBehaviour
{
private float nextFire;
public float Cooldown;
public float massIncrease;
public bool isStomping;
MovementController controller;
private RaycastHit2D[] RaycastHits2D = new RaycastHit2D[8];
private LayerMask whatIsDestroyable;
private ContactFilter2D contactFilter2D;
// Start is called before the first frame update
void Start()
{
controller = GetComponentInParent<MovementController>();
contactFilter2D.SetLayerMask(whatIsDestroyable);
}
// Update is called once per frame
void Update()
{
if (Input.GetButtonDown("Fire1") && Time.time > nextFire && !controller.Grounded)
{
nextFire = Time.time + Cooldown;
StartCoroutine(fire());
}
}
IEnumerator fire()
{
controller.GetComponentInParent<Rigidbody2D>().gravityScale *= massIncrease;
isStomping = true;
do
{
yield return new WaitForSeconds(0.01f);
} while (!controller.Grounded);
isStomping = false;
controller.GetComponentInParent<Rigidbody2D>().gravityScale /= massIncrease;
//var c = Physics2D.CircleCast(transform.position, 0.25f, Vector2.down, contactFilter2D, RaycastHits2D, 0.6f);
//for (var i = 0; i < c; i++)
//{
// if (RaycastHits2D[i].transform.gameObject == gameObject) continue;
// if (RaycastHits2D[i].transform.gameObject.CompareTag("DestroyableByEarth"))
// {
// Destroy(RaycastHits2D[i].transform.gameObject);
// }
//}
}
}
......
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