void OnTriggerStay2D(Collider2D collision) { if (m_IsPause == true) { return; } CharacterMonster monster = collision.GetComponent <CharacterMonster>(); if (collision.tag == "Monster") { if (m_IsAttack == false && m_IsMove == false && m_IsDead == false && m_IsPause == false && monster.IsDead == false) { StartCoroutine(Attack(monster)); } else if (m_IsAttack == false && m_IsMove == false && m_IsDead == false && m_IsPause == false && monster.IsDead == true) { int speedLevel = MainController.Instance.UserInfo.GetUserAbilityLevel(eHeroAbilityKind.SPEED); m_SpeedValue = MainController.Instance.GetHeroAbilityLevel(eHeroAbilityKind.SPEED, speedLevel).Effect; m_IsMove = true; PlayAnimation(eCharacterAnimState.Run, true, m_SpeedValue); if (AdventureModeInHuntSceneUI.Instance != null) { AdventureModeInHuntSceneUI.Instance.StartBackground(); } } } }
private CharacterMonster CreateMonster(int _ID) { GameObject obj = ResourceManager.GetOBJCreatePrefab("Prefab_Monster", Position_Monster.transform); CharacterMonster monster = obj.GetComponent <CharacterMonster>(); monster.Initialize(_ID); return(monster); }