Skip to content

Instantly share code, notes, and snippets.

@IndieGameMaker
IndieGameMaker / PlayerCtrl.cs
Created February 28, 2021 16:38
[스크립트 6 11] PlayerCtrl - 델리게이트와 이벤트 선언
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerCtrl : MonoBehaviour
{
//컴포넌트를 캐시 처리할 변수
private Transform tr;
//Animation 컴포넌트를 저장할 변수
private Animation anim;
@IndieGameMaker
IndieGameMaker / PlayerCtrl.cs
Last active February 28, 2021 14:10
[스크립트 6 8] PlayerCtrl - PlayerDie 함수 수정
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerCtrl : MonoBehaviour
{
//컴포넌트를 캐시 처리할 변수
private Transform tr;
//Animation 컴포넌트를 저장할 변수
@IndieGameMaker
IndieGameMaker / MonsterCtrl.cs
Created February 27, 2021 06:53
[스크립트 6 6] MonsterCtrl - 혈흔 효과 생성 로직
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//내비게이션 기능을 사용하기 위해 추가해야 하는 네임스페이스
using UnityEngine.AI;
public class MonsterCtrl : MonoBehaviour
{
//몬스터의 상태 정보
@IndieGameMaker
IndieGameMaker / MonsterCtrl.cs
Created February 26, 2021 15:38
절대강좌 유니티2021 - [스크립트 6-4]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//내비게이션 기능을 사용하기 위해 추가해야 하는 네임스페이스
using UnityEngine.AI;
public class MonsterCtrl : MonoBehaviour
{
//몬스터의 상태 정보
@IndieGameMaker
IndieGameMaker / MonsterCtrl.cs
Last active February 26, 2021 12:11
절대강좌! 유니티 - [스크립트 6-1]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//내비게이션 기능을 사용하기 위해 추가해야 하는 네임스페이스
using UnityEngine.AI;
public class MonsterCtrl : MonoBehaviour
{
//컴포넌트 캐시 처리할 변수
@IndieGameMaker
IndieGameMaker / RemoveBullet.cs
Created February 22, 2021 02:58
[스크립트 5-8] RemoveBullet - 스파크 파티클의 강제 소멸로직
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RemoveBullet : MonoBehaviour
{
//스파크 파티클 프리팹 연결할 변수
public GameObject sparkEffect;
//충돌이 시작할 때 발생하는 이벤트
@IndieGameMaker
IndieGameMaker / FireCtrl.cs
Created February 19, 2021 16:46
절대강좌! 유니티 2021 - [스크립트 5-4]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FireCtrl : MonoBehaviour
{
//총알 프리팹
public GameObject bullet;
//총알 발사 좌표
public Transform firePos;
@IndieGameMaker
IndieGameMaker / MyGizmos.cs
Created February 19, 2021 16:29
절대강좌! 유니티 2021 - [스크립트 5-3]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MyGizmos : MonoBehaviour
{
public Color _color = Color.yellow;
public float _radius = 0.1f;
void OnDrawGizmos()
@IndieGameMaker
IndieGameMaker / RemoveBullet.cs
Created February 19, 2021 15:43
절대강좌! 유니티 2021 - [스크립트 5-2]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RemoveBullet : MonoBehaviour
{
//충돌이 시작할 때 발생하는 이벤트
void OnCollisionEnter(Collision coll)
{
//충돌한 게임오브젝트의 태그값 비교
@IndieGameMaker
IndieGameMaker / BulletCtrl.cs
Created February 19, 2021 15:33
절대강좌! 유니티 2021 - [스크립트 5-1]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BulletCtrl : MonoBehaviour
{
//총알의 파괴력
public float damage = 20.0f;
//총알 발사 힘
public float force = 1000.0f;