瀏覽代碼

Exposed ResourceManager via property in Node2D

master
Bryan Miller 6 年之前
父節點
當前提交
70abfb0fa7
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. +8
    -0
      game/gbe/nodes.py

+ 8
- 0
game/gbe/nodes.py 查看文件

@@ -64,6 +64,14 @@ class Node:
return self.parent.full_name + "." + self.name

@property
def resource(self):
if self._NODE_DATA["resource"] is None:
# Only bother creating the instance if it's being asked for.
# All ResourceManager instances access same data.
self._NODE_DATA["resource"] = ResourceManager()
return self._NODE_DATA["resource"]

@property
def child_count(self):
return len(this._NODE_DATA["children"])


Loading…
取消
儲存