Exemple #1
0
        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);
        }
Exemple #2
0
        public static Role CreateRole()
        {
            Role role = new Role_Player();

            // EntityMgr.S.RegisterEntity(role);

            return(role);
        }
Exemple #3
0
 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();
     }
 }
Exemple #4
0
        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;
            }
        }
Exemple #5
0
 public virtual void Dodge(Role_Player role, DodgeDir dir)
 {
 }
Exemple #6
0
 public virtual void SpecialAttackEnd(Role_Player role)
 {
 }
Exemple #7
0
 public virtual void SpecialAttackStart(Role_Player role)
 {
 }
Exemple #8
0
 public virtual void Combo(Role_Player role)
 {
 }
Exemple #9
0
 public virtual void Attack2(Role_Player role)
 {
 }
Exemple #10
0
 public override void Attack2(Role_Player role)
 {
     base.Attack2(role);
     role.animComponent.animator.CrossFade("Attack2Combo", 0.2f, 0, 0);
 }
Exemple #11
0
 public override void SpecialAttackEnd(Role_Player role)
 {
     role.animComponent.animator.CrossFade("Special_End", 0.2f, 0, 0);
 }
Exemple #12
0
 public override void SpecialAttackStart(Role_Player role)
 {
     role.animComponent.animator.CrossFade("Special_Start", 0.1f, 0, 0);
 }
Exemple #13
0
 public void Init(Role_Player role)
 {
     m_Role = role;
 }