improved tambourine behavior
also worked a bit on level balancing, adding background details
This commit is contained in:
parent
46f7cfe07e
commit
d3893d3f0e
@ -45,7 +45,7 @@ GameObject:
|
||||
- component: {fileID: 1214578695954916569}
|
||||
m_Layer: 0
|
||||
m_Name: CaveOctopus
|
||||
m_TagString: Enemy
|
||||
m_TagString: ProjectileEnemy
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
|
@ -667,7 +667,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 160, y: 30}
|
||||
m_SizeDelta: {x: 300, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6246326073037474307
|
||||
CanvasRenderer:
|
||||
@ -825,7 +825,7 @@ GameObject:
|
||||
- component: {fileID: 2527389465697474493}
|
||||
m_Layer: 5
|
||||
m_Name: DebugCanvas
|
||||
m_TagString: DebugCanvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@ -844,7 +844,7 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 7749526488533549851}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1000,10 +1000,6 @@ PrefabInstance:
|
||||
propertyPath: m_Name
|
||||
value: DebugCanvas
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5492200001176623974, guid: ff99a7d0beeca415e911378b9b377de4, type: 3}
|
||||
propertyPath: m_TagString
|
||||
value: Untagged
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
|
@ -18,6 +18,8 @@ public class TambourineBehavior : MonoBehaviour {
|
||||
public bool pinned = false;
|
||||
public AudioSource tambourineHitSound;
|
||||
|
||||
private bool returnToPlayer = false;
|
||||
|
||||
|
||||
void Awake() {
|
||||
this.gameObject.GetComponent<CircleCollider2D>().enabled = true;
|
||||
@ -36,7 +38,7 @@ public class TambourineBehavior : MonoBehaviour {
|
||||
// if (Input.GetKeyUp(KeyCode.K)) {
|
||||
// Destroy(this.gameObject);
|
||||
// }
|
||||
if (collidedObject != null && collidedObject.tag != "grappleSurface") {
|
||||
if (collidedObject != null && collidedObject.tag != "grappleSurface" && !returnToPlayer) {
|
||||
rb.constraints = RigidbodyConstraints2D.FreezeAll;
|
||||
// this.gameObject.transform.position = col.transform.position;
|
||||
timeLerped += Time.deltaTime;
|
||||
@ -48,6 +50,17 @@ public class TambourineBehavior : MonoBehaviour {
|
||||
} else {
|
||||
// print("pinned, but not same position: " + this.gameObject.transform.position + " / " + collidedObject.transform.position);
|
||||
}
|
||||
} else if (returnToPlayer) {
|
||||
Destroy(rb);
|
||||
animator.SetBool("pinned", false);
|
||||
pinned = false;
|
||||
|
||||
timeLerped += Time.deltaTime;
|
||||
this.gameObject.transform.position = Vector2.Lerp(this.gameObject.transform.position, player.transform.position, timeLerped/0.1f);
|
||||
if (this.gameObject.transform.position.x == player.transform.position.x && this.gameObject.transform.position.y == player.transform.position.y) {
|
||||
player.GetComponent<PlayerBehavior>().hasTambourine = true;
|
||||
Destroy(this.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,14 +97,14 @@ public class TambourineBehavior : MonoBehaviour {
|
||||
}
|
||||
|
||||
public void DestroySelf() {
|
||||
timeLerped = 0.0f;
|
||||
returnToPlayer = true;
|
||||
if (collidedObject != null && collidedObject.tag == "Enemy") {
|
||||
collidedObject.GetComponent<EnemyPatrol>().pinned = false;
|
||||
collidedObject.GetComponent<EnemyPatrol>().TogglePin(false);
|
||||
} else if (collidedObject != null && collidedObject.tag == "Projectile") {
|
||||
collidedObject.GetComponent<ProjectileBehavior>().Explode();
|
||||
}
|
||||
player.GetComponent<PlayerBehavior>().hasTambourine = true;
|
||||
player.GetComponent<PlayerBehavior>().grapplingGun.ReleaseGrapple();
|
||||
Destroy(this.gameObject);
|
||||
}
|
||||
}
|
||||
|
@ -69,8 +69,8 @@ TextureImporter:
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
maxTextureSize: 32
|
||||
resizeAlgorithm: 1
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
|
@ -69,8 +69,8 @@ TextureImporter:
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
maxTextureSize: 32
|
||||
resizeAlgorithm: 1
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
|
Loading…
Reference in New Issue
Block a user