Browse Source

法师可让漂浮的角色旋转

SZAND\msx_2 1 year ago
parent
commit
d9a523b168

+ 6 - 1
ActionTowerDefense/Assets/Resources/Prefab/Demonic_Arrow.prefab

@@ -90,7 +90,6 @@ MonoBehaviour:
   m_Name: 
   m_Name: 
   m_EditorClassIdentifier: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
   owner: {fileID: 0}
-  mainParent: {fileID: 8639832132491289359}
 --- !u!1 &1637528673901708253
 --- !u!1 &1637528673901708253
 GameObject:
 GameObject:
   m_ObjectHideFlags: 0
   m_ObjectHideFlags: 0
@@ -972,6 +971,8 @@ MonoBehaviour:
   attackTime: 0
   attackTime: 0
   totalAttack1Time: 1.8
   totalAttack1Time: 1.8
   totalAttack2Time: 1.3
   totalAttack2Time: 1.3
+  isNonAttack: 0
+  hptp: 0
   isDie: 0
   isDie: 0
   totalHp: 100
   totalHp: 100
   hp: 0
   hp: 0
@@ -1017,6 +1018,8 @@ MonoBehaviour:
   linked: 0
   linked: 0
   joint: {fileID: 0}
   joint: {fileID: 0}
   rope: {fileID: 0}
   rope: {fileID: 0}
+  hasHpUp: 0
+  beLarger: 0
   foot: {fileID: 8639832132450015562}
   foot: {fileID: 8639832132450015562}
   extraRiseGravity: -28.8
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
   extraFallGravity: -14.4
@@ -1037,6 +1040,8 @@ MonoBehaviour:
   maxRotateSpeed: 20
   maxRotateSpeed: 20
   minRotateSpeed: 5
   minRotateSpeed: 5
   floatTime: 20
   floatTime: 20
+  outlineMats:
+  - {fileID: 2100000, guid: b634d447d9a02a14abc964532eedfc35, type: 2}
   id: 0
   id: 0
   costMp: 40
   costMp: 40
   searchState: 0
   searchState: 0

+ 8 - 1
ActionTowerDefense/Assets/Resources/Prefab/Demonic_Giant.prefab

@@ -97,6 +97,8 @@ MonoBehaviour:
   force: {x: 0, y: 0, z: 0}
   force: {x: 0, y: 0, z: 0}
   changeHurt: 0
   changeHurt: 0
   repelValue: 0
   repelValue: 0
+  spiritsAttackEffect: {fileID: 0}
+  offsetY: 1
 --- !u!1 &2460330936527559963
 --- !u!1 &2460330936527559963
 GameObject:
 GameObject:
   m_ObjectHideFlags: 0
   m_ObjectHideFlags: 0
@@ -156,7 +158,6 @@ MonoBehaviour:
   m_Name: 
   m_Name: 
   m_EditorClassIdentifier: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
   owner: {fileID: 0}
-  mainParent: {fileID: 5440846222648032759}
 --- !u!1 &4480734502875862885
 --- !u!1 &4480734502875862885
 GameObject:
 GameObject:
   m_ObjectHideFlags: 0
   m_ObjectHideFlags: 0
@@ -437,6 +438,8 @@ MonoBehaviour:
   attackTime: 0
   attackTime: 0
   totalAttack1Time: 3.6
   totalAttack1Time: 3.6
   totalAttack2Time: 4
   totalAttack2Time: 4
+  isNonAttack: 0
+  hptp: 0
   isDie: 0
   isDie: 0
   totalHp: 2000
   totalHp: 2000
   hp: 0
   hp: 0
@@ -470,6 +473,8 @@ MonoBehaviour:
   linked: 0
   linked: 0
   joint: {fileID: 0}
   joint: {fileID: 0}
   rope: {fileID: 0}
   rope: {fileID: 0}
+  hasHpUp: 0
+  beLarger: 0
   foot: {fileID: 5440846222604650418}
   foot: {fileID: 5440846222604650418}
   extraRiseGravity: -28.8
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
   extraFallGravity: -14.4
@@ -490,6 +495,8 @@ MonoBehaviour:
   maxRotateSpeed: 20
   maxRotateSpeed: 20
   minRotateSpeed: 5
   minRotateSpeed: 5
   floatTime: 20
   floatTime: 20
+  outlineMats:
+  - {fileID: 2100000, guid: a30e0c3d2b8bf4e43a76fc2d5b3884cd, type: 2}
   id: 0
   id: 0
   costMp: 150
   costMp: 150
   searchState: 0
   searchState: 0

+ 8 - 1
ActionTowerDefense/Assets/Resources/Prefab/Demonic_Sword.prefab

@@ -177,6 +177,8 @@ MonoBehaviour:
   attackTime: 0
   attackTime: 0
   totalAttack1Time: 1.25
   totalAttack1Time: 1.25
   totalAttack2Time: 1.8
   totalAttack2Time: 1.8
+  isNonAttack: 0
+  hptp: 0
   isDie: 0
   isDie: 0
   totalHp: 200
   totalHp: 200
   hp: 0
   hp: 0
@@ -210,6 +212,8 @@ MonoBehaviour:
   linked: 0
   linked: 0
   joint: {fileID: 0}
   joint: {fileID: 0}
   rope: {fileID: 0}
   rope: {fileID: 0}
+  hasHpUp: 0
+  beLarger: 0
   foot: {fileID: 2437299196663985756}
   foot: {fileID: 2437299196663985756}
   extraRiseGravity: -28.8
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
   extraFallGravity: -14.4
@@ -230,6 +234,8 @@ MonoBehaviour:
   maxRotateSpeed: 20
   maxRotateSpeed: 20
   minRotateSpeed: 5
   minRotateSpeed: 5
   floatTime: 20
   floatTime: 20
+  outlineMats:
+  - {fileID: 2100000, guid: 7d50f910288e95b4285a5fb549c94fe6, type: 2}
   id: 0
   id: 0
   costMp: 100
   costMp: 100
   searchState: 0
   searchState: 0
@@ -576,6 +582,8 @@ MonoBehaviour:
   force: {x: 0, y: 0, z: 0}
   force: {x: 0, y: 0, z: 0}
   changeHurt: 0
   changeHurt: 0
   repelValue: 0
   repelValue: 0
+  spiritsAttackEffect: {fileID: 0}
+  offsetY: 1
 --- !u!1 &7669620205589286043
 --- !u!1 &7669620205589286043
 GameObject:
 GameObject:
   m_ObjectHideFlags: 0
   m_ObjectHideFlags: 0
@@ -927,7 +935,6 @@ MonoBehaviour:
   m_Name: 
   m_Name: 
   m_EditorClassIdentifier: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
   owner: {fileID: 0}
-  mainParent: {fileID: 2437299196472462361}
 --- !u!1 &8802879426389446295
 --- !u!1 &8802879426389446295
 GameObject:
 GameObject:
   m_ObjectHideFlags: 0
   m_ObjectHideFlags: 0

+ 4 - 1
ActionTowerDefense/Assets/Resources/Prefab/ESpirits_Cook.prefab

@@ -731,7 +731,10 @@ MonoBehaviour:
   maxRotateSpeed: 0
   maxRotateSpeed: 0
   minRotateSpeed: 0
   minRotateSpeed: 0
   floatTime: 0
   floatTime: 0
-  outlineMats: []
+  outlineMats:
+  - {fileID: 2100000, guid: 30969c92738eb7d4da3885e08f1ec2f0, type: 2}
+  - {fileID: 2100000, guid: 98fc94309ab120b4c83b2cebb9226222, type: 2}
+  - {fileID: 2100000, guid: 30969c92738eb7d4da3885e08f1ec2f0, type: 2}
   id: 0
   id: 0
   costMp: 1
   costMp: 1
   searchState: 0
   searchState: 0

+ 2 - 1
ActionTowerDefense/Assets/Resources/Prefab/Spirits_Assassin.prefab

@@ -273,7 +273,8 @@ MonoBehaviour:
   maxRotateSpeed: 0
   maxRotateSpeed: 0
   minRotateSpeed: 0
   minRotateSpeed: 0
   floatTime: 20
   floatTime: 20
-  outlineMats: []
+  outlineMats:
+  - {fileID: 2100000, guid: eb0e26c1a9cf9a14799273e742b98d21, type: 2}
   id: 0
   id: 0
   costMp: 1
   costMp: 1
   searchState: 0
   searchState: 0

+ 4 - 1
ActionTowerDefense/Assets/Resources/Prefab/Spirits_Cook.prefab

@@ -731,7 +731,10 @@ MonoBehaviour:
   maxRotateSpeed: 0
   maxRotateSpeed: 0
   minRotateSpeed: 0
   minRotateSpeed: 0
   floatTime: 0
   floatTime: 0
-  outlineMats: []
+  outlineMats:
+  - {fileID: 2100000, guid: 30969c92738eb7d4da3885e08f1ec2f0, type: 2}
+  - {fileID: 2100000, guid: 98fc94309ab120b4c83b2cebb9226222, type: 2}
+  - {fileID: 2100000, guid: 30969c92738eb7d4da3885e08f1ec2f0, type: 2}
   id: 0
   id: 0
   costMp: 1
   costMp: 1
   searchState: 0
   searchState: 0

+ 4 - 1
ActionTowerDefense/Assets/Resources/Prefab/Spirits_Float.prefab

@@ -1056,7 +1056,10 @@ MonoBehaviour:
   maxRotateSpeed: 10
   maxRotateSpeed: 10
   minRotateSpeed: 4
   minRotateSpeed: 4
   floatTime: 5
   floatTime: 5
-  outlineMats: []
+  outlineMats:
+  - {fileID: 2100000, guid: b89f4b5b01e92784ab27611e2b014a10, type: 2}
+  - {fileID: 2100000, guid: 0d24ea357a09df448b788aed95b96541, type: 2}
+  - {fileID: 2100000, guid: b89f4b5b01e92784ab27611e2b014a10, type: 2}
   id: 0
   id: 0
   costMp: 1
   costMp: 1
   searchState: 0
   searchState: 0

+ 43 - 0
ActionTowerDefense/Assets/Resources/Spine/Spirits_Assassin/Spirits_Assassin_Material_Outline.mat

@@ -0,0 +1,43 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+  serializedVersion: 8
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: Spirits_Assassin_Material_Outline
+  m_Shader: {fileID: 4800000, guid: 28b5cf4804845fe4b868531fd0bb81d5, type: 3}
+  m_ValidKeywords:
+  - _USE8NEIGHBOURHOOD_ON
+  m_InvalidKeywords: []
+  m_LightmapFlags: 4
+  m_EnableInstancingVariants: 0
+  m_DoubleSidedGI: 0
+  m_CustomRenderQueue: -1
+  stringTagMap: {}
+  disabledShaderPasses: []
+  m_SavedProperties:
+    serializedVersion: 3
+    m_TexEnvs:
+    - _MainTex:
+        m_Texture: {fileID: 2800000, guid: b3dea81b098cc294ab4b3ebfad524d55, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Ints: []
+    m_Floats:
+    - _Cutoff: 0.1
+    - _OutlineMipLevel: 0
+    - _OutlineOpaqueAlpha: 1
+    - _OutlineReferenceTexWidth: 1024
+    - _OutlineSmoothness: 1
+    - _OutlineWidth: 8
+    - _StencilComp: 8
+    - _StencilRef: 1
+    - _StraightAlphaInput: 0
+    - _ThresholdEnd: 0.25
+    - _Use8Neighbourhood: 1
+    m_Colors:
+    - _OutlineColor: {r: 0, g: 1, b: 0.95341015, a: 1}
+  m_BuildTextureStacks: []

+ 8 - 0
ActionTowerDefense/Assets/Resources/Spine/Spirits_Assassin/Spirits_Assassin_Material_Outline.mat.meta

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

+ 50 - 0
ActionTowerDefense/Assets/Resources/Spine/Spirits_Cook/Spirits_Cook_Material-Additive_Outline.mat

@@ -0,0 +1,50 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+  serializedVersion: 8
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: Spirits_Cook_Material-Additive_Outline
+  m_Shader: {fileID: 4800000, guid: 0299ffae826705448b6c80ccc6a53b75, type: 3}
+  m_ValidKeywords:
+  - _USE8NEIGHBOURHOOD_ON
+  m_InvalidKeywords: []
+  m_LightmapFlags: 4
+  m_EnableInstancingVariants: 0
+  m_DoubleSidedGI: 0
+  m_CustomRenderQueue: -1
+  stringTagMap: {}
+  disabledShaderPasses: []
+  m_SavedProperties:
+    serializedVersion: 3
+    m_TexEnvs:
+    - <noninit>:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MainTex:
+        m_Texture: {fileID: 2800000, guid: d7a5977883824764a8b6795b741a5091, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Ints: []
+    m_Floats:
+    - <noninit>: 0
+    - _Cutoff: 0.1
+    - _OutlineMipLevel: 0
+    - _OutlineOpaqueAlpha: 1
+    - _OutlineReferenceTexWidth: 1024
+    - _OutlineSmoothness: 1
+    - _OutlineWidth: 8
+    - _StencilComp: 8
+    - _StencilRef: 1
+    - _StraightAlphaInput: 0
+    - _ThresholdEnd: 0.25
+    - _Use8Neighbourhood: 1
+    m_Colors:
+    - <noninit>: {r: 0, g: 2.018574, b: 1e-45, a: 0.000007110106}
+    - _Color: {r: 1, g: 1, b: 1, a: 1}
+    - _OutlineColor: {r: 0, g: 0.9608054, b: 1, a: 1}
+  m_BuildTextureStacks: []

+ 8 - 0
ActionTowerDefense/Assets/Resources/Spine/Spirits_Cook/Spirits_Cook_Material-Additive_Outline.mat.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 98fc94309ab120b4c83b2cebb9226222
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 2100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 43 - 0
ActionTowerDefense/Assets/Resources/Spine/Spirits_Cook/Spirits_Cook_Material_Outline.mat

@@ -0,0 +1,43 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+  serializedVersion: 8
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: Spirits_Cook_Material_Outline
+  m_Shader: {fileID: 4800000, guid: 28b5cf4804845fe4b868531fd0bb81d5, type: 3}
+  m_ValidKeywords:
+  - _USE8NEIGHBOURHOOD_ON
+  m_InvalidKeywords: []
+  m_LightmapFlags: 4
+  m_EnableInstancingVariants: 0
+  m_DoubleSidedGI: 0
+  m_CustomRenderQueue: -1
+  stringTagMap: {}
+  disabledShaderPasses: []
+  m_SavedProperties:
+    serializedVersion: 3
+    m_TexEnvs:
+    - _MainTex:
+        m_Texture: {fileID: 2800000, guid: d7a5977883824764a8b6795b741a5091, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Ints: []
+    m_Floats:
+    - _Cutoff: 0.1
+    - _OutlineMipLevel: 0
+    - _OutlineOpaqueAlpha: 1
+    - _OutlineReferenceTexWidth: 1024
+    - _OutlineSmoothness: 1
+    - _OutlineWidth: 8
+    - _StencilComp: 8
+    - _StencilRef: 1
+    - _StraightAlphaInput: 0
+    - _ThresholdEnd: 0.25
+    - _Use8Neighbourhood: 1
+    m_Colors:
+    - _OutlineColor: {r: 0, g: 1, b: 0.96646833, a: 1}
+  m_BuildTextureStacks: []

+ 8 - 0
ActionTowerDefense/Assets/Resources/Spine/Spirits_Cook/Spirits_Cook_Material_Outline.mat.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 30969c92738eb7d4da3885e08f1ec2f0
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 2100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 4 - 13
ActionTowerDefense/Assets/Scripts/MoveCharacter.cs

@@ -95,7 +95,7 @@ public class MoveCharacter : Character
 
 
     private void RotateSelf()
     private void RotateSelf()
     {
     {
-        //transform.localEulerAngles += new Vector3(0, 0, 1) * rotateDir * rotateSpeed * Time.deltaTime;
+        transform.localEulerAngles += new Vector3(0, 0, 1) * rotateDir * rotateSpeed * Time.deltaTime;
     }
     }
 
 
 
 
@@ -144,26 +144,17 @@ public class MoveCharacter : Character
             else if (foot.TrigGround || curHeight <= origPos.y + 0.05f)
             else if (foot.TrigGround || curHeight <= origPos.y + 0.05f)
             {
             {
                 transform.position = origPos;
                 transform.position = origPos;
-                floatState = 0;
                 ChangeState(CharacterState.Idle);
                 ChangeState(CharacterState.Idle);
                 ChangeMat(1);
                 ChangeMat(1);
                 foreach (Material m in mats)
                 foreach (Material m in mats)
                 {
                 {
                     m.SetInt("_Outline", 0);
                     m.SetInt("_Outline", 0);
                 }
                 }
-
-                if (rotateDir==1)
-                {
-                    transform.localEulerAngles = Vector3.SmoothDamp(transform.localEulerAngles, new Vector3(0, 0, 0), ref oneClockwise, 0.1f);
-                }
-                else
-                {
-                    transform.localEulerAngles = Vector3.SmoothDamp(transform.localEulerAngles, new Vector3(0, 0, 0), ref oneCounterClockwise, 0.1f);
-                }
-                if (transform.localEulerAngles.z >= -0.02f && transform.localEulerAngles.z <= 0.02f)
+                transform.rotation = Quaternion.Lerp(transform.rotation, Quaternion.Euler(0, 0, 0), 0.02f);
+                if (transform.localEulerAngles.z >= -5f && transform.localEulerAngles.z <= 5f)
                 {
                 {
                     transform.localEulerAngles = new Vector3(0, 0, 0);
                     transform.localEulerAngles = new Vector3(0, 0, 0);
-                    
+                    floatState = 0;
                 }
                 }
             }
             }
         }
         }