C#[delegate]대리자
Unity/수업내용2019. 4. 16. 03:37
C,C++ 에서 함수포인터처럼 메서드를 안전하게 캡슐화하는 형식 (함수포인터와 다른점 : 개체지향적, 형식안전, 보안유지)
'Unity > 수업내용' 카테고리의 다른 글
조이스틱으로 이동하기 및 맵밖으로 이동시키지 않기 (0) | 2019.04.26 |
---|---|
버튼 누르면 공격 (반복) 및 데미지Text (0) | 2019.04.25 |
[unity] Awake 와 Start 의 차이 (0) | 2019.04.24 |
Unity[유니티]MoveAttack(시간참조) (0) | 2019.04.12 |
Unity[유니티] 목표지점까지 이동 중 공격 (0) | 2019.04.11 |
Unity[유니티]MoveAttack(시간참조)
Unity/수업내용2019. 4. 12. 18:59
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | using System.Collections; using System.Collections.Generic; using UnityEngine; public class App : MonoBehaviour { private float elapsedTime; private float attackAnimationLength = 0.733f; private bool attackStart = false; private bool isAttack = false; private int totalFrame = 22; private int attackFrame = 8; // Start is called before the first frame update void Start() { Debug.Log("앱이 실행되었습니다"); this.attackStart = true; } // Update is called once per frame void Update() { if (this.attackStart == true) { this.elapsedTime += Time.deltaTime; //현재시간(누적) //현재프레임 = Total프레임 * 현재시간 / Total시간 var fram = this.elapsedTime * this.totalFrame / this.attackAnimationLength; Debug.LogFormat("Fram : {0}", (int)fram); Debug.LogFormat("현재시간 : {0}", this.elapsedTime); if ((int)fram >= this.attackFrame) { //this.isAttack = true; Debug.LogFormat("<color=red>공격</color>"); if (this.elapsedTime >= attackAnimationLength) { elapsedTime = 0; Debug.Log("애니메이션종료"); Debug.Log("기본애니메이션"); this.attackStart = false; } } } } } | cs |
'Unity > 수업내용' 카테고리의 다른 글
조이스틱으로 이동하기 및 맵밖으로 이동시키지 않기 (0) | 2019.04.26 |
---|---|
버튼 누르면 공격 (반복) 및 데미지Text (0) | 2019.04.25 |
[unity] Awake 와 Start 의 차이 (0) | 2019.04.24 |
C#[delegate]대리자 (0) | 2019.04.16 |
Unity[유니티] 목표지점까지 이동 중 공격 (0) | 2019.04.11 |
Unity[유니티] 목표지점까지 이동 중 공격
Unity/수업내용2019. 4. 11. 22:31
공격 모선 끝나고 기본모션으로 전환하기 해야함
'Unity > 수업내용' 카테고리의 다른 글
조이스틱으로 이동하기 및 맵밖으로 이동시키지 않기 (0) | 2019.04.26 |
---|---|
버튼 누르면 공격 (반복) 및 데미지Text (0) | 2019.04.25 |
[unity] Awake 와 Start 의 차이 (0) | 2019.04.24 |
C#[delegate]대리자 (0) | 2019.04.16 |
Unity[유니티]MoveAttack(시간참조) (0) | 2019.04.12 |