Ejemplo n.º 1
0
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        if (m_playerState == null)
        {
            m_playerState = animator.gameObject.transform.root.GetComponent <PlayerState>();
        }

        if (m_rigidbody2D == null)
        {
            m_rigidbody2D = animator.transform.root.GetComponent <Rigidbody2D>();
        }

        if (m_playerAnim == null)
        {
            m_playerAnim = animator.gameObject.GetComponent <PlayerAnimFuntion>();
        }

        m_playerAnim.ResetTrigger(m_playerAnim.hasTDownsmash);
        m_playerAnim.ResetTrigger(m_playerAnim.hashTUpper);
        m_playerAnim.ResetTrigger(m_playerAnim.hashTNormalAttack);
        m_playerAnim.SetBool(m_playerAnim.hashBMove, false);
        m_playerState.PlayerStateReset();

        m_rigidbody2D.velocity = Vector2.zero;
    }
Ejemplo n.º 2
0
    private void Awake()
    {
        m_rigidbody2D               = this.GetComponent <Rigidbody2D>();
        m_animFuntion               = this.transform.Find("PlayerSpineSprite").GetComponent <PlayerAnimFuntion>();
        m_attackCollider            = NormalAttackEffect.GetComponent <AttackCollider>();
        m_characterMove             = this.GetComponent <CharacterMove>();
        m_playerState               = this.GetComponent <PlayerState>();
        m_playerInput               = this.GetComponent <PlayerInput>();
        m_playerCrowdControlManager = this.GetComponent <PlayerCrowdControlManager>();
        m_randAudioFuntion          = this.GetComponent <PlayerRandAudioFuntion>();
        m_audioFuntion              = this.GetComponent <PlayerAudioFunction>();

        m_bAttacking = false;

        m_NormalAttackDic = new Dictionary <string, AttackInfo>();

        m_NormalAttackDic.Add("attack_1", new AttackInfo(1.0f, new Vector2(2.0f, 3f)));
        m_NormalAttackDic.Add("attack_2", new AttackInfo(1.0f, new Vector2(2.0f, 3f)));
        m_NormalAttackDic.Add("attack_3_1", new AttackInfo(0.5f, new Vector2(2.0f, 5.0f)));
        m_NormalAttackDic.Add("attack_3_2", new AttackInfo(2.0f, new Vector2(2.0f, -10.0f)));
        m_NormalAttackDic.Add("attack_4", new AttackInfo(3.0f, new Vector2(2.0f, 10.0f)));
        m_NormalAttackDic.Add("attack_5", new AttackInfo(4.0f, new Vector2(10.0f, 10.0f)));

        m_NormalAttackDic.Add("air_attack_1", new AttackInfo(1.0f, new Vector2(1f, 12f)));
        m_NormalAttackDic.Add("air_attack_2", new AttackInfo(1.0f, new Vector2(1f, 12f)));
        m_NormalAttackDic.Add("air_attack_3", new AttackInfo(1.0f, new Vector2(1f, 12f)));
        m_NormalAttackDic.Add("air_attack_4", new AttackInfo(1.0f, new Vector2(5f, 12f)));

        m_NormalAttackDic.Add("attack_upper", new AttackInfo(3.0f, new Vector2(1f, 24.0f)));
        m_NormalAttackDic.Add("attack_downsmash", new AttackInfo(4.0f, new Vector2(2f, -25.0f)));
    }
Ejemplo n.º 3
0
 private void Awake()
 {
     m_playerState         = GetComponent <PlayerState>();
     m_animFuntion         = this.transform.Find("PlayerSpineSprite").GetComponent <PlayerAnimFuntion>();
     m_rigidbody2D         = this.GetComponent <Rigidbody2D>();
     m_crowdControlManager = this.GetComponent <PlayerCrowdControlManager>();
 }
Ejemplo n.º 4
0
 private void Awake()
 {
     m_playerInput    = GetComponent <PlayerInput>();
     m_controlManager = GetComponent <PlayerCrowdControlManager>();
     m_playerInfo     = GetComponent <PlayerInfo>();
     m_characterMove  = GetComponent <CharacterMove>();
     m_animFuntion    = GetComponentInChildren <PlayerAnimFuntion>();
 }
Ejemplo n.º 5
0
    public override void InitSkill(PlayerAnimFuntion _animFuntion, GameObject _playerObject)
    {
        base.InitSkill(_animFuntion, _playerObject);

        m_meshRenderer      = this.GetComponent <MeshRenderer>();
        m_attackCollider    = this.GetComponent <AttackCollider>();
        m_effectAnimFuntion = this.GetComponent <EffectAnimFuntion>();

        m_attackCollider.iCollisionSize = collisionSize;
        m_attackCollider.SetDamageColliderInfo(damageRatio * level, "Monster", damageForce);
    }
Ejemplo n.º 6
0
 void Start()
 {
     m_playerState        = this.GetComponent <PlayerState>();
     m_characterMove      = this.GetComponent <CharacterMove>();
     m_characterJump      = this.GetComponent <CharacterJump>();
     m_animFuntion        = this.GetComponentInChildren <PlayerAnimFuntion>();
     m_skillManager       = this.GetComponentInChildren <SkillManager>();
     m_playerNormalAttack = this.GetComponent <PlayerNormalAttack>();
     m_playerEvasion      = this.GetComponent <PlayerEvasion>();
     m_playerInfo         = this.GetComponent <PlayerInfo>();
     m_audioFunction      = this.GetComponent <AudioFunction>();
 }
Ejemplo n.º 7
0
    public override void InitSkill(PlayerAnimFuntion _animFuntion, GameObject _playerObject)
    {
        base.InitSkill(_animFuntion, _playerObject);

        m_characterInfo = _playerObject.GetComponent <CharacterInfo>();
        m_skillShoot    = GetComponent <ISkillShoot>();

        m_damageInfo.damage = (int)((m_characterInfo.attack * (damageRatio * level)) + 0.5f);

        ObjectPool.Inst.Initialize(shotObject, objectCount);

        m_damageInfo.attackForce = damageForce;
    }
Ejemplo n.º 8
0
    public virtual void InitSkill(PlayerAnimFuntion _animFuntion, GameObject _playerObject)
    {
        level = PlayerDataManager.Inst.GetSkillLevelInfo(gameObject.name);
        SkillDataManager.SkillInfo skillInfo = SkillDataManager.Inst.GetSkillInfo(gameObject.name);
        skillName     = skillInfo.skillName;
        collisionSize = skillInfo.collisionSize;
        damageRatio   = skillInfo.damageRatio + (level * 5);
        damageForce   = skillInfo.damageForce;

        m_animFuntion         = _animFuntion;
        m_playerState         = _playerObject.GetComponent <PlayerState>();
        m_rigidbody2D         = _playerObject.GetComponent <Rigidbody2D>();
        m_crowdControlManager = _playerObject.GetComponent <PlayerCrowdControlManager>();
    }
Ejemplo n.º 9
0
 private void Awake()
 {
     m_animFuntion   = this.transform.parent.transform.Find("PlayerSpineSprite").GetComponent <PlayerAnimFuntion>();
     m_playerState   = this.transform.parent.GetComponent <PlayerState>();
     m_audioFunction = this.transform.parent.GetComponent <AudioFunction>();
 }