-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFirstStratCode.cs
More file actions
44 lines (41 loc) · 1.11 KB
/
FirstStratCode.cs
File metadata and controls
44 lines (41 loc) · 1.11 KB
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
using UnityEngine;
using System;
public class FirstStratCode : MonoBehaviour
{
public partial class Start
{
public Start()
{
Input inputf = new Input();
Debug.Log("Hello World");
int HealthPoint = 50;
Debug.Log(HealthPoint);
if (HealthPoint >= 50)
{
HealthPoint--;
}
Debug.Log(HealthPoint);
while (HealthPoint > 0)
{
HealthPoint--;
Debug.Log("현제 채력" + HealthPoint);
Delay(2000);
}
if (HealthPoint == 0)
{
Debug.Log("체력이" + HealthPoint + "이기 때문에 사망하셨습니다.");
}
}
public void Delay(int ms)
{
DateTime dateTimeNow = DateTime.Now;
TimeSpan duration = new TimeSpan(0, 0, 0, 0, ms);
DateTime dateTimeAdd = dateTimeNow.Add(duration);
while (dateTimeAdd >= dateTimeNow)
{
dateTimeNow = DateTime.Now;
}
return;
}
}
}