캐릭터 스킬 공격 투사체 적용
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TON
|
||||
{
|
||||
public class DarknessBall : PoolAble
|
||||
{
|
||||
private float elapsedTime; // 경과 시간 저장 변수
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
elapsedTime = 0f; // 오브젝트가 활성화될 때 초기화
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
elapsedTime += Time.deltaTime; // 경과 시간 누적
|
||||
|
||||
// 2초가 지나면 오브젝트 풀에 반환
|
||||
if (elapsedTime >= 2f)
|
||||
{
|
||||
ReleaseObject();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerEnter2D(Collider2D collision)
|
||||
{
|
||||
if (collision.CompareTag("Monster")) // 적과 충돌 시 제거
|
||||
{
|
||||
ReleaseObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 46951a2e33fdd5a409f1579de9b7acfa
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TON
|
||||
{
|
||||
public class FireBall : PoolAble
|
||||
{
|
||||
|
||||
private float elapsedTime; // 경과 시간 저장 변수
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
elapsedTime = 0f; // 오브젝트가 활성화될 때 초기화
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
elapsedTime += Time.deltaTime; // 경과 시간 누적
|
||||
|
||||
// 2초가 지나면 오브젝트 풀에 반환
|
||||
if (elapsedTime >= 2f)
|
||||
{
|
||||
ReleaseObject();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerEnter2D(Collider2D collision)
|
||||
{
|
||||
if (collision.CompareTag("Monster")) // 적과 충돌 시 제거
|
||||
{
|
||||
ReleaseObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 26dd04ed34a3c4042bfbe12766af2d60
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
35
Gameton-06/Assets/Gameton/Scripts/Character/Skill/IceBall.cs
Normal file
35
Gameton-06/Assets/Gameton/Scripts/Character/Skill/IceBall.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TON
|
||||
{
|
||||
public class IceBall : PoolAble
|
||||
{
|
||||
private float elapsedTime; // 경과 시간 저장 변수
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
elapsedTime = 0f; // 오브젝트가 활성화될 때 초기화
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
elapsedTime += Time.deltaTime; // 경과 시간 누적
|
||||
|
||||
// 2초가 지나면 오브젝트 풀에 반환
|
||||
if (elapsedTime >= 2f)
|
||||
{
|
||||
ReleaseObject();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerEnter2D(Collider2D collision)
|
||||
{
|
||||
if (collision.CompareTag("Monster")) // 적과 충돌 시 제거
|
||||
{
|
||||
ReleaseObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa5541b68c81e2347960b5eeaf373bf4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user