본문 바로가기

Unity/수업 내용47

[3D]AppleCatch - 사과 받기 3d 프로젝트 생성 안드로이드 빌드 세팅 Models , Sounds 에 챕터8 리소스 넣기 Save as 에서 GameScene저장 1920x1080 Landscape로 화면 조정 stage 끌어오고 언팩하고 Dictional Light 위치 조정 Intensity 0.7 바스켓의 그림자 변경하기 Edit -> Project Settings -> Qullity -> Shadow Distance(150->30) 변경 변경 후 모습 바스켓을 상.하.좌.우로 이동하기 Scriptes 파일을 만들고 스크립트 생성 Basket 오브젝트에 넣어준다 라이트 설정과 코드 using System.Collections; using System.Collections.Generic; using UnityEngine; pub.. 2021. 10. 25.
[3D] MiniRPG - 플레이어 버튼 생성 UI로 버튼 오브젝트를 생성한다 Text 이름을 캐릭터 생성으로 바꿔준다 스크립트 생성 코드 작성 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class TestCreateHeroMain : MonoBehaviour { public Button btnCreatHero; public GameObject prefab; // Start is called before the first frame update void Start() { this.prefab = Resources.Load("Prefabs/ch_02_01"); //동기 Debug.LogFormat("pr.. 2021. 10. 22.
[3D] MiniRPG - 플레이어 생성 및 컨트롤 플레이어 생성 플레이어 이동 Hero 프리팹화 하기 Model Name 에 리소스 이름을 적는다 ch_02_01 *오류 상황 발생 오류 해결 - 프리팹 이름(스펠링)이 달랐다... 생성 및 이동 코드는 선생님 코드 using System.Collections; using System.Collections.Generic; using UnityEngine; public class InputTestMain : MonoBehaviour { public Transform point; public Hero hero; public string modelName; private GameObject heroPrefab; private GameObject modelPrefab; // Start is called befor.. 2021. 10. 19.
[3D] MiniRPG 준비 및 리소스 프로젝트명 : MiniRPG 템플릿 : 3D 타겟 플랫폼 : android 해상도 : 1920x1080 리소스 출처 : Unity Asset Store 무료 2021. 10. 19.
[2D]프로젝트PlayAndplane - 적 기체 랜덤 스폰 파일 폴더명 특수문자X GameManeger 오브젝트를 생성 GameManeger 스크립트를 만든 후 넣어준다 코드 작성 using System.Collections; using System.Collections.Generic; using UnityEngine; public class GameManeger : MonoBehaviour { public GameObject[] EnemyObjs; public Transform[] spawnPoint; public float maxSpawnDelay; public float curSpawnDelay; // Start is called before the first frame update void Start() { } // Update is called once.. 2021. 10. 15.
[2D]프로젝트Play&plane - 적 기체 제거 각각의 Enemy 오브젝트들의 hp를 5, 10, 20 으로 해준다 적 기체 제거 완료 2021. 10. 14.
[2D]프로젝트Play&plane - 적기 피격 시 미사일 불통과 Destroy(this.gameObject); 를 바깥으로 끄집어낸다 피격시 미사일 불통과 2021. 10. 14.
[2D]프로젝트Play&plane - 적기 피격 연출 *적기 피격 연출 Enemy Small, Middle, Big 오브젝트에 각각 Enemy A, B, C Hit 이미지를 자식으로 넣는다 EnemyHitTrigger 스크립트를 생성 각각 부모Enemy에 끌어다 넣는다 EnemyHitTrigger 스크립트 열기 코드 작성 using System.Collections; using System.Collections.Generic; using UnityEngine; public class EnemyHitTrigger : MonoBehaviour { public int hp = 100; public GameObject hitGo; private float delta; private float span = 0.2f; private bool isHit = false;.. 2021. 10. 14.
[2D]프로젝트Play&plane - 생명력 표시(3개) GameMain 오브젝트 생성 GameMain 스크립트 생성 후 오브젝트에 끌어다 넣기 GameMain 스크립트 코드 작성 using System.Collections; using System.Collections.Generic; using UnityEngine; public class GameMain : MonoBehaviour { public int playerLife = 3; public GameDirector gameDirector; // Start is called before the first frame update void Start() { this.gameDirector.Init(this.playerLife); } // Update is called once per frame void Up.. 2021. 10. 14.
[2D]프로젝트Play&plane - 점수판 만들기 Canvas에 Text를 만들고 Score를 작성 GameDirector 오브젝트를 만들고 GameDirector 스크립스 생성 후 오브젝트 안에 넣어준다 코트 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class GameDirector : MonoBehaviour { public Text txtScore; private int totalScore; public void AddScore(int score) { this.totalScore += score; this.txtScore.text = totalScore.ToString(); } } 코드 작성 후 t.. 2021. 10. 14.