Commit 9df2ba8f authored by BlckTgr's avatar BlckTgr

Adjusted spore spit to animations

parent 1230ddc4
......@@ -126,7 +126,7 @@ AnimatorState:
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 0}
m_Motion: {fileID: 7400000, guid: db9f1257fd0f4e4469fb753e0977c87c, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
......
......@@ -22,32 +22,32 @@ AnimationClip:
- time: 0
value: {fileID: 1627874956404286594, guid: 862cec3887cfdda4fb45735aebc97301,
type: 3}
- time: 0.083333336
- time: 0.1
value: {fileID: 5449879240496578204, guid: 862cec3887cfdda4fb45735aebc97301,
type: 3}
- time: 0.16666667
- time: 0.2
value: {fileID: 6052656992612455111, guid: 862cec3887cfdda4fb45735aebc97301,
type: 3}
- time: 0.25
- time: 0.3
value: {fileID: -3309947642970003668, guid: 862cec3887cfdda4fb45735aebc97301,
type: 3}
- time: 0.33333334
- time: 0.4
value: {fileID: -5412604461499101412, guid: 862cec3887cfdda4fb45735aebc97301,
type: 3}
- time: 0.41666666
- time: 0.5
value: {fileID: -1608034643159640898, guid: 862cec3887cfdda4fb45735aebc97301,
type: 3}
- time: 0.5
- time: 0.6
value: {fileID: -2579090416884342719, guid: 862cec3887cfdda4fb45735aebc97301,
type: 3}
- time: 0.5833333
- time: 0.7
value: {fileID: 4003656188688197843, guid: 862cec3887cfdda4fb45735aebc97301,
type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 12
m_SampleRate: 10
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
......@@ -75,7 +75,7 @@ AnimationClip:
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.6666666
m_StopTime: 0.8
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
......
......@@ -22,62 +22,62 @@ AnimationClip:
- time: 0
value: {fileID: -3797417976832381115, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 0.083333336
- time: 0.1
value: {fileID: -784709506356421110, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 0.16666667
- time: 0.2
value: {fileID: -5591312681037401397, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 0.25
- time: 0.3
value: {fileID: 2950592278523905265, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 0.33333334
- time: 0.4
value: {fileID: -3215379442919456424, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 0.41666666
- time: 0.5
value: {fileID: 4361052292298439265, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 0.5
- time: 0.6
value: {fileID: -2838109396259056603, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 0.5833333
- time: 0.7
value: {fileID: 1214698722413279172, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 0.6666667
- time: 0.8
value: {fileID: -1537116919688287361, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 0.75
- time: 0.9
value: {fileID: -5200149329435569118, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 0.8333333
- time: 1
value: {fileID: -8116919559581200562, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 0.9166667
- time: 1.1
value: {fileID: -7862655605486873957, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 1
- time: 1.2
value: {fileID: 7172317068034863646, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 1.0833334
- time: 1.3
value: {fileID: -2791015496758290107, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 1.1666666
- time: 1.4
value: {fileID: 3475254821444909495, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 1.25
- time: 1.5
value: {fileID: -4132914128217599760, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 1.3333334
- time: 1.6
value: {fileID: -4245159207533069644, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
- time: 1.4166666
- time: 1.7
value: {fileID: -8391202983119452019, guid: bfc764c386797bf479ef61573a6acf84,
type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 12
m_SampleRate: 10
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
......@@ -115,7 +115,7 @@ AnimationClip:
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1.5
m_StopTime: 1.8000001
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
......
......@@ -22,47 +22,47 @@ AnimationClip:
- time: 0
value: {fileID: -3229282105519574931, guid: 77b439363e17fc44680a1d1e15e68039,
type: 3}
- time: 0.083333336
- time: 0.1
value: {fileID: 3260717837287513545, guid: 77b439363e17fc44680a1d1e15e68039,
type: 3}
- time: 0.16666667
- time: 0.2
value: {fileID: -1597772747892799894, guid: 77b439363e17fc44680a1d1e15e68039,
type: 3}
- time: 0.25
- time: 0.3
value: {fileID: 6580164297697393212, guid: 77b439363e17fc44680a1d1e15e68039,
type: 3}
- time: 0.33333334
- time: 0.4
value: {fileID: 4199088449836415043, guid: 77b439363e17fc44680a1d1e15e68039,
type: 3}
- time: 0.41666666
- time: 0.5
value: {fileID: 6897496089222242043, guid: 77b439363e17fc44680a1d1e15e68039,
type: 3}
- time: 0.5
- time: 0.6
value: {fileID: -8362802413666550985, guid: 77b439363e17fc44680a1d1e15e68039,
type: 3}
- time: 0.5833333
- time: 0.7
value: {fileID: -1326573571989916855, guid: 77b439363e17fc44680a1d1e15e68039,
type: 3}
- time: 0.6666667
- time: 0.8
value: {fileID: 4016261845073995366, guid: 77b439363e17fc44680a1d1e15e68039,
type: 3}
- time: 0.75
- time: 0.9
value: {fileID: -1794093461010900727, guid: 77b439363e17fc44680a1d1e15e68039,
type: 3}
- time: 0.8333333
- time: 1
value: {fileID: 8528476334745339686, guid: 77b439363e17fc44680a1d1e15e68039,
type: 3}
- time: 0.9166667
- time: 1.1
value: {fileID: 4710317706820535154, guid: 77b439363e17fc44680a1d1e15e68039,
type: 3}
- time: 1
- time: 1.2
value: {fileID: -7332723171293671016, guid: 77b439363e17fc44680a1d1e15e68039,
type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 12
m_SampleRate: 10
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
......@@ -95,7 +95,7 @@ AnimationClip:
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1.0833334
m_StopTime: 1.3000001
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
......
......@@ -120,6 +120,7 @@ MonoBehaviour:
type: 3}
timeUntilFirstShot: 0
timeBetweenSporeSpawns: 5
shootDelay: 0.5
--- !u!61 &3753179524225600079
BoxCollider2D:
m_ObjectHideFlags: 0
......@@ -137,7 +138,7 @@ BoxCollider2D:
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 3.7766666, y: 3.0933332}
oldSize: {x: 3.67, y: 3.0366666}
newSize: {x: 1, y: 1}
adaptiveTilingThreshold: 0.5
drawMode: 0
......
......@@ -19,9 +19,14 @@ public class PlantAI : MonoBehaviour
public float timeBetweenSporeSpawns;
private float timer;
//Verzögerung des Schusses zum Anpassen an Animation
public float shootDelay;
private float shootTimer;
void Awake()
{
timer = timeUntilFirstShot;
shootTimer = shootDelay;
}
// Update is called once per frame
......@@ -29,29 +34,38 @@ public class PlantAI : MonoBehaviour
{
if (timer <= 0)
{
GameObject g;
//rotiert die Sporen passend, sodass "oben" für die Sporen die jeweilige angegebene Richtung ist
if (shootingDirection == ShootDir.LEFT)
{
g = Instantiate(sporePrefab, transform.position + Vector3.left * 1.5f, Quaternion.Euler(0f, 0f, 90f));
}
else if (shootingDirection == ShootDir.RIGHT)
{
g = Instantiate(sporePrefab, transform.position + Vector3.right * 1.5f, Quaternion.Euler(0f, 0f, 270f));
}
else if (shootingDirection == ShootDir.UP)
{
g = Instantiate(sporePrefab, transform.position + Vector3.up * 1.5f, Quaternion.Euler(0f, 0f, 0f));
}
else
{
g = Instantiate(sporePrefab, transform.position + Vector3.down * 1.5f, Quaternion.Euler(0f, 0f, 180f));
}
g.transform.parent = transform;
animator.SetBool("Shooting", true);
timer = timeBetweenSporeSpawns;
if(shootTimer <= 0)
{
GameObject g;
//rotiert die Sporen passend, sodass "oben" für die Sporen die jeweilige angegebene Richtung ist
if (shootingDirection == ShootDir.LEFT)
{
g = Instantiate(sporePrefab, transform.position + Vector3.left * 1f, Quaternion.Euler(0f, 0f, 90f));
}
else if (shootingDirection == ShootDir.RIGHT)
{
g = Instantiate(sporePrefab, transform.position + Vector3.right * 1f, Quaternion.Euler(0f, 0f, 270f));
}
else if (shootingDirection == ShootDir.UP)
{
g = Instantiate(sporePrefab, transform.position + Vector3.up * 1f, Quaternion.Euler(0f, 0f, 0f));
}
else
{
g = Instantiate(sporePrefab, transform.position + Vector3.down * 1f, Quaternion.Euler(0f, 0f, 180f));
}
g.transform.parent = transform;
shootTimer = shootDelay;
timer = timeBetweenSporeSpawns;
}
else
{
shootTimer -= Time.deltaTime;
}
}
else
{
......
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