Skip to content

Instantly share code, notes, and snippets.

@IndieGameMaker
IndieGameMaker / MonsterCtrl.cs
Created March 10, 2021 11:28
[스크립트 8 9] MonsterCtrl - 오브젝트 풀을 반영한 최종 스크립트
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//내비게이션 기능을 사용하기 위해 추가해야 하는 네임스페이스
using UnityEngine.AI;
public class MonsterCtrl : MonoBehaviour
{
//몬스터의 상태 정보
@IndieGameMaker
IndieGameMaker / GameManager.cs
Last active March 10, 2021 07:18
[스크립트 8 8] GameManager - 오브젝트 풀에서 몬스터 추출하는 로직 추가
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour
{
//몬스터가 출현할 위치를 저장할 List 타입 변수
public List<Transform> points = new List<Transform>();
//몬스터를 미리 생성해 저장할 리스트 자료형
@IndieGameMaker
IndieGameMaker / GameManager.cs
Created March 10, 2021 05:22
[스크립트 8 7] GameManager - 오브젝트 풀링 생성 로직
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour
{
//몬스터가 출현할 위치를 저장할 List 타입 변수
public List<Transform> points = new List<Transform>();
//몬스터를 미리 생성해 저장할 리스트 자료형
@IndieGameMaker
IndieGameMaker / GameManager.cs
Created March 10, 2021 03:54
[스크립트 8 5] GameManager - 싱글턴 구현
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour
{
//몬스터가 출현할 위치를 저장할 List 타입 변수
public List<Transform> points = new List<Transform>();
//몬스터 프리팹을 연결할 변수
@IndieGameMaker
IndieGameMaker / PlayerCtrl.cs
Created March 10, 2021 03:51
[스크립트 8 4] PlayerCtrl - GameManager의 IsGameOver 프로퍼티 접근
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PlayerCtrl : MonoBehaviour
{
//컴포넌트를 캐시 처리할 변수
private Transform tr;
//Animation 컴포넌트를 저장할 변수
@IndieGameMaker
IndieGameMaker / GameManager.cs
Created March 8, 2021 12:04
[스크립트 8 3] GameManager - 몬스터 생성로직 추가
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour
{
//몬스터가 출현할 위치를 저장할 List 타입 변수
public List<Transform> points = new List<Transform>();
//몬스터 프리팹을 연결할 변수
@IndieGameMaker
IndieGameMaker / GameManager.cs
Created March 8, 2021 08:59
[스크립트 8 2] GameManager - List 데이터 사용
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour
{
//몬스터가 출현할 위치를 저장할 List 타입 변수
public List<Transform> points = new List<Transform>();
void Start()
@IndieGameMaker
IndieGameMaker / GameManager.cs
Created March 8, 2021 08:31
[스크립트 8-1] GameManager - SpawnPointGroup 하위의 Transform 컴포넌트 추출
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour
{
//몬스터가 출현할 위치를 저장할 배열
public Transform[] points;
void Start()
@IndieGameMaker
IndieGameMaker / MonsterCtrl.cs
Last active March 1, 2021 04:27
[스크립트 6-10] MonsterCtrl - 애니메이션 재생속도 변경로직 추가
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//내비게이션 기능을 사용하기 위해 추가해야 하는 네임스페이스
using UnityEngine.AI;
public class MonsterCtrl : MonoBehaviour
{
//몬스터의 상태 정보
@IndieGameMaker
IndieGameMaker / MonsterCtrl.cs
Last active March 1, 2021 04:28
[스크립트 6 12] MonsterCtrl - 이벤트 연결과 해제 로직 추가
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//내비게이션 기능을 사용하기 위해 추가해야 하는 네임스페이스
using UnityEngine.AI;
public class MonsterCtrl : MonoBehaviour
{
//몬스터의 상태 정보