fenix 8 years ago
parent
commit
95d6c1d1a5
69 changed files with 943 additions and 707 deletions
  1. 0 1
      Assets/Editor/GameTools.cs
  2. 9 0
      Assets/Models/Battle/CraftAgent.meta
  3. BIN
      Assets/Models/Battle/CraftsNew/CraftTopController.controller
  4. 8 0
      Assets/Models/Battle/CraftsNew/CraftTopController.controller.meta
  5. BIN
      Assets/Models/Battle/CraftsNew/DasherBottomController.overrideController
  6. 8 0
      Assets/Models/Battle/CraftsNew/DasherBottomController.overrideController.meta
  7. 24 16
      Assets/Models/Battle/CraftsNew/DasherBottom_Attack.FBX.meta
  8. 23 15
      Assets/Models/Battle/CraftsNew/DasherBottom_Idle.FBX.meta
  9. 24 16
      Assets/Models/Battle/CraftsNew/DasherBottom_Run.FBX.meta
  10. 23 15
      Assets/Models/Battle/CraftsNew/DasherTop_Attack.FBX.meta
  11. 23 15
      Assets/Models/Battle/CraftsNew/DasherTop_Idle.FBX.meta
  12. 24 16
      Assets/Models/Battle/CraftsNew/DasherTop_Run.FBX.meta
  13. BIN
      Assets/Models/Battle/Maps/Materials/map.mat
  14. BIN
      Assets/Models/Battle/Utils/SkyboxProcedural.mat
  15. 8 0
      Assets/Models/Battle/Utils/SkyboxProcedural.mat.meta
  16. BIN
      Assets/Models/UI/Public/UIDisplay.prefab
  17. 1 0
      Assets/Plugins/UnityPurchasing/Bin/Android/AmazonAppStore.aar.meta
  18. 1 0
      Assets/Plugins/UnityPurchasing/Bin/Android/CloudMoolah.aar.meta
  19. 1 0
      Assets/Plugins/UnityPurchasing/Bin/Android/GoogleAIDL.aar.meta
  20. 1 0
      Assets/Plugins/UnityPurchasing/Bin/Android/GooglePlay.aar.meta
  21. 1 0
      Assets/Plugins/UnityPurchasing/Bin/Android/SamsungApps.aar.meta
  22. 1 0
      Assets/Plugins/UnityPurchasing/Bin/Android/common.aar.meta
  23. 1 1
      Assets/Plugins/UnityPurchasing/ETag
  24. BIN
      Assets/Resources/Prefabs/Buildings/Door.prefab
  25. BIN
      Assets/Resources/Prefabs/Buildings/Station.prefab
  26. BIN
      Assets/Resources/Prefabs/CraftsNew/Assassin.prefab
  27. BIN
      Assets/Resources/Prefabs/CraftsNew/CraftAgent.prefab
  28. 8 0
      Assets/Resources/Prefabs/CraftsNew/CraftAgent.prefab.meta
  29. BIN
      Assets/Resources/Prefabs/CraftsNew/Dasher.prefab
  30. BIN
      Assets/Resources/Prefabs/CraftsNew/Flame.prefab
  31. BIN
      Assets/Resources/Prefabs/CraftsNew/Hunter.prefab
  32. BIN
      Assets/Resources/Prefabs/CraftsNew/Ice.prefab
  33. BIN
      Assets/Resources/Prefabs/CraftsNew/Medic.prefab
  34. BIN
      Assets/Resources/Prefabs/CraftsNew/Spider.prefab
  35. BIN
      Assets/Resources/Prefabs/CraftsNew/Thunder.prefab
  36. BIN
      Assets/Resources/Prefabs/CraftsNew/TinySpider.prefab
  37. 9 0
      Assets/ScenesNew.meta
  38. 9 0
      Assets/ScenesNew/Base.meta
  39. BIN
      Assets/ScenesNew/Base.unity
  40. 8 0
      Assets/ScenesNew/Base.unity.meta
  41. BIN
      Assets/ScenesNew/Base/LightingData.asset
  42. 8 0
      Assets/ScenesNew/Base/LightingData.asset.meta
  43. BIN
      Assets/ScenesNew/Base/Lightmap-0_comp_dir.png
  44. 68 0
      Assets/ScenesNew/Base/Lightmap-0_comp_dir.png.meta
  45. BIN
      Assets/ScenesNew/Base/Lightmap-0_comp_light.exr
  46. 68 0
      Assets/ScenesNew/Base/Lightmap-0_comp_light.exr.meta
  47. BIN
      Assets/ScenesNew/Base/NavMesh.asset
  48. 8 0
      Assets/ScenesNew/Base/NavMesh.asset.meta
  49. BIN
      Assets/ScenesNew/Base/ReflectionProbe-0.exr
  50. 69 0
      Assets/ScenesNew/Base/ReflectionProbe-0.exr.meta
  51. 61 166
      Assets/Scripts/Battle/InputController.cs
  52. 1 1
      Assets/Scripts/Battle/Map/AI/NormalAI.cs
  53. 3 3
      Assets/Scripts/Battle/Map/AI/ShowAI.cs
  54. 1 4
      Assets/Scripts/Battle/Map/AI/SoldierAI.cs
  55. 3 0
      Assets/Scripts/Battle/Map/BattleObject.cs
  56. 68 388
      Assets/Scripts/Battle/Map/Craft/Craft.cs
  57. 11 6
      Assets/Scripts/Battle/Map/Craft/CraftFactory.cs
  58. 63 0
      Assets/Scripts/Battle/Map/Craft/CraftModel.cs
  59. 12 0
      Assets/Scripts/Battle/Map/Craft/CraftModel.cs.meta
  60. 2 15
      Assets/Scripts/Battle/Map/Craft/SwapManager.cs
  61. 1 1
      Assets/Scripts/Battle/Map/Map.cs
  62. 25 25
      Assets/Scripts/Battle/Map/Utils/Invisibler.cs
  63. 3 3
      Assets/Scripts/Net/Message/MessageManager.cs
  64. 244 0
      Assets/Shader/Skybox-Procedural.shader
  65. 9 0
      Assets/Shader/Skybox-Procedural.shader.meta
  66. BIN
      ProjectSettings/EditorBuildSettings.asset
  67. BIN
      ProjectSettings/ProjectSettings.asset
  68. BIN
      ProjectSettings/QualitySettings.asset
  69. BIN
      ProjectSettings/TagManager.asset

+ 0 - 1
Assets/Editor/GameTools.cs

@@ -96,7 +96,6 @@ public class GameTools : EditorWindow
 				craftData.isHero = true;
 				Craft craft = battleSession.GetBattleController().CreateCraft(craftData, new CraftEquipModify());
 				craft.position = new Vector3(8f, 0, 8f);
-				craft.bodyTrans.gameObject.AddComponent<CraftPoseRotater>();
 
 				CraftSelectionPanel craftSelectPanel = GameObject.FindObjectOfType<CraftSelectionPanel>();
 				if(craftSelectPanel != null)

+ 9 - 0
Assets/Models/Battle/CraftAgent.meta

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

BIN
Assets/Models/Battle/CraftsNew/CraftTopController.controller


+ 8 - 0
Assets/Models/Battle/CraftsNew/CraftTopController.controller.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 8387441011c200045ad6eb73a8090241
+timeCreated: 1494311239
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Models/Battle/CraftsNew/DasherBottomController.overrideController


+ 8 - 0
Assets/Models/Battle/CraftsNew/DasherBottomController.overrideController.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c07da9c61b3c40247a39e4e6c87efe98
+timeCreated: 1494312361
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 24 - 16
Assets/Models/Battle/CraftsNew/DasherBottom_Attack.FBX.meta

@@ -3,7 +3,7 @@ guid: 43a55350bf9f9a6438e1aea598cdb8bc
 timeCreated: 1456820275
 licenseType: Pro
 ModelImporter:
-  serializedVersion: 18
+  serializedVersion: 19
   fileIDToRecycleName:
     100000: Bip001
     100002: Bip001 Head
@@ -67,16 +67,17 @@ ModelImporter:
   animations:
     legacyGenerateAnimations: 4
     bakeSimulation: 0
+    resampleCurves: 1
     optimizeGameObjects: 0
     motionNodeName: 
     animationImportErrors: 
     animationImportWarnings: 
     animationRetargetingWarnings: 
     animationDoRetargetingWarnings: 0
-    animationCompression: 1
-    animationRotationError: .5
-    animationPositionError: .5
-    animationScaleError: .5
+    animationCompression: 3
+    animationRotationError: 0.5
+    animationPositionError: 0.5
+    animationScaleError: 0.5
     animationWrapMode: 0
     extraExposedTransformPaths: []
     clipAnimations:
@@ -84,12 +85,13 @@ ModelImporter:
       name: Attack
       takeName: Take 001
       firstFrame: 0
-      lastFrame: 24
+      lastFrame: 0
       wrapMode: 1
       orientationOffsetY: 0
       level: 0
       cycleOffset: 0
       loop: 0
+      hasAdditiveReferencePose: 0
       loopTime: 0
       loopBlend: 0
       loopBlendOrientation: 0
@@ -168,10 +170,11 @@ ModelImporter:
         weight: 1
       maskType: 0
       maskSource: {instanceID: 0}
+      additiveReferencePoseFrame: 0
     isReadable: 1
   meshes:
     lODScreenPercentages: []
-    globalScale: .00100000005
+    globalScale: 0.001
     meshCompression: 0
     addColliders: 0
     importBlendShapes: 1
@@ -188,24 +191,29 @@ ModelImporter:
     useFileScale: 1
   tangentSpace:
     normalSmoothAngle: 60
-    splitTangentsAcrossUV: 1
     normalImportMode: 0
-    tangentImportMode: 1
+    tangentImportMode: 4
   importAnimation: 1
   copyAvatar: 0
   humanDescription:
+    serializedVersion: 2
     human: []
     skeleton: []
-    armTwist: .5
-    foreArmTwist: .5
-    upperLegTwist: .5
-    legTwist: .5
-    armStretch: .0500000007
-    legStretch: .0500000007
+    armTwist: 0.5
+    foreArmTwist: 0.5
+    upperLegTwist: 0.5
+    legTwist: 0.5
+    armStretch: 0.05
+    legStretch: 0.05
     feetSpacing: 0
     rootMotionBoneName: 
+    rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
+    hasTranslationDoF: 0
+    hasExtraRoot: 1
+    skeletonHasParents: 0
   lastHumanDescriptionAvatarSource: {instanceID: 0}
-  animationType: 1
+  animationType: 2
+  humanoidOversampling: 1
   additionalBone: 0
   userData: 
   assetBundleName: 

+ 23 - 15
Assets/Models/Battle/CraftsNew/DasherBottom_Idle.FBX.meta

@@ -3,7 +3,7 @@ guid: b961785334db4d5429659a23a2ef2842
 timeCreated: 1456816246
 licenseType: Pro
 ModelImporter:
-  serializedVersion: 18
+  serializedVersion: 19
   fileIDToRecycleName:
     100000: Bip001
     100002: Bip001 Head
@@ -67,16 +67,17 @@ ModelImporter:
   animations:
     legacyGenerateAnimations: 4
     bakeSimulation: 0
+    resampleCurves: 1
     optimizeGameObjects: 0
     motionNodeName: 
     animationImportErrors: 
     animationImportWarnings: 
     animationRetargetingWarnings: 
     animationDoRetargetingWarnings: 0
-    animationCompression: 1
-    animationRotationError: .5
-    animationPositionError: .5
-    animationScaleError: .5
+    animationCompression: 3
+    animationRotationError: 0.5
+    animationPositionError: 0.5
+    animationScaleError: 0.5
     animationWrapMode: 0
     extraExposedTransformPaths: []
     clipAnimations:
@@ -90,6 +91,7 @@ ModelImporter:
       level: 0
       cycleOffset: 0
       loop: 0
+      hasAdditiveReferencePose: 0
       loopTime: 0
       loopBlend: 0
       loopBlendOrientation: 0
@@ -168,10 +170,11 @@ ModelImporter:
         weight: 1
       maskType: 0
       maskSource: {instanceID: 0}
+      additiveReferencePoseFrame: 0
     isReadable: 1
   meshes:
     lODScreenPercentages: []
-    globalScale: .00100000005
+    globalScale: 0.001
     meshCompression: 0
     addColliders: 0
     importBlendShapes: 1
@@ -188,24 +191,29 @@ ModelImporter:
     useFileScale: 1
   tangentSpace:
     normalSmoothAngle: 60
-    splitTangentsAcrossUV: 1
     normalImportMode: 0
-    tangentImportMode: 1
+    tangentImportMode: 4
   importAnimation: 1
   copyAvatar: 0
   humanDescription:
+    serializedVersion: 2
     human: []
     skeleton: []
-    armTwist: .5
-    foreArmTwist: .5
-    upperLegTwist: .5
-    legTwist: .5
-    armStretch: .0500000007
-    legStretch: .0500000007
+    armTwist: 0.5
+    foreArmTwist: 0.5
+    upperLegTwist: 0.5
+    legTwist: 0.5
+    armStretch: 0.05
+    legStretch: 0.05
     feetSpacing: 0
     rootMotionBoneName: 
+    rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
+    hasTranslationDoF: 0
+    hasExtraRoot: 1
+    skeletonHasParents: 0
   lastHumanDescriptionAvatarSource: {instanceID: 0}
-  animationType: 1
+  animationType: 2
+  humanoidOversampling: 1
   additionalBone: 0
   userData: 
   assetBundleName: 

+ 24 - 16
Assets/Models/Battle/CraftsNew/DasherBottom_Run.FBX.meta

@@ -3,7 +3,7 @@ guid: d7f8d00bbb209f842801580f5562338b
 timeCreated: 1456818692
 licenseType: Pro
 ModelImporter:
-  serializedVersion: 18
+  serializedVersion: 19
   fileIDToRecycleName:
     100000: Bip001
     100002: Bip001 Head
@@ -67,16 +67,17 @@ ModelImporter:
   animations:
     legacyGenerateAnimations: 4
     bakeSimulation: 0
+    resampleCurves: 1
     optimizeGameObjects: 0
     motionNodeName: 
     animationImportErrors: 
     animationImportWarnings: 
     animationRetargetingWarnings: 
     animationDoRetargetingWarnings: 0
-    animationCompression: 1
-    animationRotationError: .5
-    animationPositionError: .5
-    animationScaleError: .5
+    animationCompression: 3
+    animationRotationError: 0.5
+    animationPositionError: 0.5
+    animationScaleError: 0.5
     animationWrapMode: 0
     extraExposedTransformPaths: []
     clipAnimations:
@@ -90,7 +91,8 @@ ModelImporter:
       level: 0
       cycleOffset: 0
       loop: 0
-      loopTime: 0
+      hasAdditiveReferencePose: 0
+      loopTime: 1
       loopBlend: 0
       loopBlendOrientation: 0
       loopBlendPositionY: 0
@@ -168,10 +170,11 @@ ModelImporter:
         weight: 1
       maskType: 0
       maskSource: {instanceID: 0}
+      additiveReferencePoseFrame: 0
     isReadable: 1
   meshes:
     lODScreenPercentages: []
-    globalScale: .00100000005
+    globalScale: 0.001
     meshCompression: 0
     addColliders: 0
     importBlendShapes: 1
@@ -188,24 +191,29 @@ ModelImporter:
     useFileScale: 1
   tangentSpace:
     normalSmoothAngle: 60
-    splitTangentsAcrossUV: 1
     normalImportMode: 0
-    tangentImportMode: 1
+    tangentImportMode: 4
   importAnimation: 1
   copyAvatar: 0
   humanDescription:
+    serializedVersion: 2
     human: []
     skeleton: []
-    armTwist: .5
-    foreArmTwist: .5
-    upperLegTwist: .5
-    legTwist: .5
-    armStretch: .0500000007
-    legStretch: .0500000007
+    armTwist: 0.5
+    foreArmTwist: 0.5
+    upperLegTwist: 0.5
+    legTwist: 0.5
+    armStretch: 0.05
+    legStretch: 0.05
     feetSpacing: 0
     rootMotionBoneName: 
+    rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
+    hasTranslationDoF: 0
+    hasExtraRoot: 1
+    skeletonHasParents: 0
   lastHumanDescriptionAvatarSource: {instanceID: 0}
-  animationType: 1
+  animationType: 2
+  humanoidOversampling: 1
   additionalBone: 0
   userData: 
   assetBundleName: 

+ 23 - 15
Assets/Models/Battle/CraftsNew/DasherTop_Attack.FBX.meta

@@ -3,7 +3,7 @@ guid: 85556b73dc81221449405ec1acd18863
 timeCreated: 1456820275
 licenseType: Pro
 ModelImporter:
-  serializedVersion: 18
+  serializedVersion: 19
   fileIDToRecycleName:
     100000: Bip001
     100002: Bip001 Head
@@ -67,16 +67,17 @@ ModelImporter:
   animations:
     legacyGenerateAnimations: 4
     bakeSimulation: 0
+    resampleCurves: 1
     optimizeGameObjects: 0
     motionNodeName: 
     animationImportErrors: 
     animationImportWarnings: 
     animationRetargetingWarnings: 
     animationDoRetargetingWarnings: 0
-    animationCompression: 1
-    animationRotationError: .5
-    animationPositionError: .5
-    animationScaleError: .5
+    animationCompression: 3
+    animationRotationError: 0.5
+    animationPositionError: 0.5
+    animationScaleError: 0.5
     animationWrapMode: 0
     extraExposedTransformPaths: []
     clipAnimations:
@@ -90,6 +91,7 @@ ModelImporter:
       level: 0
       cycleOffset: 0
       loop: 0
+      hasAdditiveReferencePose: 0
       loopTime: 0
       loopBlend: 0
       loopBlendOrientation: 0
@@ -168,10 +170,11 @@ ModelImporter:
         weight: 1
       maskType: 0
       maskSource: {instanceID: 0}
+      additiveReferencePoseFrame: 0
     isReadable: 1
   meshes:
     lODScreenPercentages: []
-    globalScale: .00100000005
+    globalScale: 0.001
     meshCompression: 0
     addColliders: 0
     importBlendShapes: 1
@@ -188,24 +191,29 @@ ModelImporter:
     useFileScale: 1
   tangentSpace:
     normalSmoothAngle: 60
-    splitTangentsAcrossUV: 1
     normalImportMode: 0
-    tangentImportMode: 1
+    tangentImportMode: 4
   importAnimation: 1
   copyAvatar: 0
   humanDescription:
+    serializedVersion: 2
     human: []
     skeleton: []
-    armTwist: .5
-    foreArmTwist: .5
-    upperLegTwist: .5
-    legTwist: .5
-    armStretch: .0500000007
-    legStretch: .0500000007
+    armTwist: 0.5
+    foreArmTwist: 0.5
+    upperLegTwist: 0.5
+    legTwist: 0.5
+    armStretch: 0.05
+    legStretch: 0.05
     feetSpacing: 0
     rootMotionBoneName: 
+    rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
+    hasTranslationDoF: 1
+    hasExtraRoot: 1
+    skeletonHasParents: 0
   lastHumanDescriptionAvatarSource: {instanceID: 0}
-  animationType: 1
+  animationType: 2
+  humanoidOversampling: 1
   additionalBone: 0
   userData: 
   assetBundleName: 

+ 23 - 15
Assets/Models/Battle/CraftsNew/DasherTop_Idle.FBX.meta

@@ -3,7 +3,7 @@ guid: c3a0db7928321324a9fb9f3fb498b11c
 timeCreated: 1456816246
 licenseType: Pro
 ModelImporter:
-  serializedVersion: 18
+  serializedVersion: 19
   fileIDToRecycleName:
     100000: Bip001
     100002: Bip001 Head
@@ -67,16 +67,17 @@ ModelImporter:
   animations:
     legacyGenerateAnimations: 4
     bakeSimulation: 0
+    resampleCurves: 1
     optimizeGameObjects: 0
     motionNodeName: 
     animationImportErrors: 
     animationImportWarnings: 
     animationRetargetingWarnings: 
     animationDoRetargetingWarnings: 0
-    animationCompression: 1
-    animationRotationError: .5
-    animationPositionError: .5
-    animationScaleError: .5
+    animationCompression: 3
+    animationRotationError: 0.5
+    animationPositionError: 0.5
+    animationScaleError: 0.5
     animationWrapMode: 0
     extraExposedTransformPaths: []
     clipAnimations:
@@ -90,6 +91,7 @@ ModelImporter:
       level: 0
       cycleOffset: 0
       loop: 0
+      hasAdditiveReferencePose: 0
       loopTime: 0
       loopBlend: 0
       loopBlendOrientation: 0
@@ -168,10 +170,11 @@ ModelImporter:
         weight: 1
       maskType: 0
       maskSource: {instanceID: 0}
+      additiveReferencePoseFrame: 0
     isReadable: 1
   meshes:
     lODScreenPercentages: []
-    globalScale: .00100000005
+    globalScale: 0.001
     meshCompression: 0
     addColliders: 0
     importBlendShapes: 1
@@ -188,24 +191,29 @@ ModelImporter:
     useFileScale: 1
   tangentSpace:
     normalSmoothAngle: 60
-    splitTangentsAcrossUV: 1
     normalImportMode: 0
-    tangentImportMode: 1
+    tangentImportMode: 4
   importAnimation: 1
   copyAvatar: 0
   humanDescription:
+    serializedVersion: 2
     human: []
     skeleton: []
-    armTwist: .5
-    foreArmTwist: .5
-    upperLegTwist: .5
-    legTwist: .5
-    armStretch: .0500000007
-    legStretch: .0500000007
+    armTwist: 0.5
+    foreArmTwist: 0.5
+    upperLegTwist: 0.5
+    legTwist: 0.5
+    armStretch: 0.05
+    legStretch: 0.05
     feetSpacing: 0
     rootMotionBoneName: 
+    rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
+    hasTranslationDoF: 0
+    hasExtraRoot: 1
+    skeletonHasParents: 0
   lastHumanDescriptionAvatarSource: {instanceID: 0}
-  animationType: 1
+  animationType: 2
+  humanoidOversampling: 1
   additionalBone: 0
   userData: 
   assetBundleName: 

+ 24 - 16
Assets/Models/Battle/CraftsNew/DasherTop_Run.FBX.meta

@@ -3,7 +3,7 @@ guid: db8ba19f761058147b411e8c961d61b9
 timeCreated: 1456818692
 licenseType: Pro
 ModelImporter:
-  serializedVersion: 18
+  serializedVersion: 19
   fileIDToRecycleName:
     100000: Bip001
     100002: Bip001 Head
@@ -67,16 +67,17 @@ ModelImporter:
   animations:
     legacyGenerateAnimations: 4
     bakeSimulation: 0
+    resampleCurves: 1
     optimizeGameObjects: 0
     motionNodeName: 
     animationImportErrors: 
     animationImportWarnings: 
     animationRetargetingWarnings: 
     animationDoRetargetingWarnings: 0
-    animationCompression: 1
-    animationRotationError: .5
-    animationPositionError: .5
-    animationScaleError: .5
+    animationCompression: 3
+    animationRotationError: 0.5
+    animationPositionError: 0.5
+    animationScaleError: 0.5
     animationWrapMode: 0
     extraExposedTransformPaths: []
     clipAnimations:
@@ -90,7 +91,8 @@ ModelImporter:
       level: 0
       cycleOffset: 0
       loop: 0
-      loopTime: 0
+      hasAdditiveReferencePose: 0
+      loopTime: 1
       loopBlend: 0
       loopBlendOrientation: 0
       loopBlendPositionY: 0
@@ -168,10 +170,11 @@ ModelImporter:
         weight: 1
       maskType: 0
       maskSource: {instanceID: 0}
+      additiveReferencePoseFrame: 0
     isReadable: 1
   meshes:
     lODScreenPercentages: []
-    globalScale: .00100000005
+    globalScale: 0.001
     meshCompression: 0
     addColliders: 0
     importBlendShapes: 1
@@ -188,24 +191,29 @@ ModelImporter:
     useFileScale: 1
   tangentSpace:
     normalSmoothAngle: 60
-    splitTangentsAcrossUV: 1
     normalImportMode: 0
-    tangentImportMode: 1
+    tangentImportMode: 4
   importAnimation: 1
   copyAvatar: 0
   humanDescription:
+    serializedVersion: 2
     human: []
     skeleton: []
-    armTwist: .5
-    foreArmTwist: .5
-    upperLegTwist: .5
-    legTwist: .5
-    armStretch: .0500000007
-    legStretch: .0500000007
+    armTwist: 0.5
+    foreArmTwist: 0.5
+    upperLegTwist: 0.5
+    legTwist: 0.5
+    armStretch: 0.05
+    legStretch: 0.05
     feetSpacing: 0
     rootMotionBoneName: 
+    rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
+    hasTranslationDoF: 0
+    hasExtraRoot: 1
+    skeletonHasParents: 0
   lastHumanDescriptionAvatarSource: {instanceID: 0}
-  animationType: 1
+  animationType: 2
+  humanoidOversampling: 1
   additionalBone: 0
   userData: 
   assetBundleName: 

BIN
Assets/Models/Battle/Maps/Materials/map.mat


BIN
Assets/Models/Battle/Utils/SkyboxProcedural.mat


+ 8 - 0
Assets/Models/Battle/Utils/SkyboxProcedural.mat.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: aa737b510a2238a4ea06e17bba9188a5
+timeCreated: 1494322467
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Models/UI/Public/UIDisplay.prefab


+ 1 - 0
Assets/Plugins/UnityPurchasing/Bin/Android/AmazonAppStore.aar.meta

@@ -7,6 +7,7 @@ PluginImporter:
   iconMap: {}
   executionOrder: {}
   isPreloaded: 0
+  isOverridable: 0
   platformData:
     Android:
       enabled: 1

+ 1 - 0
Assets/Plugins/UnityPurchasing/Bin/Android/CloudMoolah.aar.meta

@@ -7,6 +7,7 @@ PluginImporter:
   iconMap: {}
   executionOrder: {}
   isPreloaded: 0
+  isOverridable: 0
   platformData:
     Android:
       enabled: 1

+ 1 - 0
Assets/Plugins/UnityPurchasing/Bin/Android/GoogleAIDL.aar.meta

@@ -7,6 +7,7 @@ PluginImporter:
   iconMap: {}
   executionOrder: {}
   isPreloaded: 0
+  isOverridable: 0
   platformData:
     Android:
       enabled: 1

+ 1 - 0
Assets/Plugins/UnityPurchasing/Bin/Android/GooglePlay.aar.meta

@@ -7,6 +7,7 @@ PluginImporter:
   iconMap: {}
   executionOrder: {}
   isPreloaded: 0
+  isOverridable: 0
   platformData:
     Android:
       enabled: 1

+ 1 - 0
Assets/Plugins/UnityPurchasing/Bin/Android/SamsungApps.aar.meta

@@ -7,6 +7,7 @@ PluginImporter:
   iconMap: {}
   executionOrder: {}
   isPreloaded: 0
+  isOverridable: 0
   platformData:
     Android:
       enabled: 1

+ 1 - 0
Assets/Plugins/UnityPurchasing/Bin/Android/common.aar.meta

@@ -7,6 +7,7 @@ PluginImporter:
   iconMap: {}
   executionOrder: {}
   isPreloaded: 0
+  isOverridable: 0
   platformData:
     Android:
       enabled: 1

+ 1 - 1
Assets/Plugins/UnityPurchasing/ETag

@@ -1 +1 @@
-"8c6b0f4bcf82b278aa4cc1f8d5985c69"
+"26f46597fa31235cfc86335f685056ae"

BIN
Assets/Resources/Prefabs/Buildings/Door.prefab


BIN
Assets/Resources/Prefabs/Buildings/Station.prefab


BIN
Assets/Resources/Prefabs/CraftsNew/Assassin.prefab


BIN
Assets/Resources/Prefabs/CraftsNew/CraftAgent.prefab


+ 8 - 0
Assets/Resources/Prefabs/CraftsNew/CraftAgent.prefab.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e018d46f1a09b4445823b940007ea51f
+timeCreated: 1494304713
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Resources/Prefabs/CraftsNew/Dasher.prefab


BIN
Assets/Resources/Prefabs/CraftsNew/Flame.prefab


BIN
Assets/Resources/Prefabs/CraftsNew/Hunter.prefab


BIN
Assets/Resources/Prefabs/CraftsNew/Ice.prefab


BIN
Assets/Resources/Prefabs/CraftsNew/Medic.prefab


BIN
Assets/Resources/Prefabs/CraftsNew/Spider.prefab


BIN
Assets/Resources/Prefabs/CraftsNew/Thunder.prefab


BIN
Assets/Resources/Prefabs/CraftsNew/TinySpider.prefab


+ 9 - 0
Assets/ScenesNew.meta

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

+ 9 - 0
Assets/ScenesNew/Base.meta

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

BIN
Assets/ScenesNew/Base.unity


+ 8 - 0
Assets/ScenesNew/Base.unity.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 3cc5d8cf5be7b394d89ed91fde20cde7
+timeCreated: 1494296040
+licenseType: Pro
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/ScenesNew/Base/LightingData.asset


+ 8 - 0
Assets/ScenesNew/Base/LightingData.asset.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c5fbe7827d4169647a801ec8be07861d
+timeCreated: 1494322791
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/ScenesNew/Base/Lightmap-0_comp_dir.png


+ 68 - 0
Assets/ScenesNew/Base/Lightmap-0_comp_dir.png.meta

@@ -0,0 +1,68 @@
+fileFormatVersion: 2
+guid: 284a00f120507314d88d5d544fcbd082
+timeCreated: 1494322753
+licenseType: Pro
+TextureImporter:
+  fileIDToRecycleName: {}
+  serializedVersion: 4
+  mipmaps:
+    mipMapMode: 0
+    enableMipMap: 1
+    sRGBTexture: 0
+    linearTexture: 0
+    fadeOut: 0
+    borderMipMap: 0
+    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:
+    filterMode: 1
+    aniso: 3
+    mipBias: 0
+    wrapMode: 1
+  nPOTScale: 1
+  lightmap: 0
+  compressionQuality: 50
+  spriteMode: 0
+  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: 0
+  spriteTessellationDetail: -1
+  textureType: 0
+  textureShape: 1
+  maxTextureSizeSet: 0
+  compressionQualitySet: 0
+  textureFormatSet: 0
+  platformSettings:
+  - buildTarget: DefaultTexturePlatform
+    maxTextureSize: 2048
+    textureFormat: -1
+    textureCompression: 0
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+  spriteSheet:
+    serializedVersion: 2
+    sprites: []
+    outline: []
+  spritePackingTag: 
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/ScenesNew/Base/Lightmap-0_comp_light.exr


+ 68 - 0
Assets/ScenesNew/Base/Lightmap-0_comp_light.exr.meta

@@ -0,0 +1,68 @@
+fileFormatVersion: 2
+guid: e66f723ca1782bb428288896f414a62e
+timeCreated: 1494322753
+licenseType: Pro
+TextureImporter:
+  fileIDToRecycleName: {}
+  serializedVersion: 4
+  mipmaps:
+    mipMapMode: 0
+    enableMipMap: 1
+    sRGBTexture: 1
+    linearTexture: 0
+    fadeOut: 0
+    borderMipMap: 0
+    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:
+    filterMode: 1
+    aniso: 3
+    mipBias: 0
+    wrapMode: 1
+  nPOTScale: 1
+  lightmap: 0
+  compressionQuality: 50
+  spriteMode: 0
+  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: 0
+  alphaIsTransparency: 0
+  spriteTessellationDetail: -1
+  textureType: 6
+  textureShape: 1
+  maxTextureSizeSet: 0
+  compressionQualitySet: 0
+  textureFormatSet: 0
+  platformSettings:
+  - buildTarget: DefaultTexturePlatform
+    maxTextureSize: 2048
+    textureFormat: -1
+    textureCompression: 0
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+  spriteSheet:
+    serializedVersion: 2
+    sprites: []
+    outline: []
+  spritePackingTag: 
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/ScenesNew/Base/NavMesh.asset


+ 8 - 0
Assets/ScenesNew/Base/NavMesh.asset.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 99f4a60ac25058f428d2f1764af4845a
+timeCreated: 1494303487
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/ScenesNew/Base/ReflectionProbe-0.exr


+ 69 - 0
Assets/ScenesNew/Base/ReflectionProbe-0.exr.meta

@@ -0,0 +1,69 @@
+fileFormatVersion: 2
+guid: b369976f54e0e144b87349a20fe1dd19
+timeCreated: 1494322790
+licenseType: Pro
+TextureImporter:
+  fileIDToRecycleName:
+    8900000: generatedCubemap
+  serializedVersion: 4
+  mipmaps:
+    mipMapMode: 0
+    enableMipMap: 1
+    sRGBTexture: 1
+    linearTexture: 0
+    fadeOut: 0
+    borderMipMap: 0
+    mipMapFadeDistanceStart: 1
+    mipMapFadeDistanceEnd: 3
+  bumpmap:
+    convertToNormalMap: 0
+    externalNormalMap: 0
+    heightScale: 0.25
+    normalMapFilter: 0
+  isReadable: 0
+  grayScaleToAlpha: 0
+  generateCubemap: 6
+  cubemapConvolution: 1
+  seamlessCubemap: 1
+  textureFormat: 1
+  maxTextureSize: 2048
+  textureSettings:
+    filterMode: 2
+    aniso: 0
+    mipBias: 0
+    wrapMode: 1
+  nPOTScale: 1
+  lightmap: 0
+  compressionQuality: 50
+  spriteMode: 0
+  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: 0
+  spriteTessellationDetail: -1
+  textureType: 0
+  textureShape: 2
+  maxTextureSizeSet: 0
+  compressionQualitySet: 0
+  textureFormatSet: 0
+  platformSettings:
+  - buildTarget: DefaultTexturePlatform
+    maxTextureSize: 2048
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 100
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+  spriteSheet:
+    serializedVersion: 2
+    sprites: []
+    outline: []
+  spritePackingTag: 
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 61 - 166
Assets/Scripts/Battle/InputController.cs

@@ -32,7 +32,7 @@ public class InputController : MonoBehaviour {
 	public CameraMode cameraMode;
 
 	private BattleController battleController;
-	private GameObject ground;
+	private Plane groundPlane;
 
 	private Vector3 lastMousePosition;
 
@@ -40,19 +40,24 @@ public class InputController : MonoBehaviour {
 
 	public bool lockCamera = true;
 
-	private float distance = FAR_AWAY_SIZE;
 	private float targetDistance = FAR_AWAY_SIZE;
-	private float targetAngle = MAX_ANGLE;
 
 	public ITarget cameraLockedTarget;
-	private Vector3 lookAtPos;
 
+	public Transform cameraPivot;
 	public CameraShake cameraShake;
-	
+	public Transform cameraTrans;
+
+	private float cameraSpeed = 2f;
+
 	void Start () 
 	{
-		ground = GameObject.FindObjectOfType<GroundPlane>().gameObject;
+		groundPlane = new Plane(new Vector3(0, 1f, 0), Vector3.zero);
+		cameraPivot = GameObject.Find ("CameraPivot").transform;
 		cameraShake = Camera.main.GetComponent<CameraShake>();
+		cameraTrans = cameraShake.transform;
+
+		UpdateCamera ();
 	}
 
 	private bool IsPointerOverUIObject()
@@ -62,6 +67,8 @@ public class InputController : MonoBehaviour {
 		
 		List<RaycastResult> results = new List<RaycastResult>();
 		EventSystem.current.RaycastAll(eventDataCurrentPosition, results);
+
+		Debuger.LogWarning (results.Count);
 		return results.Count > 0;
 	}
 
@@ -73,110 +80,16 @@ public class InputController : MonoBehaviour {
 	public Vector3 cameraPosition
 	{
 		get{
-			return lookAtPos;
-		}
-	}
-
-//	private void findCameraLockTarget()
-//	{
-//		if(battleController.ctrlCraft == null)
-//		{
-//			if(battleController.GetMyPlayer() == null || battleController.isGameOver || battleController.GetMyPlayer().CanRelive())
-//			{
-//				return;
-//			}
-//
-//			bool findTarget = false;
-//			ITarget firstTarget = null;
-//			List<BattleObject> list = battleController.GetMap().GetBattleObjectByRange(new Vector3(), float.MaxValue, battleController.GetMyPlayer().team);
-//			list.Sort(CompareCraftId);
-//
-//			for(int i=0; i<list.Count; i++)
-//			{
-//				BattleObject bo = list[i];
-//				if(firstTarget == null)
-//				{
-//					firstTarget = bo;
-//				}
-//
-//				if(cameraLockedTarget != null && cameraLockedTarget is BattleObject)
-//				{
-//					BattleObject lockedObj = cameraLockedTarget as BattleObject;
-//					if(bo.id > lockedObj.id)
-//					{
-//						findTarget = true;
-//						cameraLockedTarget = bo;
-//						break;
-//					}
-//				}
-//			}
-//
-//			if(!findTarget)
-//			{
-//				cameraLockedTarget = firstTarget;
-//			}
-//		}
-//		else
-//		{
-//			cameraLockedTarget = battleController.ctrlCraft;
-//		}
-//	}
-
-
-	public static int CompareCraftId(BattleObject a, BattleObject b)
-	{
-		if (a == null)
-		{
-			if (b == null)
-			{
-				return 0;
-			}
-			else
-			{
-				return -1;
-			}
-		}
-		else
-		{
-			if (b == null)
-			{
-				return 1;
-			}
-			else
-			{
-				if(a.id > b.id)
-				{
-					return 1;
-				}
-				else if(a.id < b.id)
-				{
-					return -1;
-				}
-				else
-				{
-					return 0;
-				}
-			}
+			return cameraPivot.position;
 		}
 	}
 
-
 	public void SetCameraTo(Vector3 pos)
 	{
-		lookAtPos = pos;
-		Vector3 cameraPosition = Camera.main.transform.position;
-		Vector3 cameraRotation = Camera.main.transform.eulerAngles;
-		
-		float theta = NumberUtil.angleToRadian (cameraRotation.x);
-		
-		pos.y += distance * Mathf.Sin(theta);
-		pos.z -= distance * Mathf.Cos(theta);
-
-		Camera.main.transform.position = pos;
+		cameraPivot.position = pos;
 	}
 
-
-	private void updateCamera ()
+	private void UpdateCameraPivot ()
 	{
 		if (cameraMode != CameraMode.LockCraft)
 			return;
@@ -194,40 +107,11 @@ public class InputController : MonoBehaviour {
 						state = State.Battle;
 						battleController.ReadyToAction();
 					}
-				}
-
-				Camera camera = battleController.gameCamera;
-
-				Vector3 cameraPosition = camera.transform.position;
-				Vector3 ctrlCraftPosition = cameraLockedTarget.position;
-				lookAtPos = ctrlCraftPosition;
-
-				distance = targetDistance;
 
-				targetAngle = MIN_ANGLE + (MAX_ANGLE - MIN_ANGLE) * (targetDistance - MIN_SIZE) / (MAX_SIZE - MIN_SIZE);
-				targetAngle = NumberUtil.forceBetween(targetAngle, MIN_ANGLE, MAX_ANGLE);
-				Quaternion cameraRotation = Quaternion.Euler(targetAngle, 0f, 0f); ;
-
-				float theta = NumberUtil.angleToRadian (targetAngle);
-
-//				distance += (targetDistance - distance)*5f*GameTime.deltaTime;
-				ctrlCraftPosition.y += distance * Mathf.Sin(theta);
-				ctrlCraftPosition.z -= distance * Mathf.Cos(theta);
-
-				if (battleController.GetCtrlCraft () != null) {
-					cameraPosition.x += (ctrlCraftPosition.x - cameraPosition.x) * 5f * GameTime.deltaTime + cameraShake.offsetX;
-					cameraPosition.z += (ctrlCraftPosition.z - cameraPosition.z) * 5f * GameTime.deltaTime + cameraShake.offsetZ;
-					//				cameraPosition.y += (ctrlCraftPosition.y-cameraPosition.y)*5f*GameTime.deltaTime;
-				} else {
-					cameraPosition.x = ctrlCraftPosition.x + cameraShake.offsetX;
-					cameraPosition.z = ctrlCraftPosition.z + cameraShake.offsetZ;
+					UpdateCamera ();
 				}
 
-				cameraPosition.y = ctrlCraftPosition.y;
-
-				camera.transform.position = Vector3.Lerp(cameraPosition, camera.transform.position, GameTime.deltaTime * 5f);
-				//camera.transform.localRotation = Quaternion.Slerp(camera.transform.localRotation, cameraRotation, GameTime.deltaTime * 100f); 
-				camera.transform.localRotation = cameraRotation; 
+				cameraPivot.transform.position = Vector3.Lerp (cameraPivot.transform.position, cameraLockedTarget.position, GameTime.deltaTime * cameraSpeed);
 			}
 		}
 		else
@@ -257,9 +141,17 @@ public class InputController : MonoBehaviour {
 	}
 
 
+	private void UpdateCamera()
+	{
+		Vector3 camPos = cameraTrans.localPosition;
+		camPos.z = -targetDistance;
+		cameraTrans.localPosition = camPos;
+	}
+
+
 	void LateUpdate()
 	{
-		updateCamera ();
+		UpdateCameraPivot ();
 	}
 
 	// Update is called once per frame
@@ -336,46 +228,43 @@ public class InputController : MonoBehaviour {
 	{
 		Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
 		RaycastHit hitInfo;
-		
-		if(Physics.Raycast(ray, out hitInfo))
-		{
-			if(hitInfo.collider.gameObject.Equals(ground))
-			{
-				int hitCol = (int)(hitInfo.point.x/Map.TILE_WIDTH);
-				int hitRow = (int)(hitInfo.point.z/Map.TILE_LENGTH);
-				
+		if (Physics.Raycast (ray, out hitInfo)) {
+
+			Debuger.LogWarning ("Physics.Raycast " + hitInfo.collider.gameObject.tag);
+
+			if (hitInfo.collider.gameObject.tag == "Craft" || hitInfo.collider.gameObject.tag == "Tower") {
+				Craft craft = hitInfo.collider.GetComponent<Craft> ();
+				if (craft == null) {
+					Debuger.LogError ("craft is null");
+					return;
+				}
+
+				if (craft.team != battleController.GetCtrlCraft ().team) {
+					battleController.GetCtrlCraft ().target = craft;
+					battleController.GetCtrlCraft ().GetComponent<CraftAI> ().followTarget = true;
+				}
+			}
+		} else {
+			float rayDistance;
+			if (groundPlane.Raycast (ray, out rayDistance)) {
+
+				Vector3 hitPos = ray.GetPoint (rayDistance);
+				int hitCol = (int)(hitPos.x/Map.TILE_WIDTH);
+				int hitRow = (int)(hitPos.z/Map.TILE_LENGTH);
+
+				Debuger.LogWarning ("groundPlane.Raycast " + hitPos);
+
 				Map map = battleController.GetMap();
 				hitCol = NumberUtil.forceBetween(hitCol, 0, map.columns-1);
 				hitRow = NumberUtil.forceBetween(hitRow, 0, map.rows-1);
-				
+
 				GameObject moveMark = Instantiate(moveMarkPrefab) as GameObject;
-				Vector3 moveMarkPosition = new Vector3(hitInfo.point.x, 0.01f, hitInfo.point.z);
+				Vector3 moveMarkPosition = new Vector3(hitPos.x, 0.01f, hitPos.z);
 				moveMark.transform.position = moveMarkPosition;
 
 				battleController.GetCtrlCraft().GetComponent<CraftAI>().followTarget = false;
 				battleController.GetCtrlCraft().forceMove = true;
 				battleController.GetMessageManager().Move(battleController.GetCtrlCraft(), hitCol, hitRow);
-
-//				if(battleController.ctrlCraft.target == null)
-//				{
-//					float theta = NumberUtil.getRadianByATan(moveMarkPosition.x, moveMarkPosition.z, battleController.ctrlCraft.position.x, battleController.ctrlCraft.position.z);
-//					float rotateAngle = 90-NumberUtil.radianToAngle(theta);
-//					battleController.ctrlCraft.setRotateTargetAngle(rotateAngle);
-//				}
-			}
-			else
-			{
-				Craft craft = hitInfo.collider.GetComponent<Craft>();
-				if(craft == null)
-				{
-					Debuger.LogError("craft is null");
-					return;
-				}
-
-				if (craft.team != battleController.GetCtrlCraft().team) {
-					battleController.GetCtrlCraft().target = craft;
-					battleController.GetCtrlCraft().GetComponent<CraftAI> ().followTarget = true;
-				}
 			}
 		}
 	}
@@ -421,6 +310,12 @@ public class InputController : MonoBehaviour {
 		{
 			targetDistance += value*10f;
 			targetDistance = NumberUtil.forceBetween(targetDistance, MIN_SIZE, MAX_SIZE);
+
+			UpdateCamera ();
+
+			Vector3 rotation = Vector3.zero;
+			rotation.x = MIN_ANGLE + (MAX_ANGLE - MIN_ANGLE) * ((targetDistance - MIN_SIZE) / (MAX_SIZE - MIN_SIZE));
+			cameraPivot.transform.localEulerAngles = rotation;
 		}
 	}
 	

+ 1 - 1
Assets/Scripts/Battle/Map/AI/NormalAI.cs

@@ -172,7 +172,7 @@ public class NormalAI : CraftAI
 		{
 			if(battleObjList[i].id > owner.id)
 			{
-				float angle = owner.rotateTargetAngle + Random.Range(0, 2) > 0 ? 90f : -90f;
+				float angle = Random.Range(0, 2) > 0 ? 90f : -90f;
 				float radian = NumberUtil.angleToRadian(angle);
 				float x = 1.5f * Mathf.Cos(radian);
 				float z = 1.5f * Mathf.Sin(radian);

+ 3 - 3
Assets/Scripts/Battle/Map/AI/ShowAI.cs

@@ -145,9 +145,9 @@ public class ShowAI : CraftAI
 					owner.MoveTo ((int)origin.x, (int)origin.y);
 				} else if (Random.Range (0, 100) > 50) {
 
-					float angle = owner.rotateMoveTargetAngle + (Random.Range(0, 100) > 50 ? 1 : -1) * Random.Range (45f, 90f);
-					angle = NumberUtil.corverAngleBetween (angle, -180, 180f);
-					owner.Rotate (angle);
+//					float angle = owner.rotateMoveTargetAngle + (Random.Range(0, 100) > 50 ? 1 : -1) * Random.Range (45f, 90f);
+//					angle = NumberUtil.corverAngleBetween (angle, -180, 180f);
+//					owner.Rotate (angle);
 				}
 			}
 		}

+ 1 - 4
Assets/Scripts/Battle/Map/AI/SoldierAI.cs

@@ -61,10 +61,7 @@ public class SoldierAI : NormalAI
 			}
 			else if(owner.isMoving)
 			{
-				if(!owner.rotateTargetAngle.Equals(owner.rotateMoveTargetAngle))
-				{
-					owner.setRotateTargetAngle(owner.rotateMoveTargetAngle);
-				}
+				
 			}
 		}
 	}

+ 3 - 0
Assets/Scripts/Battle/Map/BattleObject.cs

@@ -77,6 +77,9 @@ public class BattleObject : MapObject, IBattleObject , ITarget
 			material = null;
 	}
 
+	public virtual void EnterFrame(){}
+
+
 	public int userId
 	{
 		get{

+ 68 - 388
Assets/Scripts/Battle/Map/Craft/Craft.cs

@@ -1,4 +1,5 @@
 using UnityEngine;
+using UnityEngine.AI;
 using System.Collections;
 using System.Collections.Generic;
 using Sfs2X.Entities.Data;
@@ -23,37 +24,20 @@ public class Craft : BattleObject, IPowerOwner
 
 	public string nick;
 
-	private LinkedList<AStarNode> path;
-	private Vector3 nextMovePosition;
-	private bool _isMoving;
+	private bool m_Moving;
 	public override bool isMoving
 	{
-		get{return _isMoving;}
+		get{return m_Moving;}
 	}
-	public AStarPoint targetMovePosition = new AStarPoint();
 
 	public bool forceMove;
 
-	private float rotateSpeed = 200f;
-	public float rotateTargetAngle;
-	private bool _isTargetRotating;
-
-	public float rotateMoveTargetAngle;
-	private bool _isMoveRotating;
-
-	public Transform bodyTrans;
-	public Transform topPartTrans;
-	public Transform bottomPartTrans;
-
-	private Animation animationTop;
-	private Animation animationBottom;
-	
-	public Material materialTop;
-	public Material materialBottom;
+	private NavMeshAgent meshAgent;
+	public Vector3 moveDestination = Vector3.zero;
 
 	private PowerManager powerManager;
 	private SwapManager swapManager;
-	private ShotManager shotManager;
+	private CraftModel craftModel;
 
 	public State state;
 	private CraftData craftData;
@@ -69,10 +53,10 @@ public class Craft : BattleObject, IPowerOwner
 	public event EventUtil.SimpleEventDelegate OnSwapped;
 	public event EventUtil.SimpleEventDelegate OnCtrlChanged;
 
-
 	void Awake()
 	{
 		swapManager = new SwapManager(this);
+		meshAgent = GetComponent<NavMeshAgent> ();
 	}
 
 	public virtual void Init(Map map, CraftData craftData, CraftEquipModify equipModify)
@@ -98,26 +82,6 @@ public class Craft : BattleObject, IPowerOwner
 	{
 		_originMaxHp = maxHp = craftData.GetMaxHp() + equipModify.hp;
 
-		bodyTrans = transform.Find("Body");
-		
-		topPartTrans = bodyTrans.Find("Top");
-		if(topPartTrans != null)
-		{
-			animationTop = topPartTrans.GetComponent<Animation>();
-			materialTop = topPartTrans.GetComponentInChildren<Renderer>().material;
-			material = materialTop;
-		}
-		
-		bottomPartTrans = bodyTrans.Find("Bottom");
-		if(bottomPartTrans != null)
-		{
-			animationBottom = bottomPartTrans.GetComponent<Animation>();
-			materialBottom = bottomPartTrans.GetComponentInChildren<Renderer>().material;
-		}
-
-		if(topPartTrans == null)
-			animation = bodyTrans.GetComponentInChildren<Animation>();
-
 		if(craftData != null)
 		{
 			if(powerManager == null)
@@ -126,11 +90,8 @@ public class Craft : BattleObject, IPowerOwner
 				powerManager.UpdatePower(craftData.GetAttackId(), craftData.GetPowerIds());
 			team = craftData.team;
 		}
-
-		shotManager = GetComponentInChildren<ShotManager>();
 		
 		SetState (State.Idle);
-
 		Debuger.LogError (this.name+" maxhp "+maxHp+" damage "+GetDamage()+" mov "+moveSpeed);
 	}
 
@@ -162,27 +123,7 @@ public class Craft : BattleObject, IPowerOwner
 			if(textureArr.Length > 0)
 			{
 				int index = value.GetHashCode() - 1;
-				if(topPartTrans == null)
-				{
-					SkinnedMeshRenderer[] renderers = bodyTrans.GetComponentsInChildren<SkinnedMeshRenderer>();
-					for(int i=0; i<renderers.Length; i++)
-					{
-						renderers[i].material.mainTexture = textureArr[index];
-					}
-				}
-				else
-				{
-					SkinnedMeshRenderer[] renderers = topPartTrans.GetComponentsInChildren<SkinnedMeshRenderer>();
-					for(int i=0; i<renderers.Length; i++)
-					{
-						renderers[i].material.mainTexture = textureArr[index];
-					}
-					renderers = bottomPartTrans.GetComponentsInChildren<SkinnedMeshRenderer>();
-					for(int i=0; i<renderers.Length; i++)
-					{
-						renderers[i].material.mainTexture = textureArr[index];
-					}
-				}
+				craftModel.SetSkin(textureArr[index]);
 			}
 		}
 	}
@@ -194,7 +135,26 @@ public class Craft : BattleObject, IPowerOwner
 
 	public ShotManager GetShotManager()
 	{
-		return shotManager;
+		return craftModel.shotManager;
+	}
+
+
+	public CraftModel GetCraftModel()
+	{
+		return craftModel;
+	}
+
+	public void SetCraftModel(CraftModel craftModel)
+	{
+		if (this.craftModel != null) {
+			Destroy (this.craftModel.gameObject);
+		}
+
+		this.craftModel = craftModel;
+		this.craftModel.transform.SetParent (this.transform);
+		this.craftModel.transform.localEulerAngles = Vector3.zero;
+		this.craftModel.transform.localPosition = Vector3.zero;
+		this.craftModel.transform.localScale = Vector3.one;
 	}
 
 
@@ -259,13 +219,7 @@ public class Craft : BattleObject, IPowerOwner
 	{
 		this.skinId = id;
 		if(texture != null)
-		{
-			SkinnedMeshRenderer[] rendererArr = bodyTrans.GetComponentsInChildren<SkinnedMeshRenderer>();
-			for(int i=0; i<rendererArr.Length; i++)
-			{
-				rendererArr[i].material.mainTexture = texture;
-			}
-		}
+			craftModel.SetSkin (texture);
 	}
 
 	public int GetSkin()
@@ -297,79 +251,18 @@ public class Craft : BattleObject, IPowerOwner
 
 	public override Transform GetBaseTransform()
 	{
-		if(topPartTrans != null)
-			return topPartTrans;
+		if(craftModel.topAnim != null)
+			return craftModel.topAnim.transform;
 		return transform;
 	}
 
 	public void SetState(State state)
 	{
-		if(this.state != state)
-		{
-			this.state = state;
-			string animName = state.ToString();
-			if(animation != null)
-			{
-				if(animation.GetClip(animName) != null)
-					animation.Play(animName);
-			}
-
-			if(animationTop == null)
-				return;
-
-			if(state == State.Idle)
-			{
-				if(animationTop.GetClip(animName) != null)
-				{
-					animationTop.Play(animName);
-					animationBottom.Play(animName);
-				}
-			}
-			else if(state == State.Run)
-			{
-				if(animationTop.GetClip(animName) != null)
-				{
-					animationTop.Play(animName);
-					animationBottom.Play(animName);
-				}
-			}
-			else if(state == State.Attack)
-			{
-				if(animationTop.GetClip(animName) != null)
-					animationTop.Play(animName);
-				if(isMoving)
-				{
-					if(animationBottom.GetClip(State.Run.ToString()) != null)
-						animationBottom.Play(State.Run.ToString());
-				}
-				else
-				{
-					if(animationBottom.GetClip(State.Idle.ToString()) != null)
-						animationBottom.Play(State.Idle.ToString());
-				}
-			}
-		}
+		this.state = state;
+		if (state == State.Attack)
+			craftModel.Attack ();
 	}
 
-	public bool IsPlayingState(State state, Part part = Part.All)
-	{
-		string animName = state.ToString();
-		if(animation != null)
-		{
-			return animation.IsPlaying(animName);
-		}
-
-		if(animationTop != null && (part == Part.Top || part == Part.All))
-		{
-			return animationTop.IsPlaying(animName);
-		}
-
-		if(animationBottom != null && (part == Part.Bottom || part == Part.All))
-		{
-			return animationBottom.IsPlaying(animName);
-		}
-		return false;
-	}
 
 	public void PositionTo(Vector3 position)
 	{
@@ -404,7 +297,7 @@ public class Craft : BattleObject, IPowerOwner
 		if(!enableMove || holdAction)
 			return;
 
-		StartMove(col, row);
+		StartMove(Map.GetCenterX(col), Map.GetCenterZ(row));
 	}
 
 	public void MoveTo(float x, float y)
@@ -414,43 +307,18 @@ public class Craft : BattleObject, IPowerOwner
 		MoveTo(col, row);
 	}
 
-	protected void StartMove(int col, int row)
+	protected void StartMove(float x, float y)
 	{
-		targetMovePosition.x = col;
-		targetMovePosition.y = row;
-		
-		Vector3 position = transform.position;
-		int startCol = (int)(position.x/Map.TILE_WIDTH);
-		int startRow = (int)(position.z/Map.TILE_LENGTH);
-		
-		map.PathSearchEnqueue(new AStarPoint(startCol, startRow), new AStarPoint(col, row), this);
+		moveDestination.Set (x, 0, y);
+		SetIsMoving(true);
+		OnMove();
+		swapManager.AbortSwap();
 	}
 
-	public void SetPath(LinkedList<AStarNode> path)
+	private void SetIsMoving(bool value)
 	{
-		//long startTime = System.DateTime.Now.ToFileTime();
-		//path = map.GetPath(new AStarPoint(startCol, startRow), new AStarPoint(col, row), this);
-		//long endTime = System.DateTime.Now.ToFileTime();
-		//Debuger.Log("search path spend time : "+(endTime-startTime));
-
-		this.path = path;
-		if(!IsDead() && path != null)
-		{
-			path.RemoveFirst();
-
-			_isMoving = true;
-
-			if(state == State.Idle)
-				SetState(State.Run);
-
-			if(_teleportStep > 0)
-				Teleport(_teleportStep);
-			else
-				setNextMovePosition();
-
-			OnMove();
-			swapManager.AbortSwap();
-		}
+		m_Moving = value;
+		craftModel.moving = value;
 	}
 
 	public void StopMove()
@@ -463,9 +331,7 @@ public class Craft : BattleObject, IPowerOwner
 				{
 					if(buffList[i].hasCloseTarget)
 					{
-						int col = Map.XToColumn(target.position.x);
-						int row = Map.ZToRow(target.position.z);
-						StartMove(col, row);
+						StartMove(target.position.x, target.position.z);
 						break;
 					}
 				}
@@ -473,16 +339,13 @@ public class Craft : BattleObject, IPowerOwner
 			return;
 		}
 
-		path = null;
-		_isMoving = false;
+		SetIsMoving (false);
 		forceMove = false;
-
-		if(state == State.Run)
-			SetState(State.Idle);
 	}
 
 	// Update is called once per frame
-	void Update () {
+//	public override void EnterFrame ()
+	void FixedUpdate () {
 
 		if(IsDead())
 		{
@@ -494,42 +357,20 @@ public class Craft : BattleObject, IPowerOwner
 			return;
 		}
 
-		if(_isMoving)
+		if(isMoving)
 		{
 			moving();
 		}
 
-		if(target != null && target.CanShoot())
-		{
-			Vector3 targetPosition = target.position;
-			float theta = NumberUtil.getRadianByATan(targetPosition.x, targetPosition.z, position.x, position.z);
-			float rotateAngle = 90-NumberUtil.radianToAngle(theta);
-			if(!rotateTargetAngle.Equals(rotateAngle))
-			{
-				rotateTargetAngle = rotateAngle;
-				_isTargetRotating = true;
-			}
+		if (target != null && target.CanShoot ()) {
+			craftModel.LookTo (target.position);
+		} else if(craftModel != null){
+			craftModel.LookToForward ();
 		}
 
-
-		rotating();
 		CheckHpRecover();
 		DealBuff();
 
-
-		if((state == State.Attack || state == State.Power) && !IsPlayingState(state, Part.Top))
-		{
-			if(isMoving)
-			{
-				SetState(State.Run);
-			}
-			else
-			{
-				SetState(State.Idle);
-			}
-		}
-
-
 		if(swapManager.isPreparingSwap && !swapManager.requestedSwap)
 		{
 			headBar.SetSpellProgress(swapManager.GetPreparingSwapTime(), SwapManager.PREPARING_SWAP_DURATION);
@@ -538,189 +379,28 @@ public class Craft : BattleObject, IPowerOwner
 
 	private void moving()
 	{
-		float timeLeft = updateMovePosition(GameTime.deltaTime);
-		if(_isMoving && timeLeft > 0)
-		{
-			updateMovePosition(timeLeft);
-		}
-	}
-
-	private float updateMovePosition(float deltaTime)
-	{
-		Vector3 position = transform.position;
-		
-		float deltaX = nextMovePosition.x-position.x;
-		float deltaY = nextMovePosition.z-position.z;
-		float theta = Mathf.Atan2(deltaY, deltaX);
-		
-		float distance = Mathf.Sqrt(deltaX*deltaX+deltaY*deltaY);
-		float moveDistance = moveSpeed*deltaTime;
-		
-		float timeLeft = 0;
-		if(moveDistance >= distance)
-		{
-			timeLeft = deltaTime*(1f-distance/moveDistance);
-			DealMoveStepComplete();
-			setNextMovePosition();
-		}
-		else
-		{
-			float movX = moveDistance*Mathf.Cos(theta);
-			float movZ = moveDistance*Mathf.Sin(theta);
-
-			position.x += movX;
-			position.z += movZ;
-			transform.position = position;
-		}
-
-		return timeLeft;
-	}
-
-	private void DealMoveStepComplete()
-	{
-		Vector3 position = transform.position;
-		position.x = nextMovePosition.x;
-		position.z = nextMovePosition.z;
-		transform.position = position;
-		if(MoveStepComplete != null)
-			MoveStepComplete();
-	}
-
-	private void setNextMovePosition()
-	{
-		if(path != null)
-		{
-			if(path.Count > 0)
-			{
-				AStarNode astarNode = path.First.Value;
-				path.RemoveFirst();
-
-				nextMovePosition = AstarNodeToPosition(astarNode);
-
-				Vector3 position = transform.position;
-				
-				float theta = NumberUtil.getRadianByATan(nextMovePosition.x, nextMovePosition.z, position.x, position.z);
-				float rotateAngle = 90-NumberUtil.radianToAngle(theta);
-				Rotate (rotateAngle);
-			}
-			else
-			{
-				StopMove();
-			}
-
+		meshAgent.SetDestination (moveDestination);
+		if (meshAgent.remainingDistance > 0) {
 			if(miniCraft != null)
 				miniCraft.UpdatePos();
+		} else {
+			if (MoveStepComplete != null)
+				MoveStepComplete ();
+			StopMove ();
 		}
 	}
 
 
-	public void Rotate(float rotateAngle)
-	{
-		rotateMoveTargetAngle = rotateAngle;
-		_isMoveRotating = true;
-
-		if(target == null)
-		{
-			if(!rotateTargetAngle.Equals(rotateMoveTargetAngle))
-			{
-				rotateTargetAngle = rotateMoveTargetAngle;
-				_isTargetRotating = true;
-			}
-		}
-	}
-
-
-	private Vector3 AstarNodeToPosition(AStarNode astarNode)
-	{
-		return new Vector3((astarNode.X+0.5f)*Map.TILE_WIDTH, 0, (astarNode.Y+0.5f)*Map.TILE_LENGTH);
-	}
-	
 
-	public void setRotateTargetAngle(float value)
+	public void SetRotateTargetAngle(float angle)
 	{
-		rotateTargetAngle = value;
-		_isTargetRotating = true;
-	}
-
-	private void rotating()
-	{
-		if(!enableMove || swapManager.isPreparingSwap)
-			return;
-
-		if(bottomPartTrans == null)
-		{
-			if(_isMoveRotating || _isTargetRotating)
-			{
-				float targetRotation = 0;
-				if(_isMoving)
-				{
-					targetRotation = rotateMoveTargetAngle;
-				}
-				else
-				{
-					targetRotation = rotateTargetAngle;
-				}
-
-				Vector3 eulerAngles = bodyTrans.eulerAngles;
-				float currentRotation = eulerAngles.y;
-				float rotateStep = rotateSpeed*GameTime.deltaTime;
-				
-				currentRotation = NumberUtil.getCloseToTargetAngle(currentRotation, targetRotation, rotateStep);
-				eulerAngles.y = currentRotation;
-				bodyTrans.eulerAngles = eulerAngles;
-
-				if(_isMoving)
-				{
-					if(rotateMoveTargetAngle.Equals(currentRotation))
-					{
-						_isMoveRotating = false;
-					}
-				}
-				else
-				{
-					if(rotateTargetAngle.Equals(currentRotation))
-					{
-						_isTargetRotating = false;
-					}
-				}
-			}
-		}
-		else
-		{
-			Vector3 eulerAngles;
-			float rotateStep = rotateSpeed*GameTime.deltaTime;
-
-			if(_isTargetRotating)
-			{
-				eulerAngles = topPartTrans.localEulerAngles;
-				float currentRotation = eulerAngles.y;
-				
-				currentRotation = NumberUtil.getCloseToTargetAngle(currentRotation, rotateTargetAngle, rotateStep);
-				eulerAngles.y = currentRotation;
-				topPartTrans.localEulerAngles = eulerAngles;
-				if(shotManager != null)
-					shotManager.transform.localEulerAngles = eulerAngles;
-				if(rotateTargetAngle.Equals(currentRotation))
-				{
-					_isTargetRotating = false;
-				}
-			}
-
-			if(_isMoveRotating)
-			{
-				eulerAngles = bottomPartTrans.localEulerAngles;
-				float currentBottomRotation = eulerAngles.y;
-				
-				currentBottomRotation = NumberUtil.getCloseToTargetAngle(currentBottomRotation, rotateMoveTargetAngle, rotateStep);
-
-				eulerAngles.y = currentBottomRotation;
-				bottomPartTrans.localEulerAngles = eulerAngles;
-				if(rotateMoveTargetAngle.Equals(currentBottomRotation))
-				{
-					_isMoveRotating = false;
-				}
-			}
-		}
+		Vector3 targetPos = transform.position;
+		float radian = angle * Mathf.Deg2Rad;
+		float x = Mathf.Cos (radian);
+		float y = Mathf.Sin (radian);
+		targetPos.x += x;
+		targetPos.z += y;
+		craftModel.LookAt (targetPos);
 	}
 
 
@@ -739,14 +419,14 @@ public class Craft : BattleObject, IPowerOwner
 
 		for(int i=0; i<step; i++)
 		{
-			setNextMovePosition();
+//			setNextMovePosition();
 			if(!isMoving)
 			{
 				break;
 			}
 		}
 
-		DealMoveStepComplete();
+//		DealMoveStepComplete();
 
 		_teleportStep = 0;
 

+ 11 - 6
Assets/Scripts/Battle/Map/Craft/CraftFactory.cs

@@ -11,9 +11,14 @@ public class CraftFactory
 	public static Craft CreateCraft(CraftData data, CraftEquipModify equipModify, Map map)
 	{
 		string folder = newList.Contains(data.GetModel()) ? Config.CRAFT_NEW_PREFAB_FOLDER : Config.CRAFT_PREFAB_FOLDER;
-		GameObject craftPrefab = Resources.Load<GameObject>(folder+data.GetModel());
+		GameObject craftModelPrefab = Resources.Load<GameObject>(folder+data.GetModel());
+		GameObject craftModelObj = GameObject.Instantiate(craftModelPrefab) as GameObject;
+		CraftModel craftModel = craftModelObj.GetComponent<CraftModel>();
+
+		GameObject craftPrefab = Resources.Load<GameObject>(Config.CRAFT_NEW_PREFAB_FOLDER + "CraftAgent");
 		GameObject craftObj = GameObject.Instantiate(craftPrefab) as GameObject;
-		Craft craft = craftObj.GetComponent<Craft>();
+		Craft craft = craftObj.GetComponent<Craft> ();
+		craft.SetCraftModel (craftModel);
 		craft.Init(map, data, equipModify);
 		craft.typeId = MapObjectUtil.TypeId.Craft.GetHashCode();
 		return craft;
@@ -34,10 +39,10 @@ public class CraftFactory
 	{
 		CraftConfigData data = CraftManager.GetInstance().GetData(id);
 		string folder = newList.Contains(data.model) ? Config.CRAFT_NEW_PREFAB_FOLDER : Config.CRAFT_PREFAB_FOLDER;
-		GameObject craftPrefab = Resources.Load<GameObject>(folder+data.model);
-		GameObject craftObj = GameObject.Instantiate(craftPrefab) as GameObject;
-		Craft newCraft = craftObj.GetComponent<Craft>();
-		craft.GetSwapManager().Swap(newCraft, id, equipModify);
+		GameObject craftModelPrefab = Resources.Load<GameObject>(folder + data.model);
+		GameObject craftModelObj = GameObject.Instantiate(craftModelPrefab) as GameObject;
+		CraftModel craftModel = craftModelObj.GetComponent<CraftModel>();
+		craft.GetSwapManager().Swap(craftModel, id, equipModify);
 	}
 
 //	public static CraftData getTestData(Map map)

+ 63 - 0
Assets/Scripts/Battle/Map/Craft/CraftModel.cs

@@ -0,0 +1,63 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class CraftModel : MonoBehaviour {
+
+	public Animator topAnim;
+	public Animator bottomAnim;
+	public ShotManager shotManager;
+
+	public SkinnedMeshRenderer[] skinArr;
+
+	public bool moving
+	{
+		set{
+			Debuger.Log ("Set Run "+value);
+			if(bottomAnim != null)
+				bottomAnim.SetBool ("Run", value);
+			if(topAnim != null)
+				topAnim.SetBool ("Run", value);
+		}
+	}
+
+	public void Attack()
+	{
+		if(topAnim != null)
+			topAnim.SetTrigger ("Attack");
+	}
+
+	public void LookTo(Vector3 pos)
+	{
+		if (topAnim != null) {
+			Vector3 forward = pos - topAnim.transform.position;
+			Quaternion lookQuaternion = Quaternion.LookRotation (forward);
+			shotManager.transform.rotation = topAnim.transform.rotation = Quaternion.Slerp (topAnim.transform.rotation, lookQuaternion, GameTime.deltaTime * 3f);
+		}
+	}
+
+	public void LookToForward()
+	{
+		if (topAnim != null) {
+			Quaternion lookQuaternion = Quaternion.Euler (Vector3.zero);
+			shotManager.transform.localRotation = topAnim.transform.localRotation = Quaternion.Slerp (topAnim.transform.localRotation, lookQuaternion, GameTime.deltaTime * 3f);
+		}
+	}
+
+	public void LookAt(Vector3 pos)
+	{
+		if (topAnim != null) {
+			Vector3 forward = pos - topAnim.transform.position;
+			Quaternion lookQuaternion = Quaternion.LookRotation (forward);
+			shotManager.transform.rotation = topAnim.transform.rotation = lookQuaternion;
+		}
+	}
+
+	public void SetSkin(Texture texture)
+	{
+		for(int i=0; i<skinArr.Length; i++)
+		{
+			skinArr [i].material.mainTexture = texture;
+		}
+	}
+}

+ 12 - 0
Assets/Scripts/Battle/Map/Craft/CraftModel.cs.meta

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

+ 2 - 15
Assets/Scripts/Battle/Map/Craft/SwapManager.cs

@@ -62,7 +62,7 @@ public class SwapManager
 		requestedSwap = true;
 	}
 	
-	public void Swap(Craft newCraft, int craftId, CraftEquipModify equipModify)
+	public void Swap(CraftModel craftModel, int craftId, CraftEquipModify equipModify)
 	{
 		if(craft.IsDead())
 			return;
@@ -75,23 +75,10 @@ public class SwapManager
 
 		craft.SetEquipModify (equipModify);
 		craft.SetCraftId (craftId);
-		
-		craft.bodyTrans.SetParent(null);
-		GameObject.Destroy(craft.bodyTrans.gameObject);
-		
-		Transform newBody = newCraft.transform.Find("Body");
-		newBody.SetParent(craft.transform);
-		newBody.localPosition = Vector3.zero;
-		newBody.localScale = new Vector3(1f, 1f, 1f);
-		
-		craft.textureArr = newCraft.textureArr;
-		
-		GameObject.Destroy(newCraft.gameObject);
+		craft.SetCraftModel (craftModel);
 		
 		craft.Init();
-		
 		craft.team = craft.team;
-
 		craft.SwapComplete();
 	}
 

+ 1 - 1
Assets/Scripts/Battle/Map/Map.cs

@@ -432,7 +432,7 @@ public class Map
 		{
 			AstarSearchQueue queue = searchQueue[0];
 			LinkedList<AStarNode> list = GetPath(queue.start, queue.end, queue.craft);
-			queue.craft.SetPath(list);
+//			queue.craft.SetPath(list);
 			searchQueue.RemoveAt(0);
 		}
 	}

+ 25 - 25
Assets/Scripts/Battle/Map/Utils/Invisibler.cs

@@ -14,31 +14,31 @@ public class Invisibler : MonoBehaviour
 	// Use this for initialization
 	void Start ()
 	{
-		Craft craft = GetComponent<Craft>();
-		if(craft.topPartTrans != null)
-		{
-			Renderer[] topRenderers = craft.topPartTrans.GetComponentsInChildren<SkinnedMeshRenderer>();
-			Renderer[] bottomRenderers = craft.bottomPartTrans.GetComponentsInChildren<SkinnedMeshRenderer>();
-			rendererArr = new Renderer[topRenderers.Length + bottomRenderers.Length];
-			for(int i=0; i<topRenderers.Length; i++)
-			{
-				rendererArr[i] = topRenderers[i];
-			}
-			for(int i=0; i<bottomRenderers.Length; i++)
-			{
-				rendererArr[topRenderers.Length + i] = bottomRenderers[i];
-			}
-		}
-		else
-		{
-			rendererArr = craft.bodyTrans.GetComponentsInChildren<SkinnedMeshRenderer>();
-		}
-		material = Instantiate<Material>(Resources.Load<Material> (Config.SHADOW_MATERIAL));
-		material.mainTexture = rendererArr[0].material.mainTexture;
-		for(int i=0; i<rendererArr.Length; i++)
-		{
-			rendererArr[i].material = material;
-		}
+//		Craft craft = GetComponent<Craft>();
+//		if(craft.topPartTrans != null)
+//		{
+//			Renderer[] topRenderers = craft.topPartTrans.GetComponentsInChildren<SkinnedMeshRenderer>();
+//			Renderer[] bottomRenderers = craft.bottomPartTrans.GetComponentsInChildren<SkinnedMeshRenderer>();
+//			rendererArr = new Renderer[topRenderers.Length + bottomRenderers.Length];
+//			for(int i=0; i<topRenderers.Length; i++)
+//			{
+//				rendererArr[i] = topRenderers[i];
+//			}
+//			for(int i=0; i<bottomRenderers.Length; i++)
+//			{
+//				rendererArr[topRenderers.Length + i] = bottomRenderers[i];
+//			}
+//		}
+//		else
+//		{
+//			rendererArr = craft.bodyTrans.GetComponentsInChildren<SkinnedMeshRenderer>();
+//		}
+//		material = Instantiate<Material>(Resources.Load<Material> (Config.SHADOW_MATERIAL));
+//		material.mainTexture = rendererArr[0].material.mainTexture;
+//		for(int i=0; i<rendererArr.Length; i++)
+//		{
+//			rendererArr[i].material = material;
+//		}
 	}
 	
 	// Update is called once per frame

+ 3 - 3
Assets/Scripts/Net/Message/MessageManager.cs

@@ -519,8 +519,8 @@ public class MessageManager
 
 		if(craft.isMoving)
 		{
-			obj.PutInt("ex", craft.targetMovePosition.x);
-			obj.PutInt("ey", craft.targetMovePosition.y);
+			obj.PutFloat("ex", craft.moveDestination.x);
+			obj.PutFloat("ey", craft.moveDestination.z);
 		}
 
 		obj.PutFloat("hp", craft.hp);
@@ -596,7 +596,7 @@ public class MessageManager
 
 		if(obj.ContainsKey("ex"))
 		{
-			craft.MoveTo(obj.GetInt("ex"), obj.GetInt("ey"));
+			craft.MoveTo(obj.GetFloat("ex"), obj.GetFloat("ey"));
 		}
 
 		// TODO buff

+ 244 - 0
Assets/Shader/Skybox-Procedural.shader

@@ -0,0 +1,244 @@
+// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
+
+Shader "Skybox/Procedural" {
+Properties {
+	_SunTint ("Sun Tint", Color) = (1, 1, 1, 1)
+	_SunStrength ("Sun Strength", Float) = 1.0
+	_Color ("Atmosphere Tint", Color) = (.5, .5, .5, 1)
+	_GroundColor ("Ground", Color) = (.369, .349, .341, 1)
+	_HdrExposure("HDR Exposure", Float) = 1.3
+
+}
+
+SubShader {
+	Tags { "Queue"="Background" "RenderType"="Background" "PreviewType"="Skybox" }
+	Cull Off ZWrite Off
+
+	Pass {
+		
+		CGPROGRAM
+		#pragma vertex vert
+		#pragma fragment frag
+
+		#include "UnityCG.cginc"
+		#include "Lighting.cginc"
+
+
+		uniform half _HdrExposure;		// HDR exposure
+		uniform half3 _GroundColor;
+
+		half3 _Color;
+		half3 _SunTint;
+		half _SunStrength;
+
+		// RGB wavelengths
+		#define GAMMA .454545
+		static const float MN = 2;
+		static const float MX = .7;
+		#define WR (0.65*lerp(MN, MX, pow(_Color.r,GAMMA)))
+		#define WG (0.57*lerp(MN, MX, pow(_Color.g,GAMMA)))
+		#define WB (0.475*lerp(MN, MX, pow(_Color.b,GAMMA)))
+		//#define WR pow(0.65,GAMMA)
+		//#define WG pow(0.57,GAMMA)
+		//#define WB pow(0.475,GAMMA)
+		static const float3 kInvWavelength = float3(1.0 / (WR*WR*WR*WR), 1.0 / (WG*WG*WG*WG), 1.0 / (WB*WB*WB*WB));
+		#define OUTER_RADIUS 1.025
+		static const float kOuterRadius = OUTER_RADIUS;
+		static const float kOuterRadius2 = OUTER_RADIUS*OUTER_RADIUS;
+		static const float kInnerRadius = 1.0;
+		static const float kInnerRadius2 = 1.0;
+
+		static const float kCameraHeight = 0.0001;
+
+		#define kRAYLEIGH 0.0025		// Rayleigh constant
+		#define kMIE 0.0010      		// Mie constant
+		#define kSUN_BRIGHTNESS 20.0 	// Sun brightness
+
+		static const float kKrESun = kRAYLEIGH * kSUN_BRIGHTNESS;
+		static const float kKmESun = kMIE * kSUN_BRIGHTNESS;
+		static const float kKr4PI = kRAYLEIGH * 4.0 * 3.14159265;
+		static const float kKm4PI = kMIE * 4.0 * 3.14159265;
+		static const float kScale = 1.0 / (OUTER_RADIUS - 1.0);
+		static const float kScaleDepth = 0.25;
+		static const float kScaleOverScaleDepth = (1.0 / (OUTER_RADIUS - 1.0)) / 0.25;
+		static const float kSamples = 2.0; // THIS IS UNROLLED MANUALLY, DON'T TOUCH
+
+		#define MIE_G (-0.990)
+		#define MIE_G2 0.9801
+
+
+		struct appdata_t {
+			float4 vertex : POSITION;
+		};
+
+		struct v2f {
+				float4 pos : SV_POSITION;
+				half3 rayDir : TEXCOORD0;	// Vector for incoming ray, normalized ( == -eyeRay )
+				half3 cIn : TEXCOORD1; 		// In-scatter coefficient
+				half3 cOut : TEXCOORD2;		// Out-scatter coefficient
+   		}; 
+
+		float scale(float inCos)
+		{
+			float x = 1.0 - inCos;
+			return 0.25 * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));
+		}
+
+		v2f vert (appdata_t v)
+		{
+			v2f OUT;
+			OUT.pos = mul(UNITY_MATRIX_MVP, v.vertex);
+
+			float3 cameraPos = float3(0,kInnerRadius + kCameraHeight,0); 	// The camera's current position
+		
+			// Get the ray from the camera to the vertex and its length (which is the far point of the ray passing through the atmosphere)
+			float3 eyeRay = normalize(mul((float3x3)unity_ObjectToWorld, v.vertex.xyz));
+
+			OUT.rayDir = half3(-eyeRay);
+
+			float far = 0.0;
+			if(eyeRay.y >= 0.0)
+			{
+				// Sky
+				// Calculate the length of the "atmosphere"
+				far = sqrt(kOuterRadius2 + kInnerRadius2 * eyeRay.y * eyeRay.y - kInnerRadius2) - kInnerRadius * eyeRay.y;
+
+				float3 pos = cameraPos + far * eyeRay;
+				
+				// Calculate the ray's starting position, then calculate its scattering offset
+				float height = kInnerRadius + kCameraHeight;
+				float depth = exp(kScaleOverScaleDepth * (-kCameraHeight));
+				float startAngle = dot(eyeRay, cameraPos) / height;
+				float startOffset = depth*scale(startAngle);
+				
+			
+				// Initialize the scattering loop variables
+				float sampleLength = far / kSamples;
+				float scaledLength = sampleLength * kScale;
+				float3 sampleRay = eyeRay * sampleLength;
+				float3 samplePoint = cameraPos + sampleRay * 0.5;
+
+				// Now loop through the sample rays
+				float3 frontColor = float3(0.0, 0.0, 0.0);
+				// WTF BBQ: WP8 and desktop FL_9_1 do not like the for loop here
+				// (but an almost identical loop is perfectly fine in the ground calculations below)
+				// Just unrolling this manually seems to make everything fine again.
+//				for(int i=0; i<int(kSamples); i++)
+				{
+					float height = length(samplePoint);
+					float depth = exp(kScaleOverScaleDepth * (kInnerRadius - height));
+					float lightAngle = dot(_WorldSpaceLightPos0.xyz, samplePoint) / height;
+					float cameraAngle = dot(eyeRay, samplePoint) / height;
+					float scatter = (startOffset + depth*(scale(lightAngle) - scale(cameraAngle)));
+					float3 attenuate = exp(-scatter * (kInvWavelength * kKr4PI + kKm4PI));
+
+					frontColor += attenuate * (depth * scaledLength);
+					samplePoint += sampleRay;
+				}
+				{
+					float height = length(samplePoint);
+					float depth = exp(kScaleOverScaleDepth * (kInnerRadius - height));
+					float lightAngle = dot(_WorldSpaceLightPos0.xyz, samplePoint) / height;
+					float cameraAngle = dot(eyeRay, samplePoint) / height;
+					float scatter = (startOffset + depth*(scale(lightAngle) - scale(cameraAngle)));
+					float3 attenuate = exp(-scatter * (kInvWavelength * kKr4PI + kKm4PI));
+
+					frontColor += attenuate * (depth * scaledLength);
+					samplePoint += sampleRay;
+				}
+
+
+
+				// Finally, scale the Mie and Rayleigh colors and set up the varying variables for the pixel shader
+				OUT.cIn.xyz = frontColor * (kInvWavelength * kKrESun);
+				OUT.cOut = frontColor * kKmESun;
+			}
+			else
+			{
+				// Ground
+				far = (-kCameraHeight) / (min(-0.00001, eyeRay.y));
+
+				float3 pos = cameraPos + far * eyeRay;
+
+				// Calculate the ray's starting position, then calculate its scattering offset
+				float depth = exp((-kCameraHeight) * (1.0/kScaleDepth));
+				float cameraAngle = dot(-eyeRay, pos);
+				float lightAngle = dot(_WorldSpaceLightPos0.xyz, pos);
+				float cameraScale = scale(cameraAngle);
+				float lightScale = scale(lightAngle);
+				float cameraOffset = depth*cameraScale;
+				float temp = (lightScale + cameraScale);
+				
+				// Initialize the scattering loop variables
+				float sampleLength = far / kSamples;
+				float scaledLength = sampleLength * kScale;
+				float3 sampleRay = eyeRay * sampleLength;
+				float3 samplePoint = cameraPos + sampleRay * 0.5;
+				
+				// Now loop through the sample rays
+				float3 frontColor = float3(0.0, 0.0, 0.0);
+				float3 attenuate;
+				for(int i=0; i<int(kSamples); i++)
+				{
+					float height = length(samplePoint);
+					float depth = exp(kScaleOverScaleDepth * (kInnerRadius - height));
+					float scatter = depth*temp - cameraOffset;
+					attenuate = exp(-scatter * (kInvWavelength * kKr4PI + kKm4PI));
+					frontColor += attenuate * (depth * scaledLength);
+					samplePoint += sampleRay;
+				}
+			
+				OUT.cIn.xyz = frontColor * (kInvWavelength * kKrESun + kKmESun);
+				OUT.cOut.xyz = clamp(attenuate, 0.0, 1.0);
+			}
+
+
+			return OUT;
+
+		}
+
+
+		// Calculates the Mie phase function
+		half getMiePhase(half eyeCos, half eyeCos2)
+		{
+			half temp = 1.0 + MIE_G2 - 2.0 * MIE_G * eyeCos;
+			// A somewhat rough approx for :
+			// temp = pow(temp, 1.5);
+			temp = smoothstep(0.0, 0.01, temp) * temp;
+			temp = max(temp,1.0e-4); // prevent division by zero, esp. in half precision
+			return 1.5 * ((1.0 - MIE_G2) / (2.0 + MIE_G2)) * (1.0 + eyeCos2) / temp;
+		}
+
+		// Calculates the Rayleigh phase function
+		half getRayleighPhase(half eyeCos2)
+		{
+			return 0.75 + 0.75*eyeCos2;
+		}
+
+		half4 frag (v2f IN) : SV_Target
+		{
+			half3 col;
+			if(IN.rayDir.y < 0.0)
+			{
+				half eyeCos = dot(_WorldSpaceLightPos0.xyz, normalize(IN.rayDir.xyz));
+				half eyeCos2 = eyeCos * eyeCos;
+				col = getRayleighPhase(eyeCos2) * IN.cIn.xyz + getMiePhase(eyeCos, eyeCos2) * IN.cOut * _LightColor0.xyz * _SunTint * _SunStrength;
+			}
+			else
+			{
+				col = IN.cIn.xyz + _GroundColor * IN.cOut;
+			}
+			//Adjust color from HDR
+			col *= _HdrExposure; 
+ 
+			return half4(col,1.0);
+
+		}
+		ENDCG 
+	}
+} 	
+
+
+Fallback Off
+
+}

+ 9 - 0
Assets/Shader/Skybox-Procedural.shader.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 581b3a4e294fafe479c9c6534cf3a196
+timeCreated: 1494322428
+licenseType: Pro
+ShaderImporter:
+  defaultTextures: []
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
ProjectSettings/EditorBuildSettings.asset


BIN
ProjectSettings/ProjectSettings.asset


BIN
ProjectSettings/QualitySettings.asset


BIN
ProjectSettings/TagManager.asset