| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class RockBehitTrigger : BeHitTrigger
- {
- public int attackTime = 2;
- public int curAttackTime = 0;
- public string fatName = "¶Ü¼×±ø";
- public RockRoller rock;
- protected override void OnEnable()
- {
- base.OnEnable();
- curAttackTime = 0;
- }
- public override void BeHit(AttackController.AttackMethod attackMethod, Character attackFrom)
- {
- if (attackMethod.attackInfo.attackMethod_Type == AttackMethod_Type.Attack_March)
- {
- return;
- }
- if (attackFrom.gameObject.GetComponent<Demonic>() != null)
- {
- if (attackFrom.gameObject.GetComponent<Demonic>().myName == fatName)
- {
- if (curAttackTime == attackTime - 1)
- {
- owner.BeHit(attackMethod, attackFrom);
- //rock.changeSpriter(curAttackTime+1);
- rock.changeScale(curAttackTime + 1);
- curAttackTime = 0;
- }
- else
- {
- curAttackTime += 1;
- //rock.changeSpriter(curAttackTime);
- rock.changeScale(curAttackTime);
- }
- }
- else
- {
- base.BeHit(attackMethod, attackFrom);
- }
- }
- else
- {
- base.BeHit(attackMethod, attackFrom);
- }
- }
- protected override void OnDisable()
- {
- base.OnDisable();
- curAttackTime = 0;
- }
- }
|