init
This commit is contained in:
commit
16da8e4dde
333 changed files with 109229 additions and 0 deletions
34
Assets/Scripts/Player/BigBulletController.cs
Normal file
34
Assets/Scripts/Player/BigBulletController.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class BigBulletController : MonoBehaviour{
|
||||
|
||||
public float speed;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
transform.Translate(Vector2.right * speed * Time.deltaTime);
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D col){
|
||||
if(col.gameObject.tag == "Enemy"){
|
||||
ObjectPooler.Instance.SpawnFromPool("EnemyDeath", col.transform.position, Quaternion.identity);
|
||||
ObjectPooler.Instance.SpawnFromPool("BulletImpact", transform.position, Quaternion.identity);
|
||||
}
|
||||
if (col.gameObject.tag == "BigEnemy"){
|
||||
ObjectPooler.Instance.SpawnFromPool("BulletImpact", transform.position, Quaternion.identity);
|
||||
}
|
||||
if (col.gameObject.tag == "CircleEnemy"){
|
||||
ObjectPooler.Instance.SpawnFromPool("BulletImpact", transform.position, Quaternion.identity);
|
||||
}
|
||||
if (col.gameObject.tag == "RocketEnemy"){
|
||||
ObjectPooler.Instance.SpawnFromPool("RocketEnemyDeath", col.transform.position, Quaternion.identity);
|
||||
ObjectPooler.Instance.SpawnFromPool("BulletImpact", transform.position, Quaternion.identity);
|
||||
}
|
||||
if(col.gameObject.tag == "Wall"){
|
||||
ObjectPooler.Instance.SpawnFromPool("BulletImpact", transform.position, Quaternion.identity);
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue