Commit 3bc995eb authored by Marcel's avatar Marcel
Browse files

Made new Rolling Rock

Made Objects Destroyable
Made Destroyable Tilemap (script still need to find cordinates of collided tile)
Changed all prefabs byy adding a rigibody (this way the Objects are killable by script destroyableObject)
parent c3db1bf5
......@@ -12,6 +12,7 @@ GameObject:
- component: {fileID: 8671139320042682693}
- component: {fileID: 8671139320042682692}
- component: {fileID: 8671139320042682699}
- component: {fileID: 2667585793132650863}
m_Layer: 10
m_Name: ChainsawBody
m_TagString: Untagged
......@@ -110,6 +111,27 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
isActive: 1
--- !u!50 &2667585793132650863
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8671139320042682697}
m_BodyType: 1
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!1 &8671139320877819016
GameObject:
m_ObjectHideFlags: 0
......
......@@ -137,7 +137,7 @@ Transform:
m_GameObject: {fileID: 4248358191117056771}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -0.5, z: 0}
m_LocalScale: {x: 1, y: 0.01, z: 1}
m_LocalScale: {x: 0.2, y: 0.01, z: 1}
m_Children: []
m_Father: {fileID: 4248358192071150867}
m_RootOrder: 1
......@@ -249,6 +249,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
delay: 1
duration: 1
stopMoving: 0
--- !u!61 &4248358192071150865
BoxCollider2D:
m_ObjectHideFlags: 0
......
......@@ -12,6 +12,7 @@ GameObject:
- component: {fileID: 7984458161459817305}
- component: {fileID: 2321312583678718617}
- component: {fileID: 7453473848812878957}
- component: {fileID: 2391444694546659564}
m_Layer: 10
m_Name: InteractableSwitch
m_TagString: Untagged
......@@ -124,3 +125,24 @@ BoxCollider2D:
serializedVersion: 2
m_Size: {x: 1, y: 1}
m_EdgeRadius: 0
--- !u!50 &2391444694546659564
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6791149649588742782}
m_BodyType: 1
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
......@@ -128,6 +128,7 @@ GameObject:
- component: {fileID: 3794039801464086092}
- component: {fileID: 7679519307952437875}
- component: {fileID: 7057249509790504645}
- component: {fileID: 4948982492866293795}
m_Layer: 10
m_Name: undeadly
m_TagString: Untagged
......@@ -223,6 +224,27 @@ BoxCollider2D:
serializedVersion: 2
m_Size: {x: 1, y: 1}
m_EdgeRadius: 0
--- !u!50 &4948982492866293795
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4766415447895847532}
m_BodyType: 1
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!1 &7407489813404051582
GameObject:
m_ObjectHideFlags: 0
......
......@@ -138,6 +138,7 @@ GameObject:
- component: {fileID: 9184889176542841916}
- component: {fileID: 9184889176542841917}
- component: {fileID: 9184889176542841914}
- component: {fileID: 2742370736901239243}
m_Layer: 10
m_Name: undeadly
m_TagString: Untagged
......@@ -154,7 +155,7 @@ Transform:
m_GameObject: {fileID: 9184889176542841919}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 0.99, z: 1}
m_LocalScale: {x: 1, y: 0.98, z: 1}
m_Children: []
m_Father: {fileID: 9184889176000275760}
m_RootOrder: 0
......@@ -233,6 +234,27 @@ BoxCollider2D:
serializedVersion: 2
m_Size: {x: 1, y: 1}
m_EdgeRadius: 0
--- !u!50 &2742370736901239243
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9184889176542841919}
m_BodyType: 1
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!1 &9184889176668465866
GameObject:
m_ObjectHideFlags: 0
......@@ -242,7 +264,6 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 9184889176668465867}
- component: {fileID: 9184889176668465864}
- component: {fileID: 9184889176668465865}
- component: {fileID: 9184889176668465910}
m_Layer: 10
......@@ -260,60 +281,12 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9184889176668465866}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -0.5, z: 0}
m_LocalPosition: {x: 0, y: -0.52, z: 0}
m_LocalScale: {x: 1, y: 0.01, z: 1}
m_Children: []
m_Father: {fileID: 9184889176000275760}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &9184889176668465864
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9184889176668465866}
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: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: eba20f56bbf44134c8f2b6ad8d7b2511, 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 &9184889176668465865
BoxCollider2D:
m_ObjectHideFlags: 0
......
......@@ -12,6 +12,7 @@ GameObject:
- component: {fileID: 1091190892428747780}
- component: {fileID: 8871943169806726613}
- component: {fileID: 415701574014329241}
- component: {fileID: 664324248073965646}
m_Layer: 10
m_Name: PresurePlate
m_TagString: Untagged
......@@ -124,3 +125,24 @@ BoxCollider2D:
serializedVersion: 2
m_Size: {x: 1, y: 1}
m_EdgeRadius: 0
--- !u!50 &664324248073965646
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7703094825622915157}
m_BodyType: 1
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
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4689367952706587024
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4689367952706587036}
- component: {fileID: 4689367952706587027}
- component: {fileID: 4689367952706587026}
- component: {fileID: 4689367952706587025}
- component: {fileID: 4689367952706587037}
m_Layer: 10
m_Name: RoundRockDeadly
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4689367952706587036
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4689367952706587024}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -7.27, y: 6.42, z: 0.08203125}
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 &4689367952706587027
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4689367952706587024}
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: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: fd7e68a26b5f9d6409e5ac5061e76edc, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 5.12, y: 5.12}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!50 &4689367952706587026
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4689367952706587024}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 10
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!58 &4689367952706587025
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4689367952706587024}
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}
serializedVersion: 2
m_Radius: 0.5
--- !u!114 &4689367952706587037
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4689367952706587024}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a70b53356615793479d7ec4e4ea09abc, type: 3}
m_Name:
m_EditorClassIdentifier:
isActive: 1
fileFormatVersion: 2
guid: 8e4cdc9c1a25e194b97009cd8af37d3f
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -10,7 +10,7 @@ GameObject:
m_Component:
- component: {fileID: 3190373929610144333}
- component: {fileID: 3190373929610144331}
m_Layer: 0
m_Layer: 10
m_Name: SwingingAxe
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -59,7 +59,8 @@ GameObject:
- component: {fileID: 3190373929808458501}
- component: {fileID: 3190373929808458500}
- component: {fileID: 3190373929808458499}
m_Layer: 0
- component: {fileID: 8593111348574775526}
m_Layer: 10
m_Name: Deadly
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -157,6 +158,27 @@ CircleCollider2D:
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 0.35
--- !u!50 &8593111348574775526
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3190373929808458497}
m_BodyType: 1
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!1 &3190373929854477055
GameObject:
m_ObjectHideFlags: 0
......@@ -167,7 +189,7 @@ GameObject:
m_Component:
- component: {fileID: 3190373929854477040}
- component: {fileID: 3190373929854477041}
m_Layer: 0
m_Layer: 10
m_Name: Chain
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -176,7 +176,7 @@ public class GroupController : MonoBehaviour, IKillTarget
}
}
public void Die()
public void Die(GameObject other)
{
Debug.Log("Group gekillt");
}
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Tilemaps;
public class DestoryableTilemap : MonoBehaviour,IKillTarget
{
private Tilemap tilemap;
// Start is called before the first frame update
public void Die(GameObject other)
{
Debug.Log("test");
//TODO
tilemap = other.gameObject.GetComponent<Tilemap>();
Vector3 collision2D = other.gameObject.transform.position;
// Vector3 collision = new Vector3(collision2D.x, collision2D.y, 0f);
Vector3Int tilePos = tilemap.WorldToCell(collision2D);
tilemap.SetTile(tilePos, null);
Debug.Log(collision2D);
}
}
fileFormatVersion: 2
guid: 7eaab7c5d50c7d242a950c02e5c2ed0d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DestroyableObject : MonoBehaviour,IKillTarget
{
// Start is called before the first frame update
public void Die(GameObject other)
{
Transform thisGameObject = gameObject.transform;
while (thisGameObject.parent!=null)
{
thisGameObject = thisGameObject.parent;
}
Destroy(thisGameObject.gameObject);
}
}
fileFormatVersion: 2
guid: 554f5796680843b4db36a7aacfb506fa
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -5,5 +5,5 @@ using UnityEngine.EventSystems;
public interface IKillTarget : IEventSystemHandler
{
void Die();
void Die(GameObject other);
}
......@@ -12,7 +12,7 @@ public class KillGroup : MonoBehaviour, IKillTarget
}
public void Die()
public void Die(GameObject other)
{
Debug.Log("Group gekillt");
}
......
......@@ -14,7 +14,7 @@ public class KillLemming : MonoBehaviour, IKillTarget
}
public void Die()
public void Die(GameObject other)
{
animator.SetBool("Life", false);
groupController.RemoveLemmingFromGroup();
......
......@@ -10,7 +10,7 @@ public class DeadlyTilemap : MonoBehaviour
{
if (other.CompareTag("Player"))
{
ExecuteEvents.Execute<IKillTarget>(other.gameObject, null, (x, y) => x.Die());
ExecuteEvents.Execute<IKillTarget>(other.gameObject, null, (x, y) => x.Die(other.gameObject));
// TODO: Exchange tile here
}
}
......