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 |
Tags
- 최단거리 알고리즘
- unity sparkmain(clone)
- 트리구조
- 유니티 sparkmain(clone)
- 깊이탐색
- 유니티
- 디지털트윈
- raycast
- BFS
- dropdown
- dfs
- articulation body
- Simulation
- 너비탐색
- unity korea
- GetComponent
- C#
- Unity
- 티스토리챌린지
- 최소신장트리 mst
- 드롭다운
- sparkmain(clone) 무한생성
- sparkmain(clone)
- list clear
- 오블완
- readonly
- 행동트리
- 크루스칼
- navisworks api
- removeAll
Archives
- Today
- Total
낑깡의 게임 프로그래밍 도전기
유니티 체력바 표시(이미지 FillAmount) 본문
반응형
SMALL
스크립트를 해당 이미지에 만들어준다
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class HpFillAmount : MonoBehaviour
{
Image hpFillImage;
public Player player;
float maxHp = 100f;
void Start()
{
hpFillImage = GetComponent<Image>();
}
void Update()
{
hpFillImage.fillAmount = player.Hp / maxHp;
}
}
저 pubilc Player player; 에 플레이어 오브젝트를 끌어 넣어준다.
반응형
LIST