견습 사냥꾼 : 함정 설치
This commit is contained in:
parent
bf867eb6b3
commit
755327f9ac
|
|
@ -45,3 +45,8 @@ classconfig 에 의해 정해짐
|
|||
다른 직업 스킬 구현
|
||||
- 궁수
|
||||
- 견습 사냥꾼
|
||||
|
||||
함정 설치
|
||||
- 데미지는 폭발할 때 범위에 있음
|
||||
- 스킬 버튼 한 번 더 누르면 폭발
|
||||
- 중앙 함정에 닿으면 폭발
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -21,15 +21,16 @@ Material:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Laser2
|
||||
m_Shader: {fileID: -6465566751694194690, guid: 00191177e5fd5c4468ad546ce87ef329, type: 3}
|
||||
m_Shader: {fileID: -6465566751694194690, guid: 00191177e5fd5c4468ad546ce87ef329,
|
||||
type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords:
|
||||
- _BUILTIN_SURFACE_TYPE_TRANSPARENT
|
||||
- _ENABLE_FOG_ON_TRANSPARENT
|
||||
- _SURFACE_TYPE_TRANSPARENT
|
||||
m_InvalidKeywords:
|
||||
- _DOUBLESIDED_ON
|
||||
- _ENABLE_FOG_ON_TRANSPARENT
|
||||
- _USEDEPTH_ON
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
|
|
@ -43,6 +44,8 @@ Material:
|
|||
- TransparentDepthPostpass
|
||||
- TransparentBackface
|
||||
- MOTIONVECTORS
|
||||
- DepthOnly
|
||||
- SHADOWCASTER
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
|
|
@ -165,12 +168,12 @@ Material:
|
|||
- _Opacity: 1
|
||||
- _OpaqueCullMode: 2
|
||||
- _Parallax: 0.02
|
||||
- _QueueControl: -1
|
||||
- _QueueControl: 0
|
||||
- _QueueOffset: 0
|
||||
- _RenderQueueType: 3
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlend: 5
|
||||
- _StencilRef: 0
|
||||
- _StencilRefDepth: 1
|
||||
- _StencilRefDistortionVec: 4
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ Material:
|
|||
m_Colors:
|
||||
- _BaseColor: {r: 0.4, g: 0.4, b: 0.4, a: 1}
|
||||
- _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0}
|
||||
- _Color: {r: 0.4, g: 0.4, b: 0.4, a: 1}
|
||||
- _Color: {r: 0.39999998, g: 0.39999998, b: 0.39999998, a: 1}
|
||||
- _DiffusionProfileAsset: {r: 0, g: 0, b: 0, a: 0}
|
||||
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
|
||||
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
|
|
|
|||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
|
@ -1,5 +1,32 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1102 &-8866494684727614440
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: ra_skill2
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: 2875394452186955743}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_TimeParameterActive: 0
|
||||
m_Motion: {fileID: 7400000, guid: 25c9e0d8d621a704eb0be80787972824, type: 3}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1101 &-8581291956724290024
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
|
|
@ -1800,6 +1827,9 @@ AnimatorStateMachine:
|
|||
- serializedVersion: 1
|
||||
m_State: {fileID: 3962034511655292697}
|
||||
m_Position: {x: -250, y: -110, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -8866494684727614440}
|
||||
m_Position: {x: -20, y: -160, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions: []
|
||||
m_EntryTransitions: []
|
||||
|
|
@ -1961,6 +1991,28 @@ AnimatorStateTransition:
|
|||
m_InterruptionSource: 2
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &2875394452186955743
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions: []
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 110222392}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.8026316
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &2894507576667459654
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 59c89802c79a51c4d8a3f24c8865fe7d
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -3,6 +3,7 @@ using UnityEngine;
|
|||
public class ProjectileHitChecker : MonoBehaviour
|
||||
{
|
||||
public bool Off_OnlyThisObj_byHit = false;
|
||||
public bool NoDMG = false;
|
||||
|
||||
ProjectileBase m_ProjectileBase;
|
||||
BoxCollider m_Collider;
|
||||
|
|
@ -34,7 +35,7 @@ public class ProjectileHitChecker : MonoBehaviour
|
|||
}
|
||||
private void ProcessCollider(Collider other)
|
||||
{
|
||||
if (m_ProjectileBase.ProcessCollider(other, !Off_OnlyThisObj_byHit) && Off_OnlyThisObj_byHit)
|
||||
if (m_ProjectileBase.ProcessCollider(other, !Off_OnlyThisObj_byHit, NoDMG) && Off_OnlyThisObj_byHit)
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,25 +1,19 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
public class Projectile_Curved : ProjectileBase
|
||||
{
|
||||
public Transform startPoint; // 시작 지점
|
||||
public Transform endPoint; // 목표 지점
|
||||
public float curveHeight = 2f; // 곡선의 높이
|
||||
public float duration = 1f; // 투사체가 이동하는 데 걸리는 시간
|
||||
|
||||
public void Launch(Vector3 start, Vector3 end)
|
||||
public void Launch_Curved(Vector3 start, Vector3 end, float duration, float curveHeight, bool endoff, Action endact = null)
|
||||
{
|
||||
startPoint.position = start;
|
||||
endPoint.position = end;
|
||||
StartCoroutine(MoveAlongCurve());
|
||||
StartCoroutine(MoveAlongCurve(start, end, duration, curveHeight, endoff, endact));
|
||||
}
|
||||
|
||||
private IEnumerator MoveAlongCurve()
|
||||
private IEnumerator MoveAlongCurve(Vector3 start, Vector3 end, float duration, float curveHeight, bool endoff, Action endact)
|
||||
{
|
||||
float elapsedTime = 0f;
|
||||
|
||||
Vector3 controlPoint = (startPoint.position + endPoint.position) / 2; // 시작과 끝의 중간 지점
|
||||
Vector3 controlPoint = (start + end) * 0.5f; // 시작과 끝의 중간 지점
|
||||
controlPoint += Vector3.up * curveHeight; // 곡선 높이 추가
|
||||
|
||||
while (elapsedTime < duration)
|
||||
|
|
@ -28,16 +22,15 @@ public class Projectile_Curved : ProjectileBase
|
|||
float t = elapsedTime / duration;
|
||||
|
||||
// 베지어 곡선 계산
|
||||
Vector3 pointOnCurve = Mathf.Pow(1 - t, 2) * startPoint.position +
|
||||
2 * (1 - t) * t * controlPoint +
|
||||
Mathf.Pow(t, 2) * endPoint.position;
|
||||
Vector3 pointOnCurve = Mathf.Pow(1 - t, 2) * start + 2 * (1 - t) * t * controlPoint + Mathf.Pow(t, 2) * end;
|
||||
|
||||
// 투사체 위치 이동
|
||||
transform.position = pointOnCurve;
|
||||
yield return null;
|
||||
}
|
||||
transform.position = end;
|
||||
|
||||
// 이동이 끝난 후 투사체 삭제
|
||||
Off(true);
|
||||
if (endoff) Off(true);
|
||||
endact?.Invoke();
|
||||
}
|
||||
}
|
||||
|
|
@ -338,7 +338,7 @@ public class ProjectileBase : MonoBehaviour
|
|||
|
||||
protected virtual void OnTriggerEnter(Collider other) { ProcessCollider(other); }
|
||||
protected virtual void OnCollisionEnter(Collision collision) { ProcessCollider(collision.collider); }
|
||||
public virtual bool ProcessCollider(Collider other, bool Off_byHit = true)
|
||||
public virtual bool ProcessCollider(Collider other, bool Off_byHit = true, bool noDmg = false)
|
||||
{
|
||||
switch (other.tag)
|
||||
{
|
||||
|
|
@ -351,7 +351,7 @@ public class ProjectileBase : MonoBehaviour
|
|||
var hitter = other.GetComponent<Actor>();
|
||||
if (m_ProjectTileData.shooter.IsEnemy() != hitter.IsEnemy())
|
||||
{
|
||||
hitter.Get_Damage(Get_DamageInfo());
|
||||
if (!noDmg) hitter.Get_Damage(Get_DamageInfo());
|
||||
m_ProjectTileData.Action_OnHit?.Invoke(hitter);
|
||||
Show_HitEffect(true, hitter);
|
||||
if (Off_byHit) Off(false);
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@ public class Skill_ExplosionArea : ProjectileBase
|
|||
Off(true);
|
||||
}
|
||||
|
||||
public override bool ProcessCollider(Collider other, bool Off_byHit = true)
|
||||
public override bool ProcessCollider(Collider other, bool Off_byHit = true, bool NoDMG = false)
|
||||
{
|
||||
if (base.ProcessCollider(other, Off_byHit))
|
||||
if (base.ProcessCollider(other, Off_byHit, NoDMG))
|
||||
{
|
||||
if (isStep3) other.GetComponent<Actor>().Stun_AfterKnockBack(Get_AwakenData(3, 1));
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
public class Skill_TrapSetup : Projectile_Curved
|
||||
{
|
||||
public ProjectileHitChecker TrapHitChecker, ExplosionHitChecker;
|
||||
public GameObject go_danger;
|
||||
[Header("함정 높이 오프셋 (바닥에 맞춰주기 위함")]
|
||||
public Vector3 offset = new Vector3(0f, 0.35f, 0f);
|
||||
|
||||
public override void Set(ProjectileData _data)
|
||||
{
|
||||
TrapHitChecker.gameObject.SetActive(true);
|
||||
TrapHitChecker.Get_Collider().enabled = false;
|
||||
go_danger.SetActive(false);
|
||||
ExplosionHitChecker.gameObject.SetActive(false);
|
||||
_data.Action_OnHit = hitter =>
|
||||
{
|
||||
if (!ExplosionHitChecker.gameObject.activeInHierarchy)
|
||||
StartCoroutine(Co_Update());
|
||||
};
|
||||
_data.eStartPos = eProjectileStartPos.ShooterCenter;
|
||||
base.Set(_data);
|
||||
var end = _data.target.Get_position() + offset;
|
||||
Launch_Curved(transform.position, end, 1f, 2f, false,
|
||||
() =>
|
||||
{
|
||||
TrapHitChecker.Get_Collider().enabled = true;
|
||||
go_danger.SetActive(true);
|
||||
go_danger.transform.position -= offset;
|
||||
});
|
||||
}
|
||||
|
||||
IEnumerator Co_Update()
|
||||
{
|
||||
go_danger.SetActive(false);
|
||||
ExplosionHitChecker.Get_Collider().enabled = true;
|
||||
ExplosionHitChecker.gameObject.SetActive(true);
|
||||
yield return null;
|
||||
ExplosionHitChecker.Get_Collider().enabled = false;
|
||||
yield return new WaitForSeconds(1f);
|
||||
Off(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 03b8f63e576912f4d949a08d0f43b644
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -197,16 +197,16 @@ public enum eEffect
|
|||
|
||||
Skill_Tornado, Skill_ManaShield, Skill_Frozen, Skill_BlackHole, Skill_CurseofWitch, Skill_MultiShot, Skill_IceArrows,
|
||||
Skill_SpeedUp, Skill_Ignited, Skill_Heal, Skill_Buff_FastShot, Skill_MeteoStorm, Skill_StatUp, Skill_HeavyRain,
|
||||
Skill_Shield, Skill_Bead, Skill_ExplosionArea, Skill_SpiritBless, Skill_SwordShield, Skill_StraightBurst, Skill_Resurrection,
|
||||
Skill_Shield, Skill_Bead, Skill_ExplosionArea, Skill_SpiritBless, Skill_StraightBurst, Skill_Resurrection,
|
||||
Skill_IceBolt, Skill_Fireball, Skill_FireBolt, Skill_EnergyBall, Skill_Blizzard, Skill_Flower, Skill_Golem, Skill_EarthWorm,
|
||||
Skill_Hurricane, Skill_EatSnack, Skill_ShieldAttack, Skill_JumpAttack, Skill_ManaBurst,
|
||||
Skill_Hurricane, Skill_EatSnack, Skill_ShieldAttack, Skill_JumpAttack, Skill_ManaBurst, Skill_DaggerThrow,
|
||||
|
||||
Skill_DaggerThrow, Skill_OneHandCombo1, Skill_FatalBlow,
|
||||
Skill_DashSlash, Skill_EnergySlash, Skill_BrutalSlash,
|
||||
Skill_OneHandCombo1, Skill_FatalBlow, Skill_DashSlash,
|
||||
Skill_SwordShield, Skill_EnergySlash, Skill_BrutalSlash,
|
||||
Skill_Berserk, Skill_EarthSlam, Skill_Whirlwind,
|
||||
Skill_SweepAttack, Skill_VitalStrike, Skill_DeathBlade,
|
||||
Skill_ShadowSlash, Skill_DarkAmbush, Skill_PhantomFrenzy,
|
||||
Skill_UnpredictableArrow,
|
||||
Skill_UnpredictableArrow, Skill_TrapSetup,
|
||||
|
||||
Skill_Poison,
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue