Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class ZeusScript : Enemy
- {
- // Start is called before the first frame update
- public GameObject lighting;
- public GameObject _lightingRing;
- public float coolDown = 2f;
- private float timer = 0;
- public Animator animator;
- private bool isUsingAbility;
- private GameObject player;
- void Start()
- {
- base.Start();
- player = GameObject.FindObjectOfType<PlayerController>();
- }
- private IEnumerator useAbility()
- {
- while(true)
- {
- isUsingAbility = true;
- yield return new WaitForSeconds(11f);
- LightingRingAb();
- }
- }
- public void LightingRingAb()
- {
- Instantiate(_lightingRing, transform.position, Quaternion.identity);
- // animator.SetTrigger("LightingRing");
- }
- protected override void Attack()
- {
- timer += Time.deltaTime;
- if(Vector3.Distance(transform.position, player.transform.position)<50f)
- {
- if(timer>coolDown)
- {
- timer = 0;
- var _lighting = Instantiate(lighting, transform.position,transform.rotation);
- _lighting.GetComponent<LightingBullet>.SetDirection(transform.forward);
- animator.SetTrigger("AttackAnimation");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement