-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHogeController.cs
More file actions
52 lines (44 loc) · 1012 Bytes
/
HogeController.cs
File metadata and controls
52 lines (44 loc) · 1012 Bytes
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
49
50
51
52
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HogeController : MonoBehaviour
{
CharacterDataManager characterDataManager;
void Start()
{
characterDataManager = new CharacterDataManager();
}
/// <summary>
/// 確認用
/// </summary>
public void ShowLogCharacters()
{
var characters = characterDataManager.characters;
foreach(KeyValuePair<int, Character> character in characters)
{
Character c = character.Value;
Debug.Log(
"id:" + c.id + ", " +
"name:" + c.name + ", " +
"hp:" + c.hp + ", " +
"exp:" + c.exp
);
}
}
public void CreateCharacters()
{
// TODO 適当にInputフィールドとかから入れたりする
characterDataManager.CreateCharacter("test", 100,100);
Debug.Log("created");
}
public void ReduceHp()
{
characterDataManager.ReduceHp(1, 10);
Debug.Log("reduced");
}
public void DeleteData()
{
PlayerPrefs.DeleteAll();
Debug.Log("deleted.please restart");
}
}