Wind blows over gaps
This commit is contained in:
Generated
+124
@@ -0,0 +1,124 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1001 &100100000
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 1
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications: []
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 0}
|
||||
m_RootGameObject: {fileID: 1602245136708268}
|
||||
m_IsPrefabParent: 1
|
||||
--- !u!1 &1602245136708268
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 4727204445767746}
|
||||
- component: {fileID: 212692672482381216}
|
||||
- component: {fileID: 61417820969500070}
|
||||
- component: {fileID: 114653526516097830}
|
||||
m_Layer: 0
|
||||
m_Name: Block_Water
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4727204445767746
|
||||
Transform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1602245136708268}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0.309, y: 0.434, z: 0.09194599}
|
||||
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!61 &61417820969500070
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1602245136708268}
|
||||
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: 0.16, y: 0.16}
|
||||
newSize: {x: 0.16, y: 0.16}
|
||||
adaptiveTilingThreshold: 0.5
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 0.16, y: 0.16}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!114 &114653526516097830
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1602245136708268}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 07e0c3a4814d62f418256b87b1da3ed5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!212 &212692672482381216
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1602245136708268}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
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: 21300004, guid: f0425e92c7345064ab2dccbd778f3b15, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 0.16, y: 0.16}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
Generated
+10
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 05968d49eff9aa04b9087b76d2a70f50
|
||||
timeCreated: 1524286841
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 100100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class BlockGap : MonoBehaviour {
|
||||
}
|
||||
Generated
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07e0c3a4814d62f418256b87b1da3ed5
|
||||
timeCreated: 1524286791
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -3,10 +3,16 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class BlockIce : MonoBehaviour {
|
||||
Rigidbody2D rigidBody;
|
||||
|
||||
public float bombTimer = -1;
|
||||
|
||||
public GameObject bombPrefab;
|
||||
|
||||
void Awake() {
|
||||
rigidBody = GetComponent<Rigidbody2D> ();
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D collider) {
|
||||
//TODO: use durability class?
|
||||
FireDamager fire = collider.gameObject.GetComponent<FireDamager> ();
|
||||
@@ -18,5 +24,10 @@ public class BlockIce : MonoBehaviour {
|
||||
}
|
||||
Destroy (gameObject);
|
||||
}
|
||||
|
||||
WindDamager wind = collider.gameObject.GetComponent<WindDamager> ();
|
||||
if (wind != null) {
|
||||
rigidBody.AddForce (collider.gameObject.GetComponent<Rigidbody2D> ().velocity * 20, ForceMode2D.Impulse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Bomb : MonoBehaviour {
|
||||
Rigidbody2D rigidBody;
|
||||
|
||||
public float timer;
|
||||
|
||||
GameObject explosion;
|
||||
@@ -10,6 +12,10 @@ public class Bomb : MonoBehaviour {
|
||||
|
||||
float birthTime;
|
||||
|
||||
void Awake() {
|
||||
rigidBody = GetComponent<Rigidbody2D> ();
|
||||
}
|
||||
|
||||
void Start() {
|
||||
StartCoroutine (ExplodeAfter (timer));
|
||||
|
||||
@@ -32,6 +38,11 @@ public class Bomb : MonoBehaviour {
|
||||
iceBlock.GetComponent<BlockIce> ().bombTimer = timer - (Time.time - birthTime);
|
||||
Destroy (gameObject);
|
||||
}
|
||||
|
||||
WindDamager wind = collider.gameObject.GetComponent<WindDamager> ();
|
||||
if (wind != null) {
|
||||
rigidBody.AddForce (collider.gameObject.GetComponent<Rigidbody2D> ().velocity / 2, ForceMode2D.Impulse);
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator ExplodeAfter(float delay) {
|
||||
|
||||
@@ -5,7 +5,7 @@ using UnityEngine;
|
||||
//shootable
|
||||
public class WindDamager : DamagerBase {
|
||||
void OnTriggerEnter2D(Collider2D collider) {
|
||||
if (collider.gameObject.GetComponent<WindDamager> () == null) { //pass through other instances of self
|
||||
if (collider.gameObject.GetComponent<WindDamager> () == null && collider.gameObject.GetComponent<BlockGap> () == null) {
|
||||
Destroy (gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user