Browse Source

Exposed ResourceManager via property in Node2D

master
Bryan Miller 6 years ago
parent
commit
70abfb0fa7
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      game/gbe/nodes.py

+ 8
- 0
game/gbe/nodes.py View File

return self.parent.full_name + "." + self.name return self.parent.full_name + "." + self.name


@property @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): def child_count(self):
return len(this._NODE_DATA["children"]) return len(this._NODE_DATA["children"])



Loading…
Cancel
Save