Skip to content

Commit 0b1443a

Browse files
Added GetAsset and HasAsset to controller
1 parent 3267663 commit 0b1443a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Runtime/Controller.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,5 +191,21 @@ public System.Object GetService (System.Type typeOf) {
191191
return true;
192192
return false;
193193
}
194+
195+
/// Gets an asset from this controller.
196+
public Object GetAsset (string name) {
197+
for (var _i = 0; _i < this.assets.Length; _i++)
198+
if (this.assets[_i].name == name)
199+
return this.assets[_i];
200+
throw new System.Exception ("Unable to get asset, it was not added to the controller");
201+
}
202+
203+
/// Check whether this controller has an asset.
204+
public bool GetAsset (string name) {
205+
for (var _i = 0; _i < this.assets.Length; _i++)
206+
if (this.assets[_i].name == name)
207+
return true;
208+
throw false;
209+
}
194210
}
195211
}

0 commit comments

Comments
 (0)