70 lines
1.6 KiB
C#
70 lines
1.6 KiB
C#
|
|
using System.Collections;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using UnityEngine;
|
|||
|
|
using System.Runtime.Serialization.Formatters.Binary;
|
|||
|
|
using UnityEngine.InputSystem;
|
|||
|
|
|
|||
|
|
[System.Serializable]
|
|||
|
|
public class Weapons
|
|||
|
|
{
|
|||
|
|
public bool isUseable; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
public bool isUse; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
//public PlayerAttacks.classType WeaponType; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ΰ<EFBFBD>?
|
|||
|
|
public int WeaponLevel;
|
|||
|
|
|
|||
|
|
public int atkCnt; // <20><><EFBFBD><EFBFBD> Ƚ<><C8BD>
|
|||
|
|
public float WeaponDmg; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
public string animTrigger; // <20>ִϸ<D6B4><CFB8>̼<EFBFBD> <20><><EFBFBD><EFBFBD> Ʈ<><C6AE><EFBFBD><EFBFBD> <20≯<EFBFBD>
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public class PlayerAttacks : MonoBehaviour
|
|||
|
|
{
|
|||
|
|
private Animator animator;
|
|||
|
|
|
|||
|
|
bool issAtk = false; // <20><><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD>
|
|||
|
|
bool isaAtk = false; // <20><><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD>
|
|||
|
|
public Weapons[] weaponInfos;
|
|||
|
|
Weapondata weaponBase;
|
|||
|
|
|
|||
|
|
public enum Types { scissor, needle, lighter};
|
|||
|
|
|
|||
|
|
void Start()
|
|||
|
|
{
|
|||
|
|
//Animator <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
animator = GetComponent<Animator>();
|
|||
|
|
weaponBase = GetComponent<Weapondata>();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Update()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void OnsAtk(InputValue value)
|
|||
|
|
{
|
|||
|
|
if (value.isPressed && !weaponInfos[0].isUse)
|
|||
|
|
{
|
|||
|
|
issAtk = true;
|
|||
|
|
animator.SetTrigger("sAtk");
|
|||
|
|
Debug.Log(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>! ");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void OnaAtk(InputValue value)
|
|||
|
|
{
|
|||
|
|
if (value.isPressed && !weaponInfos[0].isUse)
|
|||
|
|
{
|
|||
|
|
isaAtk = true;
|
|||
|
|
animator.SetTrigger("aAtk");
|
|||
|
|
Debug.Log(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>! ");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public IEnumerator ableAtk(float sDamage, float aDamage, float frontdelaytime, float afterdelaytime)
|
|||
|
|
{
|
|||
|
|
weaponInfos[wea]
|
|||
|
|
}
|
|||
|
|
}
|