Browse Source

提交老王的版本

gsgundam 3 years ago
parent
commit
7c72573a3a
34 changed files with 729 additions and 43 deletions
  1. 11 0
      Assets/CirclePoint.cs
  2. 113 23
      Assets/Controller.cs
  3. 4 4
      Assets/Dive/Scripts/OpenDiveSensor.cs
  4. BIN
      Assets/DiveUnityDemo/Scenes/DiveUnityDemo.unity
  5. BIN
      Assets/DiveUnityDemo/Scenes/DiveUnityDemo/NavMesh.asset
  6. 2 2
      Assets/DiveUnityDemo/Scenes/DiveUnityDemo/NavMesh.asset.meta
  7. BIN
      Assets/DiveUnityDemo/Scenes/DiveUnityDemo/OcclusionCullingData.asset
  8. 8 0
      Assets/DiveUnityDemo/Scenes/DiveUnityDemo/OcclusionCullingData.asset.meta
  9. 1 1
      Assets/EyePick.cs
  10. BIN
      Assets/Icon/app_icon.png
  11. 106 0
      Assets/Icon/app_icon.png.meta
  12. BIN
      Assets/Icon/splashscreen.png
  13. 106 0
      Assets/Icon/splashscreen.png.meta
  14. BIN
      Assets/Models/UI/TipPanel.controller
  15. 10 0
      Assets/Models/UI/TipPanel.controller.meta
  16. BIN
      Assets/Models/UI/TipPanelShow.anim
  17. 10 0
      Assets/Models/UI/TipPanelShow.anim.meta
  18. BIN
      Assets/Models/UI/arrow.png
  19. 112 0
      Assets/Models/UI/arrow.png.meta
  20. BIN
      Assets/Models/sailling.mp3
  21. 24 0
      Assets/Models/sailling.mp3.meta
  22. 26 2
      Assets/Modern Interior Pack/Models/Couches/couch001_corner.FBX.meta
  23. 29 1
      Assets/Plugins/Android/divejava.jar.meta
  24. 28 1
      Assets/Plugins/Android/libdivesensor.so.meta
  25. 29 1
      Assets/Plugins/Android/libs/armeabi/libdivesensor.so.meta
  26. 30 1
      Assets/Plugins/Android/libs/x86/libdivesensor.so.meta
  27. 2 2
      Assets/ScreenInput.cs
  28. 0 1
      Assets/Scripts/CenterPoint.cs
  29. 9 0
      Assets/Scripts/ModelTip.cs
  30. 13 0
      Assets/Scripts/ModelTip.cs.meta
  31. 39 0
      Assets/Scripts/ModelTipPanel.cs
  32. 13 0
      Assets/Scripts/ModelTipPanel.cs.meta
  33. 2 2
      Assets/Scripts/PlayerMove.cs
  34. 2 2
      Assets/Scripts/ScreenTouch.cs

+ 11 - 0
Assets/CirclePoint.cs

@@ -34,10 +34,21 @@ public class CirclePoint : MonoBehaviour {
                 interact = false;
             }
 
+			ModelTip modelTip = hit.collider.GetComponent<ModelTip> ();
+			if (modelTip != null)
+			{
+				Vector3 tipPos = hit.point + (Camera.main.transform.position - hit.point).normalized;
+				ModelTipPanel.Show (modelTip.tip, hit.point);
+			}
+			else
+			{
+				ModelTipPanel.Hide ();
+			}
         }
         else  //没有碰撞体的物体
         {
             interact = false;
+			ModelTipPanel.Hide ();
         }
     }
 

+ 113 - 23
Assets/Controller.cs

@@ -5,25 +5,46 @@ using System;
 using UnityEngine.UI;
 
 public class Controller : MonoBehaviour {
+
+	public enum InputType
+	{
+		None,
+		Eye,
+		Click,
+		Joystick,
+	}
+
     private bool CanMove = false; //假若没有选好运动模式之前都是禁止运动的
     private bool interact;
+	private InputType inputType;
    
 
     private float time = 3f;  //计时用变量,表示视线停留在phone图标上应该超过3秒后才能开始视选
     private float time2 = 0;//画布的淡入淡出效果所用时间
     public GameObject Player; //表示玩家
     public GameObject Canvas; //表示画布
-
+	public Transform arrowTrans;
+	public RectTransform selectUI;
+	public GameObject alertPanel;
    
   
 	// Use this for initialization
 	void Start () {
-   
-    
+
+		alertPanel.SetActive (false);
+		selectUI.gameObject.SetActive (true);
 	}
 	
 	// Update is called once per frame
 	void Update () {
+
+		if (alertPanel.gameObject.activeSelf)
+		{
+			CheckArrow ();
+			CheckAlert ();
+			return;
+		}
+
         if (!CanMove)
         {
             if(time2 < 3)
@@ -31,6 +52,7 @@ public class Controller : MonoBehaviour {
                 time2 += Time.deltaTime;
                 Canvas.GetComponent<CanvasGroup>().alpha = time2;
             }
+			CheckArrow ();
             //进行ui交互的代码
             SelectUI();
             EyePick();
@@ -47,15 +69,83 @@ public class Controller : MonoBehaviour {
             Canvas.GetComponent<CanvasGroup>().alpha = time2;
             if(time2 < 0)
             {
-                Canvas.SetActive(false);
+				Canvas.GetComponent<CanvasGroup>().alpha = 1f;
                 this.gameObject.SetActive(false);
+				arrowTrans.gameObject.SetActive (false);
+				selectUI.gameObject.SetActive (false);
+				alertPanel.gameObject.SetActive (false);
             }
      
         }
 	}
 
+	private void CheckAlert()
+	{
+		Ray ray = Camera.main.ScreenPointToRay (new Vector3 (Screen.width / 2, Screen.height / 2, 0));
+		RaycastHit hit;
+		if (Physics.Raycast(ray, out hit))
+		{
+			if (hit.collider.tag == "alertyes") //判断碰撞物体的tag,这里是表示可以被交互的物体
+			{
+				switch (inputType)
+				{
+				case InputType.Click:
+					if (Input.GetKeyDown (KeyCode.Mouse0))
+					{
+						alertPanel.SetActive (false);
+						selectUI.gameObject.SetActive (true);
+						Player.GetComponent<ScreenInput> ().enabled = true;
+						SelectTouch ();
+						Invoke ("Stay", 3f);
+					}
+					break;
+				}
+			}
+			else if(hit.collider.tag == "alertno")
+			{
+				switch (inputType)
+				{
+				case InputType.Click:
+					if (Input.GetKeyDown (KeyCode.Mouse0))
+					{
+						alertPanel.SetActive (false);
+						selectUI.gameObject.SetActive (true);
+						inputType = InputType.None;
+					}
+					break;
+				}
+			}
+
+		}
+	}
+
+	private void CheckArrow()
+	{
+		Vector2 screenPoint = RectTransformUtility.WorldToScreenPoint (Camera.main, selectUI.position);
+		float x = screenPoint.x - Screen.width / 2f;
+		float y = screenPoint.y - Screen.height / 2f;
+
+		float dis = Mathf.Sqrt (x * x + y * y);
+		if (dis > 500)
+		{
+			arrowTrans.gameObject.SetActive (true);
+			float theta = Mathf.Atan2 (y, x);
+			float angle = Mathf.Rad2Deg * theta;
+			arrowTrans.localEulerAngles = new Vector3 (0, 0, angle);
+		}
+		else
+		{
+			arrowTrans.gameObject.SetActive (false);
+		}
+	}
+
     void SelectUI()
     {
+		if (inputType == InputType.Click)
+		{
+			return;
+		}
+
         String currentButton = "";
         var values = Enum.GetValues(typeof(KeyCode));//存储所有的按键
         for (int x = 0; x < values.Length; x++)
@@ -65,15 +155,15 @@ public class Controller : MonoBehaviour {
                 currentButton = values.GetValue(x).ToString();//遍历并获取当前按下的按键
                 if (currentButton == "Mouse0")  //按下的是触屏按钮
                 {
-                    Player.GetComponent<ScreenInput>().enabled = true;
-                    SelectTouch();
-                    Invoke("Stay", 3f);
+					inputType = InputType.Click;
+					selectUI.gameObject.SetActive (false);
+					alertPanel.gameObject.SetActive (true);
                 }
                 if(currentButton == "Joystick1Button0") //按下的是蓝牙的确认键
                 {
-                    Player.GetComponent<BluethoothInput>().enabled = true;
-                    SelectBluetooth();
-                    Invoke("Stay", 3f);
+					Player.GetComponent<BluethoothInput> ().enabled = true;
+					SelectBluetooth ();
+					Invoke ("Stay", 3f);
                 }
             }
         }
@@ -82,7 +172,7 @@ public class Controller : MonoBehaviour {
     void Stay()
     {
         
-        Player.transform.FindChild("Dive_Camera").FindChild("Canvas").FindChild("Background3").gameObject.SetActive(true);
+        Player.transform.Find("Dive_Camera").Find("Canvas").Find("Background3").gameObject.SetActive(true);
         CanMove = true;
     }
 
@@ -111,46 +201,46 @@ public class Controller : MonoBehaviour {
 
     void SelectTouch()  //选择触屏模式代码
     {
-        Text text1 = Canvas.transform.FindChild("BackGround").FindChild("Touch").FindChild("Text").
+        Text text1 = Canvas.transform.Find("BackGround").Find("Touch").Find("Text").
             GetComponent<Text>();
         text1.color = new Color(118f / 256f, 255f / 256f, 147f / 256f, 256f / 256f);
-        Text text2 = Canvas.transform.FindChild("BackGround").FindChild("TitleText").GetComponent<Text>();
+        Text text2 = Canvas.transform.Find("BackGround").Find("TitleText").GetComponent<Text>();
         text2.text = String.Format("已经选择触屏模式");
-        Image img1 = Canvas.transform.FindChild("BackGround").FindChild("Touch").
+        Image img1 = Canvas.transform.Find("BackGround").Find("Touch").
             GetComponent<Image>();
         img1.color = new Color(118f / 256f, 255f / 256f, 147f / 256f, 256f / 256f);
-        Canvas.transform.FindChild("BackGround").FindChild("Touch").FindChild("Image").gameObject.SetActive(true);
+        Canvas.transform.Find("BackGround").Find("Touch").Find("Image").gameObject.SetActive(true);
     }
 
     void SelectBluetooth()
     {
-        Text text1 = Canvas.transform.FindChild("BackGround").FindChild("Bluetooth").FindChild("Text").
+        Text text1 = Canvas.transform.Find("BackGround").Find("Bluetooth").Find("Text").
             GetComponent<Text>();
         text1.color = new Color(118f / 256f, 255f / 256f, 147f / 256f, 256f / 256f);
 
-        Image img1 = Canvas.transform.FindChild("BackGround").FindChild("Bluetooth").
+        Image img1 = Canvas.transform.Find("BackGround").Find("Bluetooth").
             GetComponent<Image>();
         img1.color = new Color(118f / 256f, 255f / 256f, 147f / 256f, 256f / 256f);
 
-        Canvas.transform.FindChild("BackGround").FindChild("Bluetooth").FindChild("Image").gameObject.SetActive(true);
+        Canvas.transform.Find("BackGround").Find("Bluetooth").Find("Image").gameObject.SetActive(true);
 
-        Text text2 = Canvas.transform.FindChild("BackGround").FindChild("TitleText").GetComponent<Text>();
+        Text text2 = Canvas.transform.Find("BackGround").Find("TitleText").GetComponent<Text>();
         text2.text = String.Format("已经选择蓝牙模式");
     }
 
     void SelectEyePick()
     {
-        Text text1 = Canvas.transform.FindChild("BackGround").FindChild("Eye").FindChild("Text").
+        Text text1 = Canvas.transform.Find("BackGround").Find("Eye").Find("Text").
      GetComponent<Text>();
         text1.color = new Color(118f / 256f, 255f / 256f, 147f / 256f, 256f / 256f);
 
-        Image img1 = Canvas.transform.FindChild("BackGround").FindChild("Eye").
+        Image img1 = Canvas.transform.Find("BackGround").Find("Eye").
             GetComponent<Image>();
         img1.color = new Color(118f / 256f, 255f / 256f, 147f / 256f, 256f / 256f);
 
-        Canvas.transform.FindChild("BackGround").FindChild("Eye").FindChild("Image").gameObject.SetActive(true);
+        Canvas.transform.Find("BackGround").Find("Eye").Find("Image").gameObject.SetActive(true);
 
-        Text text2 = Canvas.transform.FindChild("BackGround").FindChild("TitleText").GetComponent<Text>();
+        Text text2 = Canvas.transform.Find("BackGround").Find("TitleText").GetComponent<Text>();
         text2.text = String.Format("已经选择视选模式");
     }
 

+ 4 - 4
Assets/Dive/Scripts/OpenDiveSensor.cs

@@ -68,8 +68,8 @@ public class OpenDiveSensor : MonoBehaviour {
 
 
 #if UNITY_EDITOR
-  #elif UNITY_ANDROID
-		Network.logLevel = NetworkLogLevel.Full;
+#elif UNITY_ANDROID
+		//Network.logLevel = NetworkLogLevel.Full;
 		use_udp(1);
 		initialize_sensors ();
 		int err = get_error();
@@ -83,10 +83,10 @@ public class OpenDiveSensor : MonoBehaviour {
 		}
 
 
-	#elif UNITY_IPHONE
+#elif UNITY_IPHONE
 		initialize_sensors();
 #endif
-		
+
 	}
 	
 	

BIN
Assets/DiveUnityDemo/Scenes/DiveUnityDemo.unity


BIN
Assets/DiveUnityDemo/Scenes/DiveUnityDemo/NavMesh.asset


+ 2 - 2
Assets/DiveUnityDemo/Scenes/DiveUnityDemo/NavMesh.asset.meta

@@ -1,8 +1,8 @@
 fileFormatVersion: 2
 guid: cec9ffbdfff38274495f806ec5b6158b
-timeCreated: 1492729813
-licenseType: Pro
 NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 23800000
   userData: 
   assetBundleName: 
   assetBundleVariant: 

BIN
Assets/DiveUnityDemo/Scenes/DiveUnityDemo/OcclusionCullingData.asset


+ 8 - 0
Assets/DiveUnityDemo/Scenes/DiveUnityDemo/OcclusionCullingData.asset.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c612e7209410c4318982ffc0857ad83c
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 36300000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 1
Assets/EyePick.cs

@@ -77,7 +77,7 @@ public class EyePick : MonoBehaviour {
 
     void Move()
     {
-        Vector3 TargetPos = EyePickFloor.transform.FindChild(CurrentCollider).position;
+        Vector3 TargetPos = EyePickFloor.transform.Find(CurrentCollider).position;
         agent.SetDestination(TargetPos);
         if(agent.remainingDistance > 0)  //如果与目标点的距离大于0那么表示还在运动中
         {

BIN
Assets/Icon/app_icon.png


+ 106 - 0
Assets/Icon/app_icon.png.meta

@@ -0,0 +1,106 @@
+fileFormatVersion: 2
+guid: f0fe93e6818ea45828e29f7fe9910f2f
+TextureImporter:
+  fileIDToRecycleName: {}
+  externalObjects: {}
+  serializedVersion: 4
+  mipmaps:
+    mipMapMode: 0
+    enableMipMap: 0
+    sRGBTexture: 1
+    linearTexture: 0
+    fadeOut: 0
+    borderMipMap: 0
+    mipMapsPreserveCoverage: 0
+    alphaTestReferenceValue: 0.5
+    mipMapFadeDistanceStart: 1
+    mipMapFadeDistanceEnd: 3
+  bumpmap:
+    convertToNormalMap: 0
+    externalNormalMap: 0
+    heightScale: 0.25
+    normalMapFilter: 0
+  isReadable: 0
+  grayScaleToAlpha: 0
+  generateCubemap: 6
+  cubemapConvolution: 0
+  seamlessCubemap: 0
+  textureFormat: 1
+  maxTextureSize: 2048
+  textureSettings:
+    serializedVersion: 2
+    filterMode: -1
+    aniso: -1
+    mipBias: -1
+    wrapU: 1
+    wrapV: 1
+    wrapW: -1
+  nPOTScale: 0
+  lightmap: 0
+  compressionQuality: 50
+  spriteMode: 1
+  spriteExtrude: 1
+  spriteMeshType: 1
+  alignment: 0
+  spritePivot: {x: 0.5, y: 0.5}
+  spritePixelsToUnits: 100
+  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+  spriteGenerateFallbackPhysicsShape: 1
+  alphaUsage: 1
+  alphaIsTransparency: 1
+  spriteTessellationDetail: -1
+  textureType: 8
+  textureShape: 1
+  maxTextureSizeSet: 0
+  compressionQualitySet: 0
+  textureFormatSet: 0
+  platformSettings:
+  - buildTarget: DefaultTexturePlatform
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    androidETC2FallbackOverride: 0
+  - buildTarget: Standalone
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    androidETC2FallbackOverride: 0
+  - buildTarget: iPhone
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    androidETC2FallbackOverride: 0
+  - buildTarget: Android
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    androidETC2FallbackOverride: 0
+  spriteSheet:
+    serializedVersion: 2
+    sprites: []
+    outline: []
+    physicsShape: []
+  spritePackingTag: 
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Icon/splashscreen.png


+ 106 - 0
Assets/Icon/splashscreen.png.meta

@@ -0,0 +1,106 @@
+fileFormatVersion: 2
+guid: eed71b94f8ee149e580f747d8635097f
+TextureImporter:
+  fileIDToRecycleName: {}
+  externalObjects: {}
+  serializedVersion: 4
+  mipmaps:
+    mipMapMode: 0
+    enableMipMap: 0
+    sRGBTexture: 1
+    linearTexture: 0
+    fadeOut: 0
+    borderMipMap: 0
+    mipMapsPreserveCoverage: 0
+    alphaTestReferenceValue: 0.5
+    mipMapFadeDistanceStart: 1
+    mipMapFadeDistanceEnd: 3
+  bumpmap:
+    convertToNormalMap: 0
+    externalNormalMap: 0
+    heightScale: 0.25
+    normalMapFilter: 0
+  isReadable: 0
+  grayScaleToAlpha: 0
+  generateCubemap: 6
+  cubemapConvolution: 0
+  seamlessCubemap: 0
+  textureFormat: 1
+  maxTextureSize: 2048
+  textureSettings:
+    serializedVersion: 2
+    filterMode: -1
+    aniso: -1
+    mipBias: -1
+    wrapU: 1
+    wrapV: 1
+    wrapW: -1
+  nPOTScale: 0
+  lightmap: 0
+  compressionQuality: 50
+  spriteMode: 1
+  spriteExtrude: 1
+  spriteMeshType: 1
+  alignment: 0
+  spritePivot: {x: 0.5, y: 0.5}
+  spritePixelsToUnits: 100
+  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+  spriteGenerateFallbackPhysicsShape: 1
+  alphaUsage: 1
+  alphaIsTransparency: 1
+  spriteTessellationDetail: -1
+  textureType: 8
+  textureShape: 1
+  maxTextureSizeSet: 0
+  compressionQualitySet: 0
+  textureFormatSet: 0
+  platformSettings:
+  - buildTarget: DefaultTexturePlatform
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    androidETC2FallbackOverride: 0
+  - buildTarget: Standalone
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    androidETC2FallbackOverride: 0
+  - buildTarget: iPhone
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    androidETC2FallbackOverride: 0
+  - buildTarget: Android
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    androidETC2FallbackOverride: 0
+  spriteSheet:
+    serializedVersion: 2
+    sprites: []
+    outline: []
+    physicsShape: []
+  spritePackingTag: 
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Models/UI/TipPanel.controller


+ 10 - 0
Assets/Models/UI/TipPanel.controller.meta

@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 926742ef1b9cb48ac87b8419c7cc628d
+timeCreated: 1540202024
+licenseType: Pro
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 9100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Models/UI/TipPanelShow.anim


+ 10 - 0
Assets/Models/UI/TipPanelShow.anim.meta

@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: c19e3b291ac6c44e889cb5df1fc25df9
+timeCreated: 1540202023
+licenseType: Pro
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 7400000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Models/UI/arrow.png


+ 112 - 0
Assets/Models/UI/arrow.png.meta

@@ -0,0 +1,112 @@
+fileFormatVersion: 2
+guid: 0e11a902581a246468729ff40b84d17e
+timeCreated: 1540195793
+licenseType: Pro
+TextureImporter:
+  fileIDToRecycleName: {}
+  externalObjects: {}
+  serializedVersion: 4
+  mipmaps:
+    mipMapMode: 0
+    enableMipMap: 0
+    sRGBTexture: 1
+    linearTexture: 0
+    fadeOut: 0
+    borderMipMap: 0
+    mipMapsPreserveCoverage: 0
+    alphaTestReferenceValue: 0.5
+    mipMapFadeDistanceStart: 1
+    mipMapFadeDistanceEnd: 3
+  bumpmap:
+    convertToNormalMap: 0
+    externalNormalMap: 0
+    heightScale: 0.25
+    normalMapFilter: 0
+  isReadable: 0
+  grayScaleToAlpha: 0
+  generateCubemap: 6
+  cubemapConvolution: 0
+  seamlessCubemap: 0
+  textureFormat: 1
+  maxTextureSize: 2048
+  textureSettings:
+    serializedVersion: 2
+    filterMode: -1
+    aniso: -1
+    mipBias: -1
+    wrapU: 1
+    wrapV: 1
+    wrapW: -1
+  nPOTScale: 0
+  lightmap: 0
+  compressionQuality: 50
+  spriteMode: 1
+  spriteExtrude: 1
+  spriteMeshType: 1
+  alignment: 0
+  spritePivot: {x: 0.5, y: 0.5}
+  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+  spritePixelsToUnits: 100
+  alphaUsage: 1
+  alphaIsTransparency: 1
+  spriteTessellationDetail: -1
+  textureType: 8
+  textureShape: 1
+  maxTextureSizeSet: 0
+  compressionQualitySet: 0
+  textureFormatSet: 0
+  platformSettings:
+  - buildTarget: DefaultTexturePlatform
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+  - buildTarget: Standalone
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+  - buildTarget: iPhone
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+  - buildTarget: Android
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+  - buildTarget: WebGL
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+  spriteSheet:
+    serializedVersion: 2
+    sprites: []
+    outline: []
+    physicsShape: []
+  spritePackingTag: 
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Models/sailling.mp3


+ 24 - 0
Assets/Models/sailling.mp3.meta

@@ -0,0 +1,24 @@
+fileFormatVersion: 2
+guid: e3eb85b95832c466eb1d74f5005d131e
+timeCreated: 1540197286
+licenseType: Pro
+AudioImporter:
+  externalObjects: {}
+  serializedVersion: 6
+  defaultSettings:
+    loadType: 0
+    sampleRateSetting: 0
+    sampleRateOverride: 44100
+    compressionFormat: 1
+    quality: 1
+    conversionMode: 0
+  platformSettingOverrides: {}
+  forceToMono: 0
+  normalize: 1
+  preloadAudioData: 1
+  loadInBackground: 0
+  ambisonic: 0
+  3D: 1
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 26 - 2
Assets/Modern Interior Pack/Models/Couches/couch001_corner.FBX.meta

@@ -1,7 +1,7 @@
 fileFormatVersion: 2
 guid: 98293d553bbab064093d7bf0d963b5c2
 ModelImporter:
-  serializedVersion: 19
+  serializedVersion: 23
   fileIDToRecycleName:
     100000: //RootNode
     100002: couch001_corner
@@ -16,26 +16,39 @@ ModelImporter:
     4300000: couch001_corner
     4300002: couch001_corner_cushion
     11100000: //RootNode
+    2186277476908879412: ImportLogs
+  externalObjects:
+  - first:
+      type: UnityEngine:Material
+      assembly: UnityEngine.CoreModule
+      name: 'Material #66'
+    second: {fileID: 2100000, guid: 1538df6ccea67024c9385de367a97127, type: 2}
   materials:
     importMaterials: 1
     materialName: 3
     materialSearch: 1
+    materialLocation: 0
   animations:
     legacyGenerateAnimations: 4
     bakeSimulation: 0
     resampleCurves: 1
     optimizeGameObjects: 0
     motionNodeName: 
+    rigImportErrors: 
+    rigImportWarnings: 
     animationImportErrors: 
     animationImportWarnings: 
     animationRetargetingWarnings: 
     animationDoRetargetingWarnings: 0
+    importAnimatedCustomProperties: 0
+    importConstraints: 0
     animationCompression: 1
     animationRotationError: 0.5
     animationPositionError: 0.5
     animationScaleError: 0.5
     animationWrapMode: 0
     extraExposedTransformPaths: []
+    extraUserProperties: []
     clipAnimations: []
     isReadable: 1
   meshes:
@@ -43,22 +56,34 @@ ModelImporter:
     globalScale: 0.01
     meshCompression: 0
     addColliders: 0
+    useSRGBMaterialColor: 1
+    importVisibility: 0
     importBlendShapes: 1
+    importCameras: 0
+    importLights: 0
     swapUVChannels: 0
     generateSecondaryUV: 1
     useFileUnits: 1
     optimizeMeshForGPU: 1
     keepQuads: 0
     weldVertices: 1
+    preserveHierarchy: 0
+    indexFormat: 1
     secondaryUVAngleDistortion: 8
     secondaryUVAreaDistortion: 15.000001
     secondaryUVHardAngle: 88
     secondaryUVPackMargin: 4
     useFileScale: 0
+    previousCalculatedGlobalScale: 1
+    hasPreviousCalculatedGlobalScale: 0
   tangentSpace:
     normalSmoothAngle: 60
     normalImportMode: 0
     tangentImportMode: 4
+    normalCalculationMode: 0
+    legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 1
+    blendShapeNormalImportMode: 1
+    normalSmoothingSource: 0
   importAnimation: 1
   copyAvatar: 0
   humanDescription:
@@ -73,7 +98,6 @@ ModelImporter:
     legStretch: 0.05
     feetSpacing: 0
     rootMotionBoneName: 
-    rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
     hasTranslationDoF: 0
     hasExtraRoot: 0
     skeletonHasParents: 1

+ 29 - 1
Assets/Plugins/Android/divejava.jar.meta

@@ -1,4 +1,32 @@
 fileFormatVersion: 2
 guid: 9805370ce47934f43b2d5738461278d6
-DefaultImporter:
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Android: Android
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Any: 
+    second:
+      enabled: 0
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
   userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 28 - 1
Assets/Plugins/Android/libdivesensor.so.meta

@@ -1,6 +1,33 @@
 fileFormatVersion: 2
 guid: 25bdb4e898b72d54caca0beb72706708
-DefaultImporter:
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Android: Android
+    second:
+      enabled: 1
+      settings:
+        CPU: ARMv7
+  - first:
+      Any: 
+    second:
+      enabled: 0
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
   userData: 
   assetBundleName: 
   assetBundleVariant: 

+ 29 - 1
Assets/Plugins/Android/libs/armeabi/libdivesensor.so.meta

@@ -1,4 +1,32 @@
 fileFormatVersion: 2
 guid: 0d264d510ec48c644954841b63094831
-DefaultImporter:
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Android: Android
+    second:
+      enabled: 0
+      settings: {}
+  - first:
+      Any: 
+    second:
+      enabled: 0
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
   userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 30 - 1
Assets/Plugins/Android/libs/x86/libdivesensor.so.meta

@@ -1,4 +1,33 @@
 fileFormatVersion: 2
 guid: 3fcddfc93e51a8148b951dc789455723
-DefaultImporter:
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Android: Android
+    second:
+      enabled: 1
+      settings:
+        CPU: x86
+  - first:
+      Any: 
+    second:
+      enabled: 0
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
   userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 2 - 2
Assets/ScreenInput.cs

@@ -36,13 +36,13 @@ public class ScreenInput : MonoBehaviour {
     {
         if (Input.GetMouseButtonDown(0))
         {
-
+            Debug.Log(Input.GetMouseButtonDown(0));
             //摄像机到点击位置的的射线  
             Ray ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2, 0));
             RaycastHit hit;
             if (Physics.Raycast(ray, out hit))
             {
-                //Debug.Log(111);
+                Debug.Log(hit.collider.name);
                 //判断点击的是否地形  
                 if (hit.collider.name != "floor")
                 {

+ 0 - 1
Assets/Scripts/CenterPoint.cs

@@ -36,7 +36,6 @@ public class CenterPoint : MonoBehaviour {
             {
                 interact = false;
             }
-
         }else  //没有碰撞体的物体
         {
             interact = false;

+ 9 - 0
Assets/Scripts/ModelTip.cs

@@ -0,0 +1,9 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class ModelTip : MonoBehaviour {
+
+	public string tip;
+
+}

+ 13 - 0
Assets/Scripts/ModelTip.cs.meta

@@ -0,0 +1,13 @@
+fileFormatVersion: 2
+guid: e7513a610c69541348e06abe6764f21c
+timeCreated: 1540201775
+licenseType: Pro
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 39 - 0
Assets/Scripts/ModelTipPanel.cs

@@ -0,0 +1,39 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class ModelTipPanel : MonoBehaviour {
+
+	public Text tipTxt;
+	public Animator animator;
+
+	void Start()
+	{
+		instance = this;
+		gameObject.SetActive (false);
+	}
+
+	void Update()
+	{
+		Vector3 forward = this.transform.position - Camera.main.transform.position;
+		this.transform.forward = forward.normalized;
+	}
+
+	private static ModelTipPanel instance;
+	public static void Show(string txt, Vector3 pos)
+	{
+		bool show = !instance.gameObject.activeSelf;
+		instance.tipTxt.text = txt;
+		instance.transform.position = pos;
+		instance.gameObject.SetActive (true);
+
+		if(show)
+			instance.animator.Play ("TipPanelShow", 0, 0);
+	}
+
+	public static void Hide()
+	{
+		instance.gameObject.SetActive (false);
+	}
+}

+ 13 - 0
Assets/Scripts/ModelTipPanel.cs.meta

@@ -0,0 +1,13 @@
+fileFormatVersion: 2
+guid: 685f5f880438049d7a27b2a8679f132f
+timeCreated: 1540201847
+licenseType: Pro
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 2 - 2
Assets/Scripts/PlayerMove.cs

@@ -186,7 +186,7 @@ public class PlayerMove : MonoBehaviour {
         {
             if (Input.mousePosition.x > Screen.width / 2) //点击右边相机显示的屏幕
             {
-                cam = transform.FindChild("Dive_Camera").FindChild("Camera_right").GetComponent<Camera>();  //获取右边的相机
+                cam = transform.Find("Dive_Camera").Find("Camera_right").GetComponent<Camera>();  //获取右边的相机
                 Ray ray = cam.ScreenPointToRay(Input.mousePosition);  //从右边相机屏幕上获得射线
                 RaycastHit hit;
                 if (Physics.Raycast(ray, out hit))
@@ -198,7 +198,7 @@ public class PlayerMove : MonoBehaviour {
             }
             if (Input.mousePosition.x < Screen.width / 2) //点击左边相机显示的屏幕
             {
-                cam = transform.FindChild("Dive_Camera").FindChild("Camera_left").GetComponent<Camera>();  //获取左边的相机
+                cam = transform.Find("Dive_Camera").Find("Camera_left").GetComponent<Camera>();  //获取左边的相机
                 Ray ray = cam.ScreenPointToRay(Input.mousePosition);  //从左边相机屏幕上获得射线
                 RaycastHit hit;
                 if (Physics.Raycast(ray, out hit))

+ 2 - 2
Assets/Scripts/ScreenTouch.cs

@@ -37,7 +37,7 @@ public class ScreenTouch : MonoBehaviour {
             
             if (Input.mousePosition.x > Screen.width / 2) //点击右边相机显示的屏幕
             {
-                cam = transform.FindChild("Dive_Camera").FindChild("Camera_right").GetComponent<Camera>();  //获取右边的相机
+                cam = transform.Find("Dive_Camera").Find("Camera_right").GetComponent<Camera>();  //获取右边的相机
                 Ray ray = cam.ScreenPointToRay(Input.mousePosition);  //从右边相机屏幕上获得射线
                 RaycastHit hit;
                 if (Physics.Raycast(ray, out hit))
@@ -49,7 +49,7 @@ public class ScreenTouch : MonoBehaviour {
             }
             if (Input.mousePosition.x < Screen.width / 2) //点击左边相机显示的屏幕
             {
-                cam = transform.FindChild("Dive_Camera").FindChild("Camera_left").GetComponent<Camera>();  //获取左边的相机
+                cam = transform.Find("Dive_Camera").Find("Camera_left").GetComponent<Camera>();  //获取左边的相机
                 Ray ray = cam.ScreenPointToRay(Input.mousePosition);  //从左边相机屏幕上获得射线
                 RaycastHit hit;
                 if (Physics.Raycast(ray, out hit))