-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathUpdateMethod.cs
More file actions
45 lines (33 loc) · 846 Bytes
/
UpdateMethod.cs
File metadata and controls
45 lines (33 loc) · 846 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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UpdateMethod : MonoBehaviour {
private World world = new World();
private void Start() {
Debug.LogError("完成对更新方法的构建");
}
private void Update() {
//world.GameLoop();
}
}
class Entity {
public Entity() {
x_ = 0;
y_ = 0;
}
public void Update() { }
public double x() { return x_; }
public double y() { return y_; }
public void SetX(double x) { x_ = x; }
public void SetY(double y) { y_ = y; }
private double x_;
private double y_;
}
class World {
public void GameLoop() {
for (int i = 0; i < entities.Count; i++) {
entities[i].Update();
}
}
private List<Entity> entities = new List<Entity>();
};