Skip to content
Snippets Groups Projects
Commit f8c17a33 authored by Robin Ruud Kristensen's avatar Robin Ruud Kristensen
Browse files
parents 6ef954f1 5ff7b55d
No related branches found
No related tags found
2 merge requests!76Juliuses nye super branch,!67maybe fixed spawning of enemies
......@@ -217,7 +217,7 @@ namespace BigSock {
// Trigger the event for taking damage.
OnTakeDamage?.Invoke(this, attack.Actor, attack);
if (TakeDamageAudio != null){
if(TakeDamageAudio != null && source?.Count > 0 && source[0] != null) {
source[0].clip = TakeDamageAudio;
source[0].Play();
}
......
......@@ -188,7 +188,7 @@ namespace BigSock {
// Check ability 2.
CheckAbilityInput(KeyCode.Z, _testAttack2);
// Check ability 3.
CheckAbilityInput(KeyCode.X, _dodge);
CheckAbilityInput(KeyCode.LeftShift, _dodge);
CheckAbilityInput(KeyCode.C, _testAttack3);
......
......@@ -41,14 +41,22 @@ namespace BigSock.Service {
public GameObject Instance(string name, Vector3? pos = null)
=> Instance(_prefabs[_sanitize(name)], pos);
private GameObject Instance(GameObject obj, Transform parent)
{
private GameObject Instance(GameObject obj, Transform parent) {
var res = MonoBehaviour.Instantiate(obj, parent);
return res;
}
public GameObject Instance(string name, Transform parent)
=> Instance(_prefabs[_sanitize(name)], parent);
public GameObject Instance(GameObject obj, Vector3 position, Quaternion rotation, Transform parent) {
return MonoBehaviour.Instantiate(obj, position, rotation, parent);
}
public GameObject Instance(GameObject obj, Vector3 position, Quaternion rotation) {
return MonoBehaviour.Instantiate(obj, position, rotation);
}
/*
Destroy an instance.
*/
......
......@@ -175,7 +175,7 @@ MonoBehaviour:
TakeDamageAudio: {fileID: 8300000, guid: f1cd1110ebb2e3f4289a7667f4fea401, type: 3}
baseMovementSpeed: 2
baseDamage: 1
knockbackForce: 2
knockbackForce: 3
baseHP: 10
baseMaxHP: 10
dropXP: 0
......
......@@ -105,7 +105,7 @@ BoxCollider2D:
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 1.125, y: 0.75}
oldSize: {x: 2.25, y: 1.5}
newSize: {x: 1, y: 1}
adaptiveTilingThreshold: 0.5
drawMode: 0
......
......@@ -171,10 +171,11 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
baseAttackSpeed: 1
source: []
TakeDamageAudio: {fileID: 8300000, guid: 0d78a0205a770454c86c53710a0b4ff1, type: 3}
baseMovementSpeed: 1
baseDamage: 1
knockbackForce: 150
knockbackForce: 2
baseHP: 10
baseMaxHP: 10
dropXP: 0
......
......@@ -144,6 +144,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
baseAttackSpeed: 1
source: []
TakeDamageAudio: {fileID: 8300000, guid: 0d78a0205a770454c86c53710a0b4ff1, type: 3}
baseMovementSpeed: 4
baseDamage: 1
......
......@@ -170,9 +170,11 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
baseAttackSpeed: 1
source: []
TakeDamageAudio: {fileID: 0}
baseMovementSpeed: 1
baseDamage: 1
knockbackForce: 150
knockbackForce: 2
baseHP: 10
baseMaxHP: 10
dropXP: 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment