Explorar el Código

冲击波横版

SZAND\msx_2 hace 10 meses
padre
commit
0715b4b4d4

+ 27 - 21
ActionTowerDefense/Assets/Resources/Prefab/Conduct/WavePower.prefab

@@ -10,8 +10,8 @@ GameObject:
   m_Component:
   - component: {fileID: 1606292805419130208}
   - component: {fileID: 2294170143768085763}
-  - component: {fileID: 244052354518820451}
   - component: {fileID: 337167225160774390}
+  - component: {fileID: 3625977449679299091}
   m_Layer: 0
   m_Name: WavePower
   m_TagString: Untagged
@@ -26,14 +26,14 @@ Transform:
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 8625694250200680089}
-  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068}
   m_LocalPosition: {x: 0, y: 0, z: 0}
-  m_LocalScale: {x: 3.24, y: 4.06, z: 3.3000002}
+  m_LocalScale: {x: 0.8, y: 4.06, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children: []
   m_Father: {fileID: 0}
   m_RootOrder: 0
-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
 --- !u!212 &2294170143768085763
 SpriteRenderer:
   m_ObjectHideFlags: 0
@@ -75,7 +75,7 @@ SpriteRenderer:
   m_SortingLayerID: 0
   m_SortingLayer: 0
   m_SortingOrder: 0
-  m_Sprite: {fileID: 21300000, guid: 4a176e29c99575247b703302c7f64bb5, type: 3}
+  m_Sprite: {fileID: 21300000, guid: af593ea1beae1e646a40840ee9420bf7, type: 3}
   m_Color: {r: 1, g: 0.9792701, b: 0, a: 1}
   m_FlipX: 0
   m_FlipY: 0
@@ -86,19 +86,6 @@ SpriteRenderer:
   m_WasSpriteAssigned: 1
   m_MaskInteraction: 0
   m_SpriteSortPoint: 0
---- !u!65 &244052354518820451
-BoxCollider:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 8625694250200680089}
-  m_Material: {fileID: 0}
-  m_IsTrigger: 1
-  m_Enabled: 1
-  serializedVersion: 2
-  m_Size: {x: 2.4124382, y: 2.5599997, z: 0.19999999}
-  m_Center: {x: 0.031620264, y: 0, z: 0}
 --- !u!114 &337167225160774390
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -111,8 +98,27 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: c5f09e346a819ab44a5addd5c5c5281f, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  force: {x: 20000, y: 5000, z: 0}
-  damage: 0
-  continueTime: 3
   cacheID: 0
   pc: {fileID: 0}
+  maxLength: 9
+  longSpeed: 60
+  longFX: 0
+  maxForceX: 10000
+  minForceX: 25000
+  maxForceY: 3000
+  minForceY: 6000
+  damage: 0
+  continueTime: 2
+--- !u!65 &3625977449679299091
+BoxCollider:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 8625694250200680089}
+  m_Material: {fileID: 0}
+  m_IsTrigger: 1
+  m_Enabled: 1
+  serializedVersion: 2
+  m_Size: {x: 2.5600007, y: 2.5600002, z: 0.2}
+  m_Center: {x: 0, y: 1.2800001, z: 0}

+ 1 - 0
ActionTowerDefense/Assets/Resources/Prefab/Player.prefab

@@ -1167,6 +1167,7 @@ MonoBehaviour:
   trigGroundList: []
   myBaGuaTrigger: {fileID: 0}
   baGuaTrigger: []
+  notOnGiant: 0
 --- !u!1 &4574901846507359337
 GameObject:
   m_ObjectHideFlags: 0

BIN
ActionTowerDefense/Assets/Resources/Textures/tempWave.png


+ 147 - 0
ActionTowerDefense/Assets/Resources/Textures/tempWave.png.meta

@@ -0,0 +1,147 @@
+fileFormatVersion: 2
+guid: af593ea1beae1e646a40840ee9420bf7
+TextureImporter:
+  internalIDToNameTable: []
+  externalObjects: {}
+  serializedVersion: 12
+  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
+  streamingMipmaps: 0
+  streamingMipmapsPriority: 0
+  vTOnly: 0
+  ignoreMasterTextureLimit: 0
+  grayScaleToAlpha: 0
+  generateCubemap: 6
+  cubemapConvolution: 0
+  seamlessCubemap: 0
+  textureFormat: 1
+  maxTextureSize: 2048
+  textureSettings:
+    serializedVersion: 2
+    filterMode: 1
+    aniso: 1
+    mipBias: 0
+    wrapU: 1
+    wrapV: 1
+    wrapW: 1
+  nPOTScale: 0
+  lightmap: 0
+  compressionQuality: 50
+  spriteMode: 1
+  spriteExtrude: 1
+  spriteMeshType: 1
+  alignment: 9
+  spritePivot: {x: 0.5, y: 0}
+  spritePixelsToUnits: 100
+  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+  spriteGenerateFallbackPhysicsShape: 1
+  alphaUsage: 1
+  alphaIsTransparency: 1
+  spriteTessellationDetail: -1
+  textureType: 8
+  textureShape: 1
+  singleChannelComponent: 0
+  flipbookRows: 1
+  flipbookColumns: 1
+  maxTextureSizeSet: 0
+  compressionQualitySet: 0
+  textureFormatSet: 0
+  ignorePngGamma: 0
+  applyGammaDecoding: 0
+  cookieLightType: 0
+  platformSettings:
+  - serializedVersion: 3
+    buildTarget: DefaultTexturePlatform
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 3
+    buildTarget: Standalone
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 3
+    buildTarget: Server
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 3
+    buildTarget: Android
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 3
+    buildTarget: iPhone
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  spriteSheet:
+    serializedVersion: 2
+    sprites: []
+    outline: []
+    physicsShape: []
+    bones: []
+    spriteID: 5e97eb03825dee720800000000000000
+    internalID: 1537655665
+    vertices: []
+    indices: 
+    edges: []
+    weights: []
+    secondaryTextures: []
+    nameFileIdTable: {}
+  spritePackingTag: 
+  pSDRemoveMatte: 0
+  pSDShowRemoveMatteOption: 0
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 5
ActionTowerDefense/Assets/Scripts/Conduct/Mountain.cs

@@ -23,11 +23,6 @@ public class Mountain : MonoBehaviour
         if (other.gameObject.layer == 8)
         {
             Enemy en = other.GetComponentInParent<Enemy>();
-            if (en.canFly)
-            {
-                en.willBeFly = true;
-                //en.canFly = false;
-            }
             en.willComaTime = comaTime;
             en.willBeComa = true;
             en.comaDamage = pc.swordNum * 100;

+ 39 - 16
ActionTowerDefense/Assets/Scripts/Conduct/WavePowerSkill.cs

@@ -4,21 +4,51 @@ using UnityEngine;
 
 public class WavePowerSkill : MonoBehaviour
 {
-    public Vector3 force;
+    public int cacheID;
+    public PlayerController pc;
+    private float curX;
+
+    [Header("推出去的过程")]
+    public float maxLength;
+    private float curLength;
+    public float longSpeed;
+    public int longFX;
+
+    [Header("推力、伤害")]
+    public float maxForceX;
+    public float minForceX;
+    public float maxForceY;
+    public float minForceY;
     private int fx = 1;
     private Vector3 curForce;
     public int damage;
+
+    [Header("持续时间")]
     public float continueTime;
-    public int cacheID;
-    public PlayerController pc;
+
+    private void Start()
+    {
+        curX = transform.localScale.x;
+    }
 
     private void Update()
     {
-        continueTime -= Time.deltaTime;
-        if (continueTime <= 0)
+        if (curLength < maxLength)
+        {
+            curLength += longSpeed * Time.deltaTime;
+            transform.localScale = new Vector3(curX, curLength * longFX, 1);
+        }
+        else
         {
-            pc.conductCanRelease[cacheID] = true;
-            gameObject.SetActive(false);
+            continueTime -= Time.deltaTime;
+            if (continueTime <= 0)
+            {
+                pc.conductCanRelease[cacheID] = true;
+                pc.canMove = true;
+                pc.rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ;
+                pc.rb.useGravity = true;
+                gameObject.SetActive(false);
+            }
         }
     }
 
@@ -26,15 +56,8 @@ public class WavePowerSkill : MonoBehaviour
     {
         if (other.gameObject.layer == 8)
         {
-            if (other.gameObject.transform.position.x >= transform.position.x)
-            {
-                fx = 1;
-            }
-            else
-            {
-                fx = -1;
-            }
-            curForce = force;
+            fx = (int)((Random.Range(0, 2) - 0.5f) * 2);
+            curForce = new Vector3(Random.Range(minForceX, maxForceX), Random.Range(minForceY, maxForceY), 0);
             curForce.x = curForce.x * fx;
             other.GetComponentInParent<Enemy>().ChangeState(CharacterState.Weak);
             other.GetComponentInParent<Enemy>().wallDamage = damage;

+ 0 - 1
ActionTowerDefense/Assets/Scripts/Enemy.cs

@@ -53,7 +53,6 @@ public class Enemy : MoveCharacter
     public bool willBeComa;
     public float willComaTime;
     public int comaDamage;
-    public bool willBeFly;
 
     [Header("µÐ·½Ó¢Áé")]
     public Spirits.SpiritType type;

+ 4 - 0
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -840,10 +840,14 @@ public class PlayerController : MoveCharacter
                 case ConductSkills.WavePower:
                     if (demonicDic[2].Count > 0)
                     {
+                        canMove = false;
+                        rb.constraints = RigidbodyConstraints.FreezeAll;
+                        rb.useGravity = false;
                         conductCanRelease[cacheConductId] = false;
                         GameObject obj = Instantiate(wavePowerObj, transform);
                         obj.transform.position = transform.position + Vector3.up;
                         WavePowerSkill wps = obj.GetComponent<WavePowerSkill>();
+                        wps.longFX = (int)bodyTrans.localScale.x;
                         wps.damage = 100 * demonicDic[2].Count;
                         wps.cacheID = cacheConductId;
                         wps.pc = this;