-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWeaponCapsule_Scr.cs
30 lines (26 loc) · 969 Bytes
/
WeaponCapsule_Scr.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Enemy_Flash_Scr))]
[RequireComponent(typeof(Enemy_HitEffect_Scr))]
public class WeaponCapsule_Scr : Enemy_Scr
{
private float cosAmpMultiplier = 6f;
private float cosTimeMultiplier = 0.8f;
private float sinAmpMultiplier = 1f;
private float sinTimeMultiplier = 4f;
private float rotationSpeed = 2f;
[SerializeField] private float movementHeight = 3f;
protected override void EnemyMovement()
{
float xPos = Mathf.Cos(Time.time * cosTimeMultiplier) * cosAmpMultiplier;
float yPos = movementHeight + Mathf.Sin(Time.time * sinTimeMultiplier) * sinAmpMultiplier;
transform.position = new Vector3(xPos, yPos, 0);
transform.Rotate(0, 0, Time.deltaTime * rotationSpeed);
}
protected override void Die()
{
NewWeaponMenu_Scr.instance.OpenNewWeaponMenu();
base.Die();
}
}