chenzhen 6 年 前
コミット
611ce2a370
100 ファイル変更3017 行追加662 行削除
  1. 262 118
      color3D_laya/bin/js/bundle.js
  2. BIN
      color3D_laya/bin/res/LayaScene_main/Conventional/Assets/AllModel/Floor/Floor-Floor.lm
  3. BIN
      color3D_laya/bin/res/LayaScene_main/Conventional/Assets/AllModel/Floor/Floor-LeftBorder.lm
  4. BIN
      color3D_laya/bin/res/LayaScene_main/Conventional/Assets/AllModel/Floor/Floor-RightBorder.lm
  5. BIN
      color3D_laya/bin/res/LayaScene_main/Conventional/Assets/AllModel/obs_g/obs_g-Mesh.lm
  6. BIN
      color3D_laya/bin/res/LayaScene_main/Conventional/Assets/AllModel/obs_k/obs_k-Mesh.lm
  7. BIN
      color3D_laya/bin/res/LayaScene_main/Conventional/Assets/AllModel/obs_s/obs_s-Mesh.lm
  8. BIN
      color3D_laya/bin/res/LayaScene_main/Conventional/Assets/AllModel/obs_x/obs_x-Mesh.lm
  9. 54 0
      color3D_laya/bin/res/LayaScene_main/Conventional/Assets/Prefabs/M/blackmat.lmat
  10. 54 0
      color3D_laya/bin/res/LayaScene_main/Conventional/Assets/Prefabs/M/perple.lmat
  11. 54 0
      color3D_laya/bin/res/LayaScene_main/Conventional/Assets/Prefabs/M/redmat.lmat
  12. 54 0
      color3D_laya/bin/res/LayaScene_main/Conventional/Assets/Prefabs/M/whitemat.lmat
  13. 54 0
      color3D_laya/bin/res/LayaScene_main/Conventional/Assets/Prefabs/M/yellowmat.lmat
  14. BIN
      color3D_laya/bin/res/LayaScene_main/Conventional/Library/unity default resources-Cylinder.lm
  15. BIN
      color3D_laya/bin/res/LayaScene_main/Conventional/Library/unity default resources-Sphere.lm
  16. 1409 336
      color3D_laya/bin/res/LayaScene_main/Conventional/main.ls
  17. 0 1
      color3D_laya/bin/test/TestScene.json
  18. 1 0
      color3D_laya/laya/pageStyles.xml
  19. 6 0
      color3D_laya/laya/pages/game_ui.scene
  20. 30 51
      color3D_laya/src/AssetController.ts
  21. 1 1
      color3D_laya/src/GameConfig.ts
  22. 51 0
      color3D_laya/src/script/Behaviour/PassivityBehaviour.ts
  23. 8 4
      color3D_laya/src/script/Behaviour/PlayerBehaviour.ts
  24. 0 55
      color3D_laya/src/script/Behaviour/ShellBehaviour.ts
  25. 7 3
      color3D_laya/src/script/Behaviour/BarrierBehaviour.ts
  26. 15 0
      color3D_laya/src/script/GameLogic/DealPackaging.ts
  27. 15 0
      color3D_laya/src/script/GameLogic/GameDefined.ts
  28. 21 0
      color3D_laya/src/script/GameLogic/ObsController.ts
  29. 19 0
      color3D_laya/src/script/GameLogic/PlayerController.ts
  30. 87 0
      color3D_laya/src/script/GameLogic/PoolManager.ts
  31. 41 0
      color3D_laya/src/script/GameLogic/SceneController.ts
  32. 81 0
      color3D_laya/src/script/GameLogic/ViewManager.ts
  33. 1 1
      color3D_laya/src/script/Oimo/OimoBodyData.ts
  34. 1 1
      color3D_laya/src/script/Oimo/OimoHelper.ts
  35. 27 16
      color3D_laya/src/script/Oimo/OimoRigibody.ts
  36. 58 0
      color3D_laya/src/script/Util/Dictionary.ts
  37. 175 0
      color3D_laya/src/script/Util/Game_Tool.ts
  38. 5 4
      color3D_laya/src/ui/layaMaxUI.ts
  39. BIN
      color3D_unity/color3D/.vs/color3D/v16/.suo
  40. 0 0
      color3D_unity/color3D/.vs/color3D/v16/Server/sqlite3/db.lock
  41. BIN
      color3D_unity/color3D/.vs/color3D/v16/Server/sqlite3/storage.ide
  42. 148 0
      color3D_unity/color3D/Assembly-CSharp-Editor.csproj
  43. 4 4
      color3D_unity/color3D/Assembly-CSharp.csproj
  44. 9 0
      color3D_unity/color3D/Assets/Editor.meta
  45. 108 0
      color3D_unity/color3D/Assets/Editor/Editor_Tool.cs
  46. 12 0
      color3D_unity/color3D/Assets/Editor/Editor_Tool.cs.meta
  47. 3 4
      color3D_unity/color3D/Assets/LayaAir3D/LayaTool/Configuration.xml
  48. BIN
      color3D_unity/color3D/Assets/Prefabs/M/FloorMaterial.mat
  49. 9 0
      color3D_unity/color3D/Assets/Prefabs/M/blackmat.mat.meta
  50. BIN
      color3D_unity/color3D/Assets/Prefabs/M/Object1.mat
  51. 0 0
      color3D_unity/color3D/Assets/Prefabs/M/perple.mat.meta
  52. BIN
      color3D_unity/color3D/Assets/Prefabs/M/PlayerMaterial.mat
  53. 0 0
      color3D_unity/color3D/Assets/Prefabs/M/redmat.mat.meta
  54. BIN
      color3D_unity/color3D/Assets/Prefabs/M/whitemat.mat
  55. 0 0
      color3D_unity/color3D/Assets/Prefabs/M/whitemat.mat.meta
  56. BIN
      color3D_unity/color3D/Assets/Prefabs/M/yellowmat.mat
  57. 9 0
      color3D_unity/color3D/Assets/Prefabs/M/yellowmat.mat.meta
  58. BIN
      color3D_unity/color3D/Assets/Prefabs/FracturedBall.prefab
  59. 0 0
      color3D_unity/color3D/Assets/Prefabs/broken.prefab.meta
  60. BIN
      color3D_unity/color3D/Assets/Prefabs/floor.prefab
  61. 2 2
      color3D_unity/color3D/Assets/Prefabs/obs_a.prefab.meta
  62. BIN
      color3D_unity/color3D/Assets/Prefabs/obs_d.prefab
  63. 2 2
      color3D_unity/color3D/Assets/Prefabs/obs_b.prefab.meta
  64. BIN
      color3D_unity/color3D/Assets/Prefabs/obs_g.prefab
  65. 2 2
      color3D_unity/color3D/Assets/Prefabs/obs_c.prefab.meta
  66. BIN
      color3D_unity/color3D/Assets/Prefabs/obs_c.prefab
  67. 9 0
      color3D_unity/color3D/Assets/Prefabs/obs3.prefab.meta
  68. BIN
      color3D_unity/color3D/Assets/Prefabs/obs4.prefab
  69. 9 0
      color3D_unity/color3D/Assets/Prefabs/obs4.prefab.meta
  70. BIN
      color3D_unity/color3D/Assets/Prefabs/obs5.prefab
  71. 9 0
      color3D_unity/color3D/Assets/Prefabs/obs5.prefab.meta
  72. BIN
      color3D_unity/color3D/Assets/Prefabs/obs_k.prefab
  73. 9 0
      color3D_unity/color3D/Assets/Prefabs/obs6.prefab.meta
  74. BIN
      color3D_unity/color3D/Assets/Prefabs/obs_a.prefab
  75. 9 0
      color3D_unity/color3D/Assets/Prefabs/obs7.prefab.meta
  76. BIN
      color3D_unity/color3D/Assets/Prefabs/obs_b.prefab
  77. 9 0
      color3D_unity/color3D/Assets/Prefabs/obs8.prefab.meta
  78. 0 9
      color3D_unity/color3D/Assets/Prefabs/obs_d.prefab.meta
  79. 0 9
      color3D_unity/color3D/Assets/Prefabs/obs_g.prefab.meta
  80. BIN
      color3D_unity/color3D/Assets/Prefabs/obs_h.prefab
  81. 0 9
      color3D_unity/color3D/Assets/Prefabs/obs_h.prefab.meta
  82. 0 9
      color3D_unity/color3D/Assets/Prefabs/obs_k.prefab.meta
  83. BIN
      color3D_unity/color3D/Assets/Prefabs/obs_s.prefab
  84. 0 9
      color3D_unity/color3D/Assets/Prefabs/obs_s.prefab.meta
  85. BIN
      color3D_unity/color3D/Assets/Prefabs/obs_x.prefab
  86. 0 9
      color3D_unity/color3D/Assets/Prefabs/obs_x.prefab.meta
  87. BIN
      color3D_unity/color3D/Assets/Prefabs/player.prefab
  88. 1 1
      color3D_unity/color3D/Assets/Prefabs/player.prefab.meta
  89. 9 0
      color3D_unity/color3D/Assets/Prefabs/propgroup.meta
  90. 9 0
      color3D_unity/color3D/Assets/Scenes.meta
  91. BIN
      color3D_unity/color3D/Assets/Scenes/main.unity
  92. 0 0
      color3D_unity/color3D/Assets/Scenes/main.unity.meta
  93. BIN
      color3D_unity/color3D/Assets/main.unity
  94. 8 0
      color3D_unity/color3D/Assets/Scenes/props.unity.meta
  95. 1 2
      color3D_unity/color3D/Assets/StreamingAssets/LayaDemo/LayaAir3DSample.js
  96. 9 0
      color3D_unity/color3D/Assets/StreamingAssets/LayaDemo/res.meta
  97. 9 0
      color3D_unity/color3D/Assets/StreamingAssets/LayaDemo/res/LayaScene_props.meta
  98. 9 0
      color3D_unity/color3D/Assets/StreamingAssets/LayaDemo/res/LayaScene_props/Conventional.meta
  99. 9 0
      color3D_unity/color3D/Assets/StreamingAssets/LayaDemo/res/LayaScene_props/Conventional/Assets.meta
  100. 0 0
      color3D_unity/color3D/Assets/StreamingAssets/LayaDemo/res/LayaScene_props/Conventional/Assets/AllModel.meta

ファイルの差分が大きいため隠しています
+ 262 - 118
color3D_laya/bin/js/bundle.js


BIN
color3D_laya/bin/res/LayaScene_main/Conventional/Assets/AllModel/Floor/Floor-Floor.lm


BIN
color3D_laya/bin/res/LayaScene_main/Conventional/Assets/AllModel/Floor/Floor-LeftBorder.lm


BIN
color3D_laya/bin/res/LayaScene_main/Conventional/Assets/AllModel/Floor/Floor-RightBorder.lm


BIN
color3D_laya/bin/res/LayaScene_main/Conventional/Assets/AllModel/obs_g/obs_g-Mesh.lm


BIN
color3D_laya/bin/res/LayaScene_main/Conventional/Assets/AllModel/obs_k/obs_k-Mesh.lm


BIN
color3D_laya/bin/res/LayaScene_main/Conventional/Assets/AllModel/obs_s/obs_s-Mesh.lm


BIN
color3D_laya/bin/res/LayaScene_main/Conventional/Assets/AllModel/obs_x/obs_x-Mesh.lm


+ 54 - 0
color3D_laya/bin/res/LayaScene_main/Conventional/Assets/Prefabs/M/blackmat.lmat

@@ -0,0 +1,54 @@
+{
+	"version":"LAYAMATERIAL:02",
+	"props":{
+		"type":"Laya.BlinnPhongMaterial",
+		"name":"blackmat",
+		"renderStates":[
+			{
+				"cull":2,
+				"blend":0,
+				"srcBlend":1,
+				"dstBlend":0,
+				"depthWrite":true,
+				"depthTest":515
+			}
+		],
+		"enableVertexColor":false,
+		"alphaTest":false,
+		"alphaTestValue":0.5,
+		"renderQueue":2000,
+		"albedoIntensity":1,
+		"enableLighting":true,
+		"shininess":0.078125,
+		"textures":[],
+		"vectors":[
+			{
+				"name":"tilingOffset",
+				"value":[
+					1,
+					1,
+					0,
+					0
+				]
+			},
+			{
+				"name":"specularColor",
+				"value":[
+					0.5,
+					0.5,
+					0.5
+				]
+			},
+			{
+				"name":"albedoColor",
+				"value":[
+					0.02205884,
+					0,
+					0,
+					1
+				]
+			}
+		],
+		"defines":[]
+	}
+}

+ 54 - 0
color3D_laya/bin/res/LayaScene_main/Conventional/Assets/Prefabs/M/perple.lmat

@@ -0,0 +1,54 @@
+{
+	"version":"LAYAMATERIAL:02",
+	"props":{
+		"type":"Laya.BlinnPhongMaterial",
+		"name":"perple",
+		"renderStates":[
+			{
+				"cull":2,
+				"blend":0,
+				"srcBlend":1,
+				"dstBlend":0,
+				"depthWrite":true,
+				"depthTest":515
+			}
+		],
+		"enableVertexColor":false,
+		"alphaTest":false,
+		"alphaTestValue":0.5,
+		"renderQueue":2000,
+		"albedoIntensity":1,
+		"enableLighting":true,
+		"shininess":0.1,
+		"textures":[],
+		"vectors":[
+			{
+				"name":"tilingOffset",
+				"value":[
+					1,
+					1,
+					0,
+					0
+				]
+			},
+			{
+				"name":"specularColor",
+				"value":[
+					1,
+					1,
+					1
+				]
+			},
+			{
+				"name":"albedoColor",
+				"value":[
+					1,
+					0.3382353,
+					0.9079902,
+					1
+				]
+			}
+		],
+		"defines":[]
+	}
+}

+ 54 - 0
color3D_laya/bin/res/LayaScene_main/Conventional/Assets/Prefabs/M/redmat.lmat

@@ -0,0 +1,54 @@
+{
+	"version":"LAYAMATERIAL:02",
+	"props":{
+		"type":"Laya.BlinnPhongMaterial",
+		"name":"redmat",
+		"renderStates":[
+			{
+				"cull":2,
+				"blend":0,
+				"srcBlend":1,
+				"dstBlend":0,
+				"depthWrite":true,
+				"depthTest":515
+			}
+		],
+		"enableVertexColor":false,
+		"alphaTest":false,
+		"alphaTestValue":0.5,
+		"renderQueue":2000,
+		"albedoIntensity":1,
+		"enableLighting":true,
+		"shininess":0.078125,
+		"textures":[],
+		"vectors":[
+			{
+				"name":"tilingOffset",
+				"value":[
+					1,
+					1,
+					0,
+					0
+				]
+			},
+			{
+				"name":"specularColor",
+				"value":[
+					0.5,
+					0.5,
+					0.5
+				]
+			},
+			{
+				"name":"albedoColor",
+				"value":[
+					1,
+					0.1985294,
+					0.1985294,
+					1
+				]
+			}
+		],
+		"defines":[]
+	}
+}

+ 54 - 0
color3D_laya/bin/res/LayaScene_main/Conventional/Assets/Prefabs/M/whitemat.lmat

@@ -0,0 +1,54 @@
+{
+	"version":"LAYAMATERIAL:02",
+	"props":{
+		"type":"Laya.BlinnPhongMaterial",
+		"name":"whitemat",
+		"renderStates":[
+			{
+				"cull":2,
+				"blend":0,
+				"srcBlend":1,
+				"dstBlend":0,
+				"depthWrite":true,
+				"depthTest":515
+			}
+		],
+		"enableVertexColor":false,
+		"alphaTest":false,
+		"alphaTestValue":0.5,
+		"renderQueue":2000,
+		"albedoIntensity":1.52,
+		"enableLighting":true,
+		"shininess":0.04,
+		"textures":[],
+		"vectors":[
+			{
+				"name":"tilingOffset",
+				"value":[
+					1,
+					1,
+					0,
+					0
+				]
+			},
+			{
+				"name":"specularColor",
+				"value":[
+					1,
+					1,
+					1
+				]
+			},
+			{
+				"name":"albedoColor",
+				"value":[
+					1,
+					1,
+					1,
+					1
+				]
+			}
+		],
+		"defines":[]
+	}
+}

+ 54 - 0
color3D_laya/bin/res/LayaScene_main/Conventional/Assets/Prefabs/M/yellowmat.lmat

@@ -0,0 +1,54 @@
+{
+	"version":"LAYAMATERIAL:02",
+	"props":{
+		"type":"Laya.BlinnPhongMaterial",
+		"name":"yellowmat",
+		"renderStates":[
+			{
+				"cull":2,
+				"blend":0,
+				"srcBlend":1,
+				"dstBlend":0,
+				"depthWrite":true,
+				"depthTest":515
+			}
+		],
+		"enableVertexColor":false,
+		"alphaTest":false,
+		"alphaTestValue":0.5,
+		"renderQueue":2000,
+		"albedoIntensity":1,
+		"enableLighting":true,
+		"shininess":0.078125,
+		"textures":[],
+		"vectors":[
+			{
+				"name":"tilingOffset",
+				"value":[
+					1,
+					1,
+					0,
+					0
+				]
+			},
+			{
+				"name":"specularColor",
+				"value":[
+					0.5,
+					0.5,
+					0.5
+				]
+			},
+			{
+				"name":"albedoColor",
+				"value":[
+					0.737931,
+					1,
+					0,
+					1
+				]
+			}
+		],
+		"defines":[]
+	}
+}

BIN
color3D_laya/bin/res/LayaScene_main/Conventional/Library/unity default resources-Cylinder.lm


BIN
color3D_laya/bin/res/LayaScene_main/Conventional/Library/unity default resources-Sphere.lm


ファイルの差分が大きいため隠しています
+ 1409 - 336
color3D_laya/bin/res/LayaScene_main/Conventional/main.ls


+ 0 - 1
color3D_laya/bin/test/TestScene.json

@@ -1 +0,0 @@
-{"type":"Scene","props":{"width":640,"runtime":"script/GameUI.ts","positionVariance_0":100,"maxPartices":100,"height":1136},"compId":1,"loadList":[],"loadList3D":[]}

+ 1 - 0
color3D_laya/laya/pageStyles.xml

@@ -1,3 +1,4 @@
 <page>
    <item name="test/TestScene.scene" props="" ifExport="分离模式" aName=""/>
+   <item name="game_ui.scene" props="" ifExport="内嵌模式" aName=""/>
 </page>

+ 6 - 0
color3D_laya/laya/pages/game_ui.scene

@@ -0,0 +1,6 @@
+{
+    "type":"Scene",
+    "props":{"width":720,"sceneColor":"#000000","height":1280},
+    "child":[
+        ]
+}

+ 30 - 51
color3D_laya/src/AssetController.ts

@@ -1,9 +1,7 @@
-import OimoHelper from "./script/Oimo/OimoHelper";
-import ShellBehaviour from "./script/Behaviour/ShellBehaviour";
-import OimoBodyData from "./script/Oimo/OimoBodyData";
-import PlayerBehaviour from "./script/Behaviour/PlayerBehaviour";
-import BarrierBehaviour from "./script/Behaviour/BarrierBehaviour";
 
+import GameDefined from "./script/GameLogic/GameDefined";
+import { SceneController } from "./script/GameLogic/SceneController";
+import OimoHelper from "./script/Oimo/OimoHelper";
 
 export default class AssetController {
     private static instance: AssetController;
@@ -11,57 +9,38 @@ export default class AssetController {
         return this.instance || (this.instance = new AssetController());
     }
 
-    private path = "res/LayaScene_main/Conventional/main.ls";
-    private move: Laya.Sprite3D;
-    private cube1: Laya.Sprite3D;
-
-    private panel: Laya.Sprite3D;
     public GameStart() {
-        Laya.loader.create(this.path, new Laya.Handler(this, (res) => {
+        Laya.loader.create(GameDefined.main_path, new Laya.Handler(this, (res) => {
             var _scene = res as Laya.Scene3D;
-            Laya.stage.addChild(_scene);
-            this.move = _scene.getChildByName("Move") as Laya.Sprite3D;
-            this.cube1 = _scene.getChildByName("Cube1") as Laya.Sprite3D;
-            this.panel = _scene.getChildByName("Panel") as Laya.Sprite3D;
-
-
-
             OimoHelper.Inst.createWolrd();
+            SceneController.Instance.Init(_scene);
 
-            this.CreateBody();
-
-            this.MouseContr();
         }));
     }
 
-    private CreateBody() {
-
-        var panel = this.panel.addComponent(BarrierBehaviour) as BarrierBehaviour;
-        var data = new OimoBodyData();
-        data.move = false;
-        data.type = "box";
-        panel.init(data);
-
-        for (let index = 0; index < this.move._children.length; index++) {
-            const element = this.move._children[index];
-            var shell = element.addComponent(ShellBehaviour) as ShellBehaviour;
-            var data1 = new OimoBodyData();
-            data1.move = true;
-            data1.type = "box";
-            data1.friction=3;
-            shell.init(data1);
-        }
-
-
-
-        var player = this.cube1.addComponent(PlayerBehaviour) as PlayerBehaviour;
-        var data2 = new OimoBodyData();
-        data2.move = true;
-        data2.type = "box";
-        data2.kinematic = true;
-        data2.name = 1000;
-        player.init(data2);
-    }
+    // private CreateBody() {
+    //     var panel = this.panel.addComponent(StandBehaviour) as StandBehaviour;
+    //     var data = new OimoBodyData();
+    //     data.move = false;
+    //     data.type = "box";
+    //     panel.init(data);
+    //     for (let index = 0; index < this.move._children.length; index++) {
+    //         const element = this.move._children[index];
+    //         var shell = element.addComponent(ShellBehaviour) as ShellBehaviour;
+    //         var data1 = new OimoBodyData();
+    //         data1.move = true;
+    //         data1.type = "box";
+    //         data1.friction=3;
+    //         shell.init(data1);
+    //     }
+    //     var player = this.cube1.addComponent(PlayerBehaviour) as PlayerBehaviour;
+    //     var data2 = new OimoBodyData();
+    //     data2.move = true;
+    //     data2.type = "box";
+    //     data2.kinematic = true;
+    //     data2.name = 1000;
+    //     player.init(data2);
+    // }
 
     private MouseContr() {
         Laya.stage.on(Laya.Event.MOUSE_DOWN, this, this.OnClickDown);
@@ -93,8 +72,8 @@ export default class AssetController {
         if (offestZ > 0) offestZ = offestZ < 0.1 ? offestZ : 0.1;
         if (offestZ < 0) offestZ = offestZ > -0.1 ? offestZ : -0.1;
         console.log(offestX);
-        this.cube1.transform.localPositionX += offestX;
-        this.cube1.transform.localPositionZ += offestZ;
+        // this.cube1.transform.localPositionX += offestX;
+        // this.cube1.transform.localPositionZ += offestZ;
         this.curMousePos = new Laya.Vector3(Laya.MouseManager.instance.mouseX, Laya.MouseManager.instance.mouseY);;
     }
 }

+ 1 - 1
color3D_laya/src/GameConfig.ts

@@ -10,7 +10,7 @@ export default class GameConfig{
     static screenMode:string="none";
     static alignV:string="middle";
     static alignH:string="center";
-    static startScene:any="";
+    static startScene:any="game_ui.scene";
     static sceneRoot:string="";
     static debug:boolean=false;
     static stat:boolean=false;

+ 51 - 0
color3D_laya/src/script/Behaviour/PassivityBehaviour.ts

@@ -0,0 +1,51 @@
+
+import OimoRigidBody from "../Oimo/OimoRigibody";
+import OimoBodyData from "../Oimo/OimoBodyData";
+export default class PassivityBehaviour extends OimoRigidBody {
+
+    public constructor() {
+        super();
+    }
+
+    private disZ: number = 35;
+    private disY: number = -2;
+    private speed: number = 500;
+    private tempvev: Laya.Vector3 = new Laya.Vector3();
+    private velocity: Laya.Vector3;
+    private tragetZ: number = 0;
+    private force: Laya.Vector3 = new Laya.Vector3();
+    public init(data?: OimoBodyData) {
+        if (!data) data = new OimoBodyData();
+        data.density = 1;
+        data.move = true;
+        super.init(data);
+    }
+    // public setData(vec: Laya.Vector3) {
+    //     this.velocity = vec;
+    //     this.tragetZ = this.transform.position.z + this.disZ;
+    //     let pos = this.transform.position;
+    //     let forceVec3 = new OIMO.Vec3(vec.x, vec.y, vec.z * 300);
+    //     let posVec3 = new OIMO.Vec3(pos.x, pos.y, pos.z);
+    //     this.body.applyImpulse(posVec3, forceVec3);
+    // }
+
+    public onAwake() {
+
+    }
+
+    public onStart() {
+    }
+
+    public onUpdate() {
+        super.onUpdate();
+
+        super.checkContact(1111);
+    }
+
+    public onDisable() {
+
+        if (this.body && this.body.parent) this.body.dispose();
+        this.body = null;
+    }
+
+}

+ 8 - 4
color3D_laya/src/script/Behaviour/PlayerBehaviour.ts

@@ -1,6 +1,7 @@
 
 import OimoRigidBody from "../Oimo/OimoRigibody";
 import OimoBodyData from "../Oimo/OimoBodyData";
+import GameDefined from "../GameLogic/GameDefined";
 
 export default class PlayerBehaviour extends OimoRigidBody {
 
@@ -10,9 +11,12 @@ export default class PlayerBehaviour extends OimoRigidBody {
 
     private bodyVc3: OIMO.Vec3 = new OIMO.Vec3(0, 0, 0);
     private bodyQut: OIMO.Quat = new OIMO.Quat(0, 0, 0, 1);
-    public init(data: OimoBodyData) {
+    public init(data?: OimoBodyData) {
+        if(!data)data=new OimoBodyData();
+        data.move = true;
+        data.kinematic = true;
+        data.name=GameDefined.playerbodyname;
         super.init(data);
-        let size = data.size;
     }
 
     public onAwake(): void {
@@ -31,12 +35,12 @@ export default class PlayerBehaviour extends OimoRigidBody {
         this.body.setQuaternion(this.bodyQut);
     }
 
-    public checkContact(name){
+    public checkContact(name) {
         return false;
     }
 
     public onDisable(): void {
-        if (this.body&&this.body.parent) this.body.dispose();
+        if (this.body && this.body.parent) this.body.dispose();
         this.body = null;
     }
     public get name() {

+ 0 - 55
color3D_laya/src/script/Behaviour/ShellBehaviour.ts

@@ -1,55 +0,0 @@
-
-import OimoRigidBody from "../Oimo/OimoRigibody";
-import OimoBodyData from "../Oimo/OimoBodyData";
-export default class ShellBehaviour extends OimoRigidBody {
-
-    public constructor() {
-        super();
-    }
-
-    private disZ: number = 35;
-    private disY: number = -2;
-    private speed: number = 500;
-    private tempvev: Laya.Vector3 = new Laya.Vector3();
-    private velocity: Laya.Vector3;
-    private tragetZ: number = 0;
-    private force: Laya.Vector3 = new Laya.Vector3();
-    public init(data: OimoBodyData) {
-        super.init(data);
-    }
-    public setData(vec: Laya.Vector3) {
-        this.velocity = vec;
-        this.tragetZ = this.transform.position.z + this.disZ;
-        let pos = this.transform.position;
-        let forceVec3 = new OIMO.Vec3(vec.x, vec.y, vec.z*300);
-        let posVec3 = new OIMO.Vec3(pos.x, pos.y, pos.z);
-        this.body.applyImpulse(posVec3,forceVec3);
-    }
-
-    public onAwake() {
-
-    }
-
-    public onStart() {
-    }
-
-    public onUpdate() {
-        super.onUpdate();
-        // if (this.transform.position.z >= this.tragetZ || this.transform.position.y <= this.disY) {
-        //     this.sprite.active = false;
-        // }
-
-        // Laya.Vector3.scale(this.velocity, 1, this.velocity);
-        // let pos = this.sprite.transform.position;
-        // Laya.Vector3.add(pos, this.velocity, pos);
-        // this.sprite.transform.position = pos;
-        super.checkContact(1000);
-    }
-
-    public onDisable() {
-
-        if (this.body&&this.body.parent) this.body.dispose();
-        this.body = null;
-    }
-
-}

+ 7 - 3
color3D_laya/src/script/Behaviour/BarrierBehaviour.ts

@@ -1,15 +1,19 @@
 
 import OimoRigidBody from "../Oimo/OimoRigibody";
 import OimoBodyData from "../Oimo/OimoBodyData";
+import { DealPackaging } from "../GameLogic/DealPackaging";
 
-export default class BarrierBehaviour extends OimoRigidBody {
+export default class StandBehaviour extends OimoRigidBody {
 
     public constructor() {
         super();
     }
-
-    private disY: number = -2;
     public init(data: OimoBodyData) {
+        if(!data)data=new OimoBodyData();
+        //   this.sprite = this.owner as Laya.MeshSprite3D;
+        data.name=1000000000;
+        data.move = false;
+        //  data.type = DealPackaging.DealLayer(this.sprite.layer);
         super.init(data);
     }
 

+ 15 - 0
color3D_laya/src/script/GameLogic/DealPackaging.ts

@@ -0,0 +1,15 @@
+import { BodyType } from "./GameDefined";
+
+export class DealPackaging{
+    public static DealLayer(_layaer:number):string{
+        if(_layaer==BodyType.box){
+            return "box";
+        }else if(_layaer==BodyType.sphere){
+            return "sphere";
+        }else if(_layaer==BodyType.cylinder){
+            return "cylinder";
+        }else{
+            return "box";
+        }
+    }
+}

+ 15 - 0
color3D_laya/src/script/GameLogic/GameDefined.ts

@@ -0,0 +1,15 @@
+
+export default class GameDefined {
+
+    public static main_path = "res/LayaScene_main/Conventional/main.ls";
+
+
+
+    public static playerbodyname=1111;
+}
+
+export enum BodyType {
+    sphere = 8,
+    cylinder = 9,
+    box = 10
+}

+ 21 - 0
color3D_laya/src/script/GameLogic/ObsController.ts

@@ -0,0 +1,21 @@
+import Sprite3D = Laya.Sprite3D;
+import PassivityBehaviour from "../Behaviour/PassivityBehaviour";
+export class ObsController {
+    private static instance: ObsController;
+    public static get Instance(): ObsController {
+        return ObsController.instance || (ObsController.instance = new ObsController());
+    }
+
+    public Init(obs: any[]) {
+        if (obs && obs.length > 0) {
+            for (let index = 0; index < obs.length; index++) {
+                for (let j = 0; j < obs[index]._children.length; j++) {
+                    const element = obs[index].getChildAt(j) as Sprite3D;
+                    var _o = element.getChildAt(0);
+                 var _pb=   _o.addComponent(PassivityBehaviour);
+                 _pb.init();
+                }
+            }
+        }
+    }
+}

+ 19 - 0
color3D_laya/src/script/GameLogic/PlayerController.ts

@@ -0,0 +1,19 @@
+
+import Sprite3D=Laya.Sprite3D;
+import PlayerBehaviour from "../Behaviour/PlayerBehaviour";
+export class PlayerController {
+    private static instance: PlayerController;
+    public static get Instance(): PlayerController {
+        return PlayerController.instance || (PlayerController.instance = new PlayerController());
+    }
+
+    public player:Sprite3D;
+    public Init(_p:Sprite3D){
+        if(_p){
+            this.player=_p;
+           var _pb=this.player.getComponent(PlayerBehaviour);
+           if(!_pb)_pb=this.player.addComponent(PlayerBehaviour);
+           _pb.init();
+        }
+    }
+}

+ 87 - 0
color3D_laya/src/script/GameLogic/PoolManager.ts

@@ -0,0 +1,87 @@
+
+import Vector3 = Laya.Vector3;
+import Dictionary from "../Util/Dictionary";
+export class PoolManager {
+    private static instance: PoolManager;
+    public static get Instance(): PoolManager {
+        return PoolManager.instance || (PoolManager.instance = new PoolManager());
+    }
+
+    constructor() {
+        this.poolDic = new Dictionary();
+        this.prefabDic = new Dictionary();
+    }
+
+    //存储多个
+    private poolDic: Dictionary;
+
+    //预设对象
+    private prefabDic: Dictionary;
+
+    // [ "Coin"  "Key"  "Role"  "Body1"   "Train" ]
+    public InitData(name: string, prefab) {
+        if (prefab != null) {
+            if (!this.prefabDic.has(name))
+                this.prefabDic.set(name, prefab);
+        }
+    }
+    public SetActiveObject(name: string, scale?) {
+        if (this.poolDic.has(name)) {
+            if (this.poolDic.get(name).length > 0) {
+                var result = this.poolDic.get(name).shift();
+                result.active = true;
+                return result;
+            } else {
+                if (this.prefabDic.has(name)) {
+                    var curObj = Laya.Sprite3D.instantiate(this.prefabDic.get(name)) as Laya.Sprite3D;
+                    if (scale != null) {
+                        curObj.transform.localScale = new Vector3(scale, scale, scale);
+                    }
+                    curObj.name = name;
+                    return curObj;
+                } else {
+                    return null;
+                }
+            }
+        } else {
+            if (this.prefabDic.has(name)) {
+                var curObj = Laya.Sprite3D.instantiate(this.prefabDic.get(name)) as Laya.Sprite3D;
+                if (scale != null) {
+                    curObj.transform.localScale = new Vector3(scale, scale, scale);
+                }
+                curObj.name = name;
+                return curObj;
+            } else {
+                return null;
+            }
+        }
+    }
+
+    //隐藏对象到dic
+    public SetDisableObject(go: Laya.Sprite3D) {
+        if (go) go.active = false;
+        var key = go.name;
+        if (!this.poolDic.has(key)) {
+            this.poolDic.set(key, new Array<any>());
+        }
+        this.poolDic.get(key).push(go);
+    }
+
+    public DestoryObj(go: Laya.Sprite3D) {
+        if (go) go.destroy(true);
+    }
+
+    //延时隐藏对象到dic
+    public SetDisableMutiObject(go: Laya.Sprite3D, timer) {
+        Laya.timer.once(timer, this, () => {
+            if (go) go.active = false;
+            var key = go.name;
+            if (!this.poolDic.has(key)) {
+                this.poolDic.set(key, new Array<any>());
+            }
+            this.poolDic.get(key).push(go);
+        });
+    }
+
+
+}

+ 41 - 0
color3D_laya/src/script/GameLogic/SceneController.ts

@@ -0,0 +1,41 @@
+import Sprite3D = Laya.Sprite3D;
+import Scene3D = Laya.Scene3D;
+import { PlayerController } from "./PlayerController";
+import { ObsController } from "./ObsController";
+import StandBehaviour from "../Behaviour/StandBehaviour";
+export class SceneController {
+    private static instance: SceneController;
+    public static get Instance(): SceneController {
+        return SceneController.instance || (SceneController.instance = new SceneController());
+    }
+
+
+    private floor: Sprite3D;
+    private _camera: Laya.Camera;
+    public Init(_s: Scene3D) {
+        if (_s) {
+            Laya.stage.addChild(_s);
+        }
+        else {
+            console.error("场景不存在");
+            return;
+        }
+        var road = _s.getChildByName("road");
+        var obs = road.getChildByName("road")._children;
+        this.floor = road.getChildByName("floor").getChildAt(0) as Sprite3D;
+        var player = _s.getChildByName("player") as Sprite3D;
+        this._camera = _s.getChildByName("Main Camera") as Laya.Camera;
+
+        PlayerController.Instance.Init(player);
+        ObsController.Instance.Init(obs);
+        this.InitScene();
+    }
+
+    public InitScene() {
+        if (this.floor) {
+            var floor = this.floor.getComponent(StandBehaviour);
+            if(!floor)floor = this.floor.addComponent(StandBehaviour);
+            floor.init();
+        }
+    }
+}

+ 81 - 0
color3D_laya/src/script/GameLogic/ViewManager.ts

@@ -0,0 +1,81 @@
+import Dictionary from "../Util/Dictionary";
+
+export enum ViewType {
+  
+}
+export default class ViewManager {
+    private static instance: ViewManager;
+    public static get Instance(): ViewManager {
+        return this.instance || (this.instance = new ViewManager());
+    }
+    constructor() {
+        this.init();
+    }
+    private viewDic = [];
+    private curView: any;
+    private addViewDic = new Dictionary();
+    init() {
+     
+    }
+    public OpenView(view: ViewType, data?: any) {
+        if (this.curView != null) {
+            this.curView.OnClose();
+            Laya.stage.removeChild(this.curView);
+            //    var  a:Laya.Scene;
+            //    a.destroy()
+            this.curView.destroy(true);
+            this.curView = null;
+        }
+        this.curView = new this.viewDic[view];
+
+        Laya.stage.addChild(this.curView);
+        // this.curView.resizeHander();
+        this.curView.OnShow(data);
+
+    }
+
+    public get getCurView(): any {
+        return this.curView;
+    }
+    public AddView(view: ViewType, data?: any) {
+        if (this.addViewDic.has(view)) return;
+        let t_view = new this.viewDic[view];
+        this.addViewDic.set(view, t_view);
+        Laya.stage.addChild(t_view);
+        t_view.OnShow(data);
+    }
+    public RemoveView() {
+        if (this.curView != null) {
+            this.curView.OnClose();
+            Laya.stage.removeChild(this.curView);
+            this.curView.destroy(true);
+            this.curView = null;
+        }
+    }
+    public CloseView(view: ViewType) {
+        if (!this.addViewDic.has(view)) return;
+        let t_view = this.addViewDic.get(view);
+        t_view.OnClose();
+        Laya.stage.removeChild(t_view);
+        t_view.destroy(true);
+        this.addViewDic.delete(view);
+    }
+    private curMask: any;
+    public OpenMask() {
+        if (this.curMask != null) {
+            return;
+        }
+      //  this.curMask = new Mask_ui();
+        if (!this.curMask) return;
+        Laya.stage.addChild(this.curMask);
+    }
+    public CloseMask() {
+        if (this.curMask != null) {
+            this.curMask.OnClose();
+            Laya.stage.removeChild(this.curMask);
+            this.curMask.destroy(true);
+            this.curMask = null;
+        }
+    }
+
+}

+ 1 - 1
color3D_laya/src/script/Oimo/OimoBodyData.ts

@@ -6,7 +6,7 @@ export default class OimoBodyData {
     public rot;
     public rotShape;
     public size;
-    public density: number;
+    public density: number;//密度
     public friction: number;
     public restitution: number;
     public belongsTo: number;

+ 1 - 1
color3D_laya/src/script/Oimo/OimoHelper.ts

@@ -20,7 +20,7 @@ export default class OimoHelper {
             worldscale: 1, // scale full world 
             random: true,  // randomize sample
             info: false,   // calculate statistic or not
-            gravity: [0, -9.8, 0]
+            gravity: [0, -100, 0]
         });
         this.world.play();
     }

+ 27 - 16
color3D_laya/src/script/Oimo/OimoRigibody.ts

@@ -1,5 +1,6 @@
 import OimoBodyData from "./OimoBodyData";
 import OimoHelper from "./OimoHelper";
+import { DealPackaging } from "../GameLogic/DealPackaging";
 
 export default class OimoRigidBody extends Laya.Script3D {
 
@@ -15,6 +16,8 @@ export default class OimoRigidBody extends Laya.Script3D {
         this.bodyData = data;
         this.sprite = this.owner as Laya.MeshSprite3D;
         this.transform = this.sprite.transform;
+
+        data.type = DealPackaging.DealLayer(this.sprite.layer);
         this.initBodyData(data);
         if (this.body && this.body.parent) this.body.dispose();
         this.body = OimoHelper.Inst.createBody(data);
@@ -47,12 +50,10 @@ export default class OimoRigidBody extends Laya.Script3D {
     public checkContact(name) {
         if (this.body && this.body.contactLink) {
             let otherBody = this.body.contactLink.body;
-            //bool = this.body.checkContact(name);
+
             if (otherBody.name == name) return true;
         }
-        // if(this.body){
-        //     bool = this.body.checkContact(name);
-        // }
+
         return false;
     }
 
@@ -61,10 +62,10 @@ export default class OimoRigidBody extends Laya.Script3D {
         data.pos = this.getPos();
         data.rot = this.getRot();
         data.size = data.size === undefined ? this.getSize() : data.size;
-        if (data.type == "cube" || data.type == "barrier") data.type = "box";
-        else if (data.type == "capsule") data.type = "cylinder";
-        else if (data.type == "shell") data.type = "sphere";
-        else data.type = "box";
+        // if (data.type == "cube" || data.type == "barrier") data.type = "box";
+        // else if (data.type == "capsule") data.type = "cylinder";
+        // else if (data.type == "shell") data.type = "sphere";
+        // else data.type = "box";
     }
 
     public getPos() {
@@ -74,21 +75,31 @@ export default class OimoRigidBody extends Laya.Script3D {
     }
 
     public getSize() {
-        let w, h, d, size
+        var w, h, d, size;
+        var _scale = this.transform.scale;
         if (this.bodyData.type == "capsule" || this.bodyData.type == "cylinder") {
-            w = this.transform.localScale.x;
-            h = this.transform.localScale.y * 2;
-            d = this.transform.localScale.z;
+           var _scale = this.transform.scale;
+            // w = this.transform.localScale.x;
+            // h = this.transform.localScale.y * 2;
+            // d = this.transform.localScale.z;
+            w = _scale.x;
+            h = _scale.y * 2;
+            d = _scale.z;
             size = [w, h, d];
         } else if (this.bodyData.type == "sphere") {
-            w = this.transform.localScale.x;
+           // w = this.transform.localScale.x;
+              w = _scale.x;
             size = [w];
         } else if (this.bodyData.type == "barrier" || this.bodyData.type == "cube" || this.bodyData.type == "box") {
-            w = this.transform.localScale.x;
-            h = this.transform.localScale.y;
-            d = this.transform.localScale.z;
+            // w = this.transform.localScale.x;
+            // h = this.transform.localScale.y;//* 2;
+            // d = this.transform.localScale.z;
+            w = _scale.x;
+            h = _scale.y;
+            d = _scale.z;
             size = [w, h, d];
         }
+        console.log(size);
         return size;
     }
 

+ 58 - 0
color3D_laya/src/script/Util/Dictionary.ts

@@ -0,0 +1,58 @@
+
+export default class Dictionary {
+    private _length: number;
+
+    private _container: any;
+
+    constructor() {
+        this._container = {};
+        this._length = 0;
+    }
+
+    public get container(): any {
+        return this._container;
+    }
+
+    //获取字典长度    
+    public get size(): number {
+        return this._length;
+    }
+
+    //添加
+    public set(key: any, value: any): void {
+        if (!this._container.hasOwnProperty(key))  {
+            this._length++;
+        }
+        this._container[key] = value;
+    }
+
+    //删除     
+    public delete(key: any): void {
+        if (this._container.hasOwnProperty(key))  {
+            delete this._container[key];
+            this._length--;
+        }
+    }
+
+    //查找   
+    public has(key: any): boolean {
+        return this._container.hasOwnProperty(key) ? true : false;
+    }
+
+    //获取 
+    public get(key: any): any {
+        if (this._container.hasOwnProperty(key))  {
+            return this._container[key];
+        } else  {
+            return undefined
+        }
+    }
+
+    //清空    
+    public clear() {
+        this._container = {};
+        this._length = 0;
+    }
+
+
+}

+ 175 - 0
color3D_laya/src/script/Util/Game_Tool.ts

@@ -0,0 +1,175 @@
+
+
+
+export default class Game_Tool {
+
+    public static GetObjKey(obj: any) {
+        if (obj == null) return null;
+        for (const key in obj) {
+            if (obj.hasOwnProperty(key)) {
+                return key;
+            }
+        }
+    }
+    //返回一个随机整数[min,max]
+    public static randomInt(min: any, max: any): number {
+        return parseInt(Math.random() * (max - min + 1) + min);
+    }
+    //p1 左向量 p2
+    public static getAng(xx: number, yy: number, obl: number): number {
+        return 180 / Math.PI * this.getRad(xx, yy, obl);
+    }
+    //返回角度
+    public static getRad(xx: number, yy: number, obl: number): number {
+        // 方法一:asin()
+        // var rad:Number = xx > 0 ? ((Math.PI * 3)/2  + Math.asin(-yy/obl)) : (Math.PI / 2 -  Math.asin(-yy/obl));
+        // 方法二:acos()
+        var rad: number = yy < 0 ? Math.acos(xx / obl) : (Math.PI * 2 - Math.acos(xx / obl));
+        // 方法三:atan2()
+        // var rad:Number = yy < 0 ? Math.atan2(-yy, xx) : Math.PI * 2 + Math.atan2(-yy, xx);
+        return rad;
+    }
+
+    public static getM_Vector(v1: Laya.Vector3, v2: Laya.Vector3): Laya.Vector3 {
+        let temp = new Laya.Vector3();
+        Laya.Vector3.add(v1, v2, temp);
+        return new Laya.Vector3(temp.x * 0.5, temp.y * 0.5, temp.z * 0.5);
+    }
+
+
+
+    public static random_1to1():number{ 
+        var iszheng=Math.random()>0.5?-1:1;
+        return Math.random()*iszheng;
+    }
+
+    public static get64Encode(str): string {
+        var c1, c2, c3;
+        var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+        var i = 0, len = str.length, string = '';
+        while (i < len) {
+            c1 = str.charCodeAt(i++) & 0xff;
+            if (i == len) {
+                string += base64EncodeChars.charAt(c1 >> 2);
+                string += base64EncodeChars.charAt((c1 & 0x3) << 4);
+                string += "==";
+                break;
+            }
+            c2 = str.charCodeAt(i++);
+            if (i == len) {
+                string += base64EncodeChars.charAt(c1 >> 2);
+                string += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
+                string += base64EncodeChars.charAt((c2 & 0xF) << 2);
+                string += "=";
+                break;
+            }
+            c3 = str.charCodeAt(i++);
+            string += base64EncodeChars.charAt(c1 >> 2);
+            string += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
+            string += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
+            string += base64EncodeChars.charAt(c3 & 0x3F)
+        }
+        return string;
+    }
+
+    // public static SetHuTuiList(list:Laya.List,data?,scrol:number=1,type:number=0){ //scrol 1:竖的  2横的
+    //     var arr=data?data:FYHD_Sdk.pushData;
+    //     list.selectEnable = false;
+    //     scrol==1?list.vScrollBarSkin = "":list.hScrollBarSkin = "";
+    //     list.renderHandler = Laya.Handler.create(this, this.updateItem, [type], false);
+    //     list.array = arr;
+    //     list.refresh();
+    //  }
+    //  private static updateItem(type,cell: Laya.Box, index: number){
+    //      var aditem=cell.getComponent(HuiTuiItem)as HuiTuiItem;
+    //      aditem.Refresh(type);
+    //  }
+     public static makeRandomArr(arrList,num){
+        if(num>arrList.length){
+           return;
+        }
+        var tempArr=arrList.slice(0);
+        var newArrList=[];    
+        for(var i=0;i<num;i++){
+            var random=Math.floor(Math.random()*(tempArr.length-1));
+            var arr=tempArr[random];
+            tempArr.splice(random, 1);
+            newArrList.push(arr);    
+        }
+        return newArrList;
+    }
+    public static CopyArr(o):any{
+        var arr=[];
+        for (let index = 0; index < o.length; index++) {
+            const element = o[index];
+            arr.push(element);
+        }
+        return arr;
+    }
+
+
+    // public static ShowQianDao(): boolean {
+    //     let todayZero = new Date(UserModel.Instance.CurModel.ServerTime * 1000);
+    //     todayZero.setHours(0, 0, 0, 0);
+    //     if(!PlayerManager.Instance.sign)return true;
+    //     var lastTime = Number(PlayerManager.Instance.sign["sign_time"]) * 1000;
+    //     let lastSignTime = new Date(lastTime);
+    //     if (lastTime == 0) {
+    //         return true;
+    //     }
+    //     if (lastSignTime.valueOf() < todayZero.valueOf()) {
+    //         return true;
+    //     }
+    //     return false;
+    // }
+
+    public static TweenGoldAward(_num:number,_pos:Laya.Vector2 = null,_completeHandle:Laya.Handler = null)
+    {
+        if(_num == 0)return;
+        var parent = new Laya.Box;
+        parent.width = 400;
+        parent.height = 100;
+        parent.pivotX = parent.width/2;
+        parent.pivotY = parent.height/2;
+        if(_pos == null)
+        {
+            _pos = new Laya.Vector2(Laya.stage.width/2,Laya.stage.height/2);
+        }
+        parent.pos(_pos.x,_pos.y);
+
+        var _Image = new Laya.Image;
+        _Image.skin = "main_res/sign_icon.png";
+        _Image.width = 60;
+        _Image.height = 60;
+        _Image.left = 50;
+        _Image.y = 10;
+        parent.addChild(_Image);
+
+        var curText = new Laya.Text;
+        curText.width = 300;
+        curText.height = 50;
+        
+        curText.align = "center";
+        curText.valign = "middle";
+        curText.font = "Microsoft YaHei";
+        curText.fontSize = 35;
+        curText.color = "#ff8e00";
+        curText.bold = true;
+        curText.font = "Microsoft YaHei";
+        curText.text = "金币 +" + _num;
+        curText.x = 60;
+        curText.y = 10;
+        parent.addChild(curText);
+        parent.zOrder=2;
+        Laya.stage.addChild(parent);
+        var tween = Laya.Tween.to(parent,{y:parent.y - 200},1000,Laya.Ease.expoInOut,Laya.Handler.create(this,()=>
+        {
+            tween.clear();
+            parent.destroy();
+            if(_completeHandle)
+            {
+                _completeHandle.run();
+            }
+        }),100);
+    }
+}

+ 5 - 4
color3D_laya/src/ui/layaMaxUI.ts

@@ -3,13 +3,14 @@ import View=Laya.View;
 import Dialog=Laya.Dialog;
 import Scene=Laya.Scene;
 var REG: Function = Laya.ClassUtils.regClass;
-export module ui.test {
-    export class TestSceneUI extends Scene {
+export module ui {
+    export class game_uiUI extends Scene {
+        public static  uiView:any ={"type":"Scene","props":{"width":720,"height":1280},"loadList":[],"loadList3D":[]};
         constructor(){ super()}
         createChildren():void {
             super.createChildren();
-            this.loadScene("test/TestScene");
+            this.createView(game_uiUI.uiView);
         }
     }
-    REG("ui.test.TestSceneUI",TestSceneUI);
+    REG("ui.game_uiUI",game_uiUI);
 }

BIN
color3D_unity/color3D/.vs/color3D/v16/.suo


+ 0 - 0
color3D_unity/color3D/.vs/color3D/v16/Server/sqlite3/db.lock


BIN
color3D_unity/color3D/.vs/color3D/v16/Server/sqlite3/storage.ide


ファイルの差分が大きいため隠しています
+ 148 - 0
color3D_unity/color3D/Assembly-CSharp-Editor.csproj


+ 4 - 4
color3D_unity/color3D/Assembly-CSharp.csproj

@@ -105,11 +105,11 @@
  <Reference Include="UnityEngine.VR">
  <HintPath>D:/Unity5.6.5/Unity/Editor/Data/UnityExtensions/Unity/UnityVR/RuntimeEditor/UnityEngine.VR.dll</HintPath>
  </Reference>
- <Reference Include="zxing.unity">
- <HintPath>E:/Work/Color3D/color3D_unity/color3D/Assets/LayaAir3D/LayaTool/Util/zxing.unity.dll</HintPath>
- </Reference>
  <Reference Include="LayaAirLibrary">
- <HintPath>E:/Work/Color3D/color3D_unity/color3D/Assets/LayaAir3D/LayaTool/LayaAirLibrary.dll</HintPath>
+ <HintPath>E:/Work/ColorBump3D/color3D/color3D_unity/color3D/Assets/LayaAir3D/LayaTool/LayaAirLibrary.dll</HintPath>
+ </Reference>
+ <Reference Include="zxing.unity">
+ <HintPath>E:/Work/ColorBump3D/color3D/color3D_unity/color3D/Assets/LayaAir3D/LayaTool/Util/zxing.unity.dll</HintPath>
  </Reference>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

+ 9 - 0
color3D_unity/color3D/Assets/Editor.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: b6fda9f08a3b46f47a94992aab1222a5
+folderAsset: yes
+timeCreated: 1564715401
+licenseType: Pro
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 108 - 0
color3D_unity/color3D/Assets/Editor/Editor_Tool.cs

@@ -0,0 +1,108 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEditor;
+using UnityEngine;
+
+public class Editor_Tool : EditorWindow
+{
+    //增加菜单栏选项
+    [MenuItem("modification/修改白色材质")]
+    public static void ChangeCorss()
+    {
+
+        //获取编辑器中当前选中的物体
+        Transform[] objs = Selection.transforms;
+        //如果没有选择任何物体,弹出提示并退出
+        Debug.Log(objs.Length);
+        if (objs.Length == 0)
+        {
+            Debug.Log("没有选中物体");
+            return;
+        }
+        var path = "Assets/Prefabs/M/whitemat.mat";
+        ForeachObjCorss(objs, path);
+    }
+    [MenuItem("modification/修改紫色材质")]
+    public static void Changeperple()
+    {
+
+        //获取编辑器中当前选中的物体
+        Transform[] objs = Selection.transforms;
+        //如果没有选择任何物体,弹出提示并退出
+        Debug.Log(objs.Length);
+        if (objs.Length == 0)
+        {
+            Debug.Log("没有选中物体");
+            return;
+        }
+        var path = "Assets/Prefabs/M/perple.mat";
+        ForeachObjCorss(objs, path);
+    }
+
+    [MenuItem("modification/修改红色材质")]
+    public static void ChangeRed()
+    {
+
+        //获取编辑器中当前选中的物体
+        Transform[] objs = Selection.transforms;
+        //如果没有选择任何物体,弹出提示并退出
+        Debug.Log(objs.Length);
+        if (objs.Length == 0)
+        {
+            Debug.Log("没有选中物体");
+            return;
+        }
+        var path = "Assets/Prefabs/M/redmat.mat";
+        ForeachObjCorss(objs, path);
+    }
+    [MenuItem("modification/修改黑色材质")]
+    public static void ChangeBlack()
+    {
+
+        //获取编辑器中当前选中的物体
+        Transform[] objs = Selection.transforms;
+        //如果没有选择任何物体,弹出提示并退出
+        Debug.Log(objs.Length);
+        if (objs.Length == 0)
+        {
+            Debug.Log("没有选中物体");
+            return;
+        }
+        var path = "Assets/Prefabs/M/blackmat.mat";
+        ForeachObjCorss(objs, path);
+    }
+
+    [MenuItem("modification/修改黄色材质")]
+    public static void Changehuangse()
+    {
+
+        //获取编辑器中当前选中的物体
+        Transform[] objs = Selection.transforms;
+        //如果没有选择任何物体,弹出提示并退出
+        Debug.Log(objs.Length);
+        if (objs.Length == 0)
+        {
+            Debug.Log("没有选中物体");
+            return;
+        }
+        var path = "Assets/Prefabs/M/yellowmat.mat";
+        ForeachObjCorss(objs, path);
+    }
+    static void ForeachObjCorss(Transform[] obj, string path)
+    {
+        for (int i = 0; i < obj.Length; i++)
+        {
+            foreach (Renderer it in obj[i].GetComponentsInChildren<Renderer>())
+            {
+                Material mat = AssetDatabase.LoadAssetAtPath<Material>(path);
+                Material[] bufMat = new Material[it.sharedMaterials.Length];
+                for (int j = 0; j < it.sharedMaterials.Length; j++)
+                {
+                    bufMat[j] = mat;
+                }
+                it.sharedMaterials = bufMat;
+            }
+        }
+      
+    }
+}

+ 12 - 0
color3D_unity/color3D/Assets/Editor/Editor_Tool.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: eefb2c1622d32284889b5f5c7c55f7f7
+timeCreated: 1564715439
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 3 - 4
color3D_unity/color3D/Assets/LayaAir3D/LayaTool/Configuration.xml

@@ -2,7 +2,7 @@
 <LayaExportSetting>
   <config>1</config>
   <config1>
-    <FirstlevelMenu>1</FirstlevelMenu>
+    <FirstlevelMenu>0</FirstlevelMenu>
     <MeshSetting>False</MeshSetting>
     <IgnoreVerticesUV>False</IgnoreVerticesUV>
     <IgnoreVerticesNormal>False</IgnoreVerticesNormal>
@@ -28,8 +28,7 @@
     <Ios>False</Ios>
     <Android>False</Android>
     <Conventional>True</Conventional>
-    <SavePath>
-    </SavePath>
+    <SavePath>E:/Work/ColorBump3D/color3D/color3D_laya/bin/res</SavePath>
     <ScrollPositionY>0</ScrollPositionY>
   </config1>
   <config2>
@@ -157,5 +156,5 @@
     <ScrollPositionY>0</ScrollPositionY>
   </config5>
   <language>1</language>
-  <time>1557720184</time>
+  <time>1564713259</time>
 </LayaExportSetting>

BIN
color3D_unity/color3D/Assets/Prefabs/M/FloorMaterial.mat


+ 9 - 0
color3D_unity/color3D/Assets/Prefabs/M/blackmat.mat.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: c2db046f486e4494487ebac820fc3328
+timeCreated: 1564716384
+licenseType: Pro
+NativeFormatImporter:
+  mainObjectFileID: 2100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
color3D_unity/color3D/Assets/Prefabs/M/Object1.mat


color3D_unity/color3D/Assets/Prefabs/M/Object1.mat.meta → color3D_unity/color3D/Assets/Prefabs/M/perple.mat.meta


BIN
color3D_unity/color3D/Assets/Prefabs/M/PlayerMaterial.mat


color3D_unity/color3D/Assets/Prefabs/M/FloorMaterial.mat.meta → color3D_unity/color3D/Assets/Prefabs/M/redmat.mat.meta


BIN
color3D_unity/color3D/Assets/Prefabs/M/whitemat.mat


color3D_unity/color3D/Assets/Prefabs/M/PlayerMaterial.mat.meta → color3D_unity/color3D/Assets/Prefabs/M/whitemat.mat.meta


BIN
color3D_unity/color3D/Assets/Prefabs/M/yellowmat.mat


+ 9 - 0
color3D_unity/color3D/Assets/Prefabs/M/yellowmat.mat.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 0b69bad4670b73f4c838283063eb9173
+timeCreated: 1564713956
+licenseType: Pro
+NativeFormatImporter:
+  mainObjectFileID: 2100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
color3D_unity/color3D/Assets/Prefabs/FracturedBall.prefab


color3D_unity/color3D/Assets/Prefabs/FracturedBall.prefab.meta → color3D_unity/color3D/Assets/Prefabs/broken.prefab.meta


BIN
color3D_unity/color3D/Assets/Prefabs/floor.prefab


+ 2 - 2
color3D_unity/color3D/Assets/Prefabs/obs_a.prefab.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: 5cd6cc2a875c6ff41a87094b17dc5647
-timeCreated: 1564663888
+guid: e8df3a87f5a8c794da0aad8377d97383
+timeCreated: 1564714039
 licenseType: Pro
 NativeFormatImporter:
   mainObjectFileID: 100100000

BIN
color3D_unity/color3D/Assets/Prefabs/obs_d.prefab


+ 2 - 2
color3D_unity/color3D/Assets/Prefabs/obs_b.prefab.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: 67b2ad2582d4fd94f9eceb95cbdc21e1
-timeCreated: 1564663895
+guid: 697aa69ee6689234494eb68425f01c92
+timeCreated: 1564714435
 licenseType: Pro
 NativeFormatImporter:
   mainObjectFileID: 100100000

BIN
color3D_unity/color3D/Assets/Prefabs/obs_g.prefab


+ 2 - 2
color3D_unity/color3D/Assets/Prefabs/obs_c.prefab.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: 8b1a36b4a3dc6d34a92ea16b8ce75e6e
-timeCreated: 1564663905
+guid: 88b4e5a3cc510264fbb08bbf290af154
+timeCreated: 1564714525
 licenseType: Pro
 NativeFormatImporter:
   mainObjectFileID: 100100000

BIN
color3D_unity/color3D/Assets/Prefabs/obs_c.prefab


+ 9 - 0
color3D_unity/color3D/Assets/Prefabs/obs3.prefab.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: ba3a73fabc0147143a4b73237b5ec83c
+timeCreated: 1564714560
+licenseType: Pro
+NativeFormatImporter:
+  mainObjectFileID: 100100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
color3D_unity/color3D/Assets/Prefabs/obs4.prefab


+ 9 - 0
color3D_unity/color3D/Assets/Prefabs/obs4.prefab.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: d0be3190897ca3644ae8c1ac37a6ed32
+timeCreated: 1564714598
+licenseType: Pro
+NativeFormatImporter:
+  mainObjectFileID: 100100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
color3D_unity/color3D/Assets/Prefabs/obs5.prefab


+ 9 - 0
color3D_unity/color3D/Assets/Prefabs/obs5.prefab.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 2b41929df6b82e94e80051911d01d2ef
+timeCreated: 1564714660
+licenseType: Pro
+NativeFormatImporter:
+  mainObjectFileID: 100100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
color3D_unity/color3D/Assets/Prefabs/obs_k.prefab


+ 9 - 0
color3D_unity/color3D/Assets/Prefabs/obs6.prefab.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 96aa4ca2818544f429bcfeca63abdec2
+timeCreated: 1564714723
+licenseType: Pro
+NativeFormatImporter:
+  mainObjectFileID: 100100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
color3D_unity/color3D/Assets/Prefabs/obs_a.prefab


+ 9 - 0
color3D_unity/color3D/Assets/Prefabs/obs7.prefab.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: ed4975c1e801ad44e96490a97674a180
+timeCreated: 1564737887
+licenseType: Pro
+NativeFormatImporter:
+  mainObjectFileID: 100100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
color3D_unity/color3D/Assets/Prefabs/obs_b.prefab


+ 9 - 0
color3D_unity/color3D/Assets/Prefabs/obs8.prefab.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 7b9a3478690ccc249ad0d8ae1e252653
+timeCreated: 1564737958
+licenseType: Pro
+NativeFormatImporter:
+  mainObjectFileID: 100100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 9
color3D_unity/color3D/Assets/Prefabs/obs_d.prefab.meta

@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: e0c2240d61edec748a7332f1d4d9633c
-timeCreated: 1564663923
-licenseType: Pro
-NativeFormatImporter:
-  mainObjectFileID: 100100000
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 9
color3D_unity/color3D/Assets/Prefabs/obs_g.prefab.meta

@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: 936c92127adb3f949b9dee46d5bc93e9
-timeCreated: 1564663944
-licenseType: Pro
-NativeFormatImporter:
-  mainObjectFileID: 100100000
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

BIN
color3D_unity/color3D/Assets/Prefabs/obs_h.prefab


+ 0 - 9
color3D_unity/color3D/Assets/Prefabs/obs_h.prefab.meta

@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: f979531e7baff0e4d9b6d1daaac7b876
-timeCreated: 1564663961
-licenseType: Pro
-NativeFormatImporter:
-  mainObjectFileID: 100100000
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 9
color3D_unity/color3D/Assets/Prefabs/obs_k.prefab.meta

@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: c68e11a02e087554f9630d1d7a70b372
-timeCreated: 1564663973
-licenseType: Pro
-NativeFormatImporter:
-  mainObjectFileID: 100100000
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

BIN
color3D_unity/color3D/Assets/Prefabs/obs_s.prefab


+ 0 - 9
color3D_unity/color3D/Assets/Prefabs/obs_s.prefab.meta

@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: a0ebc42d64ea67345aceca008fdd72f8
-timeCreated: 1564663986
-licenseType: Pro
-NativeFormatImporter:
-  mainObjectFileID: 100100000
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

BIN
color3D_unity/color3D/Assets/Prefabs/obs_x.prefab


+ 0 - 9
color3D_unity/color3D/Assets/Prefabs/obs_x.prefab.meta

@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: 5abdd4bb3e190af4a956d8349e7ffbdc
-timeCreated: 1564663999
-licenseType: Pro
-NativeFormatImporter:
-  mainObjectFileID: 100100000
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

BIN
color3D_unity/color3D/Assets/Prefabs/player.prefab


+ 1 - 1
color3D_unity/color3D/Assets/Prefabs/player.prefab.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
 guid: 782c777a5ac90fb4f9b1bc0b76956971
-timeCreated: 1564664104
+timeCreated: 1564713890
 licenseType: Pro
 NativeFormatImporter:
   mainObjectFileID: 100100000

+ 9 - 0
color3D_unity/color3D/Assets/Prefabs/propgroup.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 71e61925f24a85a41957001072e3b47b
+folderAsset: yes
+timeCreated: 1564713651
+licenseType: Pro
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 9 - 0
color3D_unity/color3D/Assets/Scenes.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 125f14df43b2ebc4087aa45af1e1f482
+folderAsset: yes
+timeCreated: 1564713146
+licenseType: Pro
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
color3D_unity/color3D/Assets/Scenes/main.unity


color3D_unity/color3D/Assets/main.unity.meta → color3D_unity/color3D/Assets/Scenes/main.unity.meta


BIN
color3D_unity/color3D/Assets/main.unity


+ 8 - 0
color3D_unity/color3D/Assets/Scenes/props.unity.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: b0228db288f53de40860940278d3d3bf
+timeCreated: 1564713192
+licenseType: Pro
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 2
color3D_unity/color3D/Assets/StreamingAssets/LayaDemo/LayaAir3DSample.js

@@ -5,6 +5,5 @@ Laya3D.init(0, 0);
 Laya.stage.scaleMode = Laya.Stage.SCALE_FULL;
 Laya.stage.screenMode = Laya.Stage.SCREEN_NONE;
 Laya.Stat.show();
-var scene = Laya.stage.addChild(new Laya.Scene3D());
-Laya.Sprite3D.load('res/LayaScene_aaaaaaa/Conventional/aaaaaaa.lh', Laya.Handler.create(null, function(sprite){scene.addChild(sprite); }));
+Laya.Scene3D.load('res/LayaScene_main/Conventional/main.ls', Laya.Handler.create(null, function(scene){Laya.stage.addChild(scene); }));
 })(this);

+ 9 - 0
color3D_unity/color3D/Assets/StreamingAssets/LayaDemo/res.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: d100f7509f7e5d848989e768d4a11399
+folderAsset: yes
+timeCreated: 1564713268
+licenseType: Pro
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 9 - 0
color3D_unity/color3D/Assets/StreamingAssets/LayaDemo/res/LayaScene_props.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: b0f8dd76e70b96f4a83826806d023a0b
+folderAsset: yes
+timeCreated: 1564713268
+licenseType: Pro
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 9 - 0
color3D_unity/color3D/Assets/StreamingAssets/LayaDemo/res/LayaScene_props/Conventional.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: fe40e2a8e71e7e94bbd39664464ef688
+folderAsset: yes
+timeCreated: 1564713268
+licenseType: Pro
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 9 - 0
color3D_unity/color3D/Assets/StreamingAssets/LayaDemo/res/LayaScene_props/Conventional/Assets.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 563cb1fb4449f704cb115ac2cda1646d
+folderAsset: yes
+timeCreated: 1564713268
+licenseType: Pro
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 0
color3D_unity/color3D/Assets/StreamingAssets/LayaDemo/res/LayaScene_props/Conventional/Assets/AllModel.meta


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません