Page 429 - MDP2022-3
P. 429
IEnumerator KillPlayer()
{
transform.localScale = new Vector3(1.5f, 1.5f, 0f);
transform.Translate(player.position + offset);
mainCamera.SetActive(false);
subCamera.SetActive(true);
yield return new WaitForSeconds(1f);
//Destroy(gameObject);
//mainCamera.SetActive(true);
//subCamera.SetActive(false);
}
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Player")
StartCoroutine("KillPlayer");
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Girl_Ghost_Particle : MonoBehaviour
{
private ParticleSystem particle;
public GameObject obj;
private void Awake()
{
particle = GetComponent<ParticleSystem>();
}
private void Update()
{
if(obj != null)
transform.position = obj.transform.position;
}
public IEnumerator Particle_Start()
{
Debug.Log("푸와오와악");
particle.Play();
yield return new WaitForSeconds(3f);
particle.Stop();
}
}