public Player() : base() { m_Data = new PlayerData(this); AddressableResMgr.S.InstantiateAsync("Player", (target) => { m_GameObject = target; m_Transform = target.transform; m_MonoReference = target.GetComponent <PlayerMonoReference>(); m_MonoReference.player = this; m_Role = new RoleAnimTest(); m_Role.onRoleCreated += (role) => { role.gameObject.name = "Role"; m_Role.transform.SetParent(m_Transform); m_FSMComponent = AddComponent(new PlayerFSMComponent()); m_ControlComponent = AddComponent(new PlayerControlComponent()); if (onPlayerCreated != null) { onPlayerCreated(this); } }; }); EntityMgr.S.RegisterEntity(this); }
public static Role CreateRole() { Role role = new Role_Player(); // EntityMgr.S.RegisterEntity(role); return(role); }
public override void Combo(Role_Player role) { base.Combo(role); if (role.controlComponent.attackType == AttackTypeEnum.Light) { role.animComponent.ComboTrigger(); } else if (role.controlComponent.attackType == AttackTypeEnum.Heavy) { role.animComponent.Combo2Trigger(); } }
public override void Dodge(Role_Player role, DodgeDir dir) { switch (dir) { case DodgeDir.Left: role.animComponent.animator.CrossFade("2Hand-Axe-Dodge-Left", 0.2f, 0, 0); break; case DodgeDir.Right: role.animComponent.animator.CrossFade("2Hand-Axe-Dodge-Right", 0.2f, 0, 0); break; } }
public virtual void Dodge(Role_Player role, DodgeDir dir) { }
public virtual void SpecialAttackEnd(Role_Player role) { }
public virtual void SpecialAttackStart(Role_Player role) { }
public virtual void Combo(Role_Player role) { }
public virtual void Attack2(Role_Player role) { }
public override void Attack2(Role_Player role) { base.Attack2(role); role.animComponent.animator.CrossFade("Attack2Combo", 0.2f, 0, 0); }
public override void SpecialAttackEnd(Role_Player role) { role.animComponent.animator.CrossFade("Special_End", 0.2f, 0, 0); }
public override void SpecialAttackStart(Role_Player role) { role.animComponent.animator.CrossFade("Special_Start", 0.1f, 0, 0); }
public void Init(Role_Player role) { m_Role = role; }