浏览代码

added current engine

Nicolas Cannasse 13 年之前
父节点
当前提交
deea72a737
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      h3d/Engine.hx

+ 12 - 0
h3d/Engine.hx

@@ -40,6 +40,18 @@ class Engine {
 		var stage = flash.Lib.current.stage;
 		s3d = stage.stage3Ds[stageIndex];
 		camera = new Camera();
+		if( CURRENT == null )
+			CURRENT = this;
+	}
+	
+	static var CURRENT : Engine = null;
+	
+	public static function getCurrent() {
+		return CURRENT;
+	}
+	
+	public function setCurrent() {
+		CURRENT = this;
 	}
 
 	public function show( b ) {