+ Item관련 Excel, Json, So 수정 + DropItemTable 로직 수정 + 아이템 프리팹에서 Enable Interaction 체크하면 직접 룻팅, 해제하면 자동 룻팅 + 체력회복 아이템 추가 + 개발자 메뉴 상호작용 "F1" 키를 통해 접근 가능 + 보스 맵은 마법진을 상호작용하면 보스전 시작 + 맵 안에서 교전 중일 때, 투명 벽 쉐이더 추가 + 맵 마다의 통로를 통해서 이동 가능 + 선형적인 맵 구조에 맞게 리소스 및 위치 수정 + 타이틀 화면으로 이동할 때 나타나는 오류 수정(CombatUiManager OnDisable 싱글톤 문제) Closes #25, #26
62 lines
2.1 KiB
C#
62 lines
2.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using BlueWater.Maps;
|
|
using UnityEngine;
|
|
|
|
namespace BlueWater.Enemies.Bosses.TitanSlime
|
|
{
|
|
public class TitanSlimeAttackedParticle : MonoBehaviour
|
|
{
|
|
private ParticleSystem _titanSlimeAttackedParticle;
|
|
|
|
[SerializeField]
|
|
private Vector2 _randomDestroy = new(5f, 7f);
|
|
|
|
[SerializeField]
|
|
private GameObject[] _stainPrefabs;
|
|
|
|
private Transform _instantiateLocation;
|
|
private List<ParticleCollisionEvent> _collisionEvents;
|
|
|
|
private void Start()
|
|
{
|
|
_titanSlimeAttackedParticle = GetComponent<ParticleSystem>();
|
|
_instantiateLocation = FindAnyObjectByType<TitanSlimeMapController>().ParticleInstanceLocation;
|
|
_collisionEvents = new List<ParticleCollisionEvent>();
|
|
}
|
|
|
|
private void OnParticleCollision(GameObject other)
|
|
{
|
|
var numCollisionEvents = _titanSlimeAttackedParticle.GetCollisionEvents(other, _collisionEvents);
|
|
for (var i = 0; i < numCollisionEvents; i++)
|
|
{
|
|
InstantiateStain(_collisionEvents[i].intersection);
|
|
}
|
|
}
|
|
|
|
private void InstantiateStain(Vector3 position)
|
|
{
|
|
position.y += 0.01f;
|
|
var stain = Instantiate(_stainPrefabs[Random.Range(0, _stainPrefabs.Length)], position, Quaternion.Euler(90, 0, 0), _instantiateLocation);
|
|
var randomDestroyTime = Random.Range(_randomDestroy.x, _randomDestroy.y);
|
|
StartCoroutine(DestroyStainCoroutine(stain, randomDestroyTime));
|
|
}
|
|
|
|
private IEnumerator DestroyStainCoroutine(GameObject stain, float destroyTime)
|
|
{
|
|
var elapsedTime = 0f;
|
|
while (elapsedTime < destroyTime)
|
|
{
|
|
elapsedTime += Time.deltaTime;
|
|
|
|
var remainingTime = destroyTime - elapsedTime;
|
|
if (remainingTime < 0.5f)
|
|
{
|
|
stain.transform.localScale = Vector3.one * (remainingTime / 0.5f);
|
|
}
|
|
yield return null;
|
|
}
|
|
Destroy(stain);
|
|
}
|
|
}
|
|
} |