Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 코딩테스트
- 싱글톤
- 결제연동
- FillMethod
- JSP
- iamport
- java
- 백준
- BOJ
- 린트
- Awake()
- 알고리즘
- FillAmount
- FillOrigin
- learning javascript
- DontDestroyOnLoad()
- 백준알고리즘
- 아임포트
- javascript
- Unity
- Destroy()
- ajax
- API
- EOF
- web
- 카카오페이
- 바벨
- image
Archives
- Today
- Total
IT는 개발자
unity 화살 생성하기 본문
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ArrowGenerator:MonoBehaviour{
public GameObject arrowPrefab;
float span = 1.0f; //화살의 생성 간격을 바꿀 수 있다 (0.5가 되면 두배)
float delta = 0;
void Update(){
this.delta += Time.deltaTime; //지난 프레임이 완료되는 데 까지 걸린 시간
if(this.delta > this.span){
this.delta = 0;
GameObject go = Instantiate(arrowPrefab) as GameObject; //Instantiate: 오브젝트의 인스턴스 ID를 반환
go.transform.position = new Vector3(px, 7, 0); //월드 공간에서 트랜스폼의 위치
}
}
}
//화살을 계속 생성해내는 스크립트!
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
'unity' 카테고리의 다른 글
unity 이벤트 함수 (0) | 2020.01.20 |
---|---|
unity canvas 사이즈 조정 (0) | 2020.01.20 |
unity 기본 개념 정리 (0) | 2020.01.16 |
unity 싱글톤을 활용한 코드 작성하기 (0) | 2019.11.19 |
unity 이미지 게이지 관련 바(에너지 채우기) (0) | 2019.11.19 |
Comments