| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using Sirenix.OdinInspector;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class PolliwogShot : SpecialSkills
- {
- [Header("òòò½Ô¤ÖÆÌå")]
- public GameObject fishPrefab;
- public int num;
- public Transform pos;
- private bool isAttack;
- private SpineEvent se;
- public override void Attack()
- {
- se = owner.GetComponent<Enemy>().spineEvent;
- isAttack = true;
- }
- private void shoot()
- {
- for (int i = 0; i < num; i++)
- {
- if (PolliwogManager.GetInstance().IsFull()) continue;
- PoolManager.InstantiateAsync("Prefab/Enemy/Enemy_Polliwog", pos.position, new Quaternion(0, 0, 0, 0), null, obj =>
- {
- Polliwog pol = obj.GetComponent<Polliwog>();
- });
- }
- }
- private void Update()
- {
- if (isAttack)
- {
- if (se && se.isAttackOn)
- {
- shoot();
- se.isAttackOn = false;
- isAttack = false;
- }
- }
- }
- }
|