2026-01-23 08:56:21 +00:00
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
2026-01-27 11:58:00 +00:00
|
|
|
|
using System.Linq;
|
2026-01-23 08:56:21 +00:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using System.Runtime.Serialization.Formatters.Binary;
|
|
|
|
|
|
using UnityEngine.InputSystem;
|
|
|
|
|
|
|
2026-02-02 12:41:06 +00:00
|
|
|
|
[System.Serializable]
|
2026-01-30 09:58:52 +00:00
|
|
|
|
public class WeaponStat
|
2026-01-23 08:56:21 +00:00
|
|
|
|
{
|
2026-01-30 09:58:52 +00:00
|
|
|
|
public WeaponData data; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2026-01-23 08:56:21 +00:00
|
|
|
|
|
2026-01-30 09:58:52 +00:00
|
|
|
|
public WeaponStat(WeaponData data)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.data = data;
|
|
|
|
|
|
}
|
2026-02-02 12:41:06 +00:00
|
|
|
|
}
|
2026-01-23 08:56:21 +00:00
|
|
|
|
|
|
|
|
|
|
public class PlayerAttacks : MonoBehaviour
|
|
|
|
|
|
{
|
2026-01-30 09:58:52 +00:00
|
|
|
|
[Header("Nano Weapons")]
|
|
|
|
|
|
[SerializeField] private List<WeaponData> nanoWeaponList;
|
|
|
|
|
|
|
|
|
|
|
|
[Header("Tera Weapons")]
|
|
|
|
|
|
[SerializeField] private List<WeaponData> teraWeaponList;
|
|
|
|
|
|
|
|
|
|
|
|
[SerializeField] private WeaponHitbox Hitbox;
|
|
|
|
|
|
//[SerializeField] private WeaponHitbox nanoHitbox;
|
|
|
|
|
|
//[SerializeField] private WeaponHitbox teraHitbox;
|
|
|
|
|
|
|
|
|
|
|
|
// <20><>Ÿ<EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ƶ<EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ
|
|
|
|
|
|
private List<WeaponStat> nanoStats = new List<WeaponStat>();
|
|
|
|
|
|
private List<WeaponStat> teraStats = new List<WeaponStat>();
|
|
|
|
|
|
|
2026-01-23 08:56:21 +00:00
|
|
|
|
private Animator animator;
|
2026-01-30 09:58:52 +00:00
|
|
|
|
public bool IsAnyWeaponInUse = false; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<><C8AE>
|
2026-01-27 11:58:00 +00:00
|
|
|
|
PlayerController playerController;
|
2026-01-23 08:56:21 +00:00
|
|
|
|
|
2026-01-29 09:11:23 +00:00
|
|
|
|
[SerializeField] private GameObject nano;
|
|
|
|
|
|
[SerializeField] private GameObject tera;
|
|
|
|
|
|
|
2026-01-26 08:52:26 +00:00
|
|
|
|
public enum Types {scissor, needle, lighter};
|
2026-01-23 08:56:21 +00:00
|
|
|
|
|
|
|
|
|
|
void Start()
|
|
|
|
|
|
{
|
|
|
|
|
|
//Animator <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2026-01-27 11:58:00 +00:00
|
|
|
|
playerController = GetComponent<PlayerController>();
|
2026-01-30 09:58:52 +00:00
|
|
|
|
|
|
|
|
|
|
foreach (var data in nanoWeaponList)
|
|
|
|
|
|
nanoStats.Add(new WeaponStat(data));
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var data in teraWeaponList)
|
|
|
|
|
|
teraStats.Add(new WeaponStat(data));
|
2026-01-23 08:56:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Update()
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-29 09:11:23 +00:00
|
|
|
|
public IEnumerator ableAtk(int weaponIndex, string atkType, bool isnano)
|
2026-01-23 08:56:21 +00:00
|
|
|
|
{
|
2026-01-29 12:38:56 +00:00
|
|
|
|
|
2026-01-30 09:58:52 +00:00
|
|
|
|
// <20><><EFBFBD><EFBFBD> ij<><C4B3><EFBFBD>Ϳ<EFBFBD> <20>´<EFBFBD> <20><><EFBFBD>Ȱ<EFBFBD> <20><>Ʈ<EFBFBD>ڽ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
List<WeaponStat> currentList = isnano ? nanoStats : teraStats;
|
|
|
|
|
|
WeaponHitbox currentHitbox = Hitbox;
|
|
|
|
|
|
|
|
|
|
|
|
/*if (weaponIndex >= currentList.Count)
|
|
|
|
|
|
{
|
|
|
|
|
|
Debug.LogError($"{weaponIndex}<7D><> <20><><EFBFBD><EFBFBD> <20><>");
|
|
|
|
|
|
IsAnyWeaponInUse = false;
|
|
|
|
|
|
yield break;
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
WeaponStat currentStat = currentList[weaponIndex];
|
|
|
|
|
|
|
|
|
|
|
|
Debug.Log($"<22><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>: {currentStat.data.frontdelaytime}<7D><>");
|
|
|
|
|
|
yield return new WaitForSeconds(currentStat.data.frontdelaytime);
|
2026-01-29 12:38:56 +00:00
|
|
|
|
|
2026-01-29 09:11:23 +00:00
|
|
|
|
animator = (isnano) ? nano.GetComponent<Animator>() : tera.GetComponent<Animator>();
|
|
|
|
|
|
Debug.Log(atkType);
|
|
|
|
|
|
animator.SetTrigger(atkType);
|
2026-01-23 08:56:21 +00:00
|
|
|
|
|
2026-01-30 09:58:52 +00:00
|
|
|
|
currentHitbox.Setup(currentStat, atkType);
|
2026-01-29 12:38:56 +00:00
|
|
|
|
|
2026-01-30 09:58:52 +00:00
|
|
|
|
currentHitbox.gameObject.SetActive(true);
|
2026-01-23 08:56:21 +00:00
|
|
|
|
|
2026-01-30 09:58:52 +00:00
|
|
|
|
yield return new WaitForSeconds(currentStat.data.atkDuration);
|
|
|
|
|
|
currentHitbox.gameObject.SetActive(false);
|
2026-01-26 08:52:26 +00:00
|
|
|
|
|
2026-01-30 09:58:52 +00:00
|
|
|
|
Debug.Log($"<22>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>: {currentStat.data.afterdelaytime}<7D><>");
|
|
|
|
|
|
yield return new WaitForSeconds(currentStat.data.frontdelaytime); // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2026-01-26 08:52:26 +00:00
|
|
|
|
|
2026-01-30 09:58:52 +00:00
|
|
|
|
IsAnyWeaponInUse = false;
|
2026-01-23 08:56:21 +00:00
|
|
|
|
}
|
2026-01-27 11:58:00 +00:00
|
|
|
|
|
2026-01-23 08:56:21 +00:00
|
|
|
|
}
|