-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
83 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class LairCannon : MonoBehaviour { | ||
|
||
void OnParticleCollision(GameObject go) | ||
{ | ||
Debug.Log("Blubl"); | ||
if (go.tag.Equals("Ground")) | ||
{ | ||
Debug.Log("Blubl" + go.transform.position); | ||
Building_EnemyLair lair = GetComponentInParent<Building_EnemyLair>(); | ||
GameObject obj = Instantiate(lair.spawnPrefab); | ||
obj.transform.position = go.transform.position + Vector3.up * 1.2f; | ||
} | ||
} | ||
|
||
public IEnumerator SpawnDrops(Building_EnemyLair lair, float startdelay) | ||
{ | ||
yield return new WaitForSeconds(startdelay); | ||
//rotate cannon to target | ||
Vector3 firedirection = FindObjectOfType<Building_Flag>().transform.position - lair.transform.position; | ||
transform.parent.rotation = Quaternion.LookRotation(firedirection, Vector3.up); | ||
|
||
ParticleSystem spwner = GetComponent<ParticleSystem>(); | ||
while (true) | ||
{ | ||
yield return new WaitForSeconds(lair.spawnFrequence); | ||
if (spwner) spwner.Emit(1); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file modified
BIN
+1.05 KB
(100%)
GGJ17/Assets/Prefab/BuildingBlocks/Building_EnemyLair.prefab
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.