SZAND\msx_2 1 рік тому
батько
коміт
af471be041

+ 13 - 0
ActionTowerDefense/Assets/Resources/Prefab/Transfiguration/Trans_Float.prefab

@@ -927,6 +927,7 @@ GameObject:
   serializedVersion: 6
   m_Component:
   - component: {fileID: 8639832132491289354}
+  - component: {fileID: 8713055958562902552}
   - component: {fileID: 3290368322717680010}
   - component: {fileID: 8639832132491289351}
   m_Layer: 7
@@ -954,6 +955,18 @@ Transform:
   m_Father: {fileID: 0}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &8713055958562902552
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 8639832132491289359}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: b660f3489782e504b85f8fb950580491, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
 --- !u!114 &3290368322717680010
 MonoBehaviour:
   m_ObjectHideFlags: 0

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

@@ -105,6 +105,10 @@ public class PlayerController : MoveCharacter
 
     private bool isTransfiguration = false; //ÒѱäÉí
 
+    public bool isinputJ;
+    public bool isinputK;
+    public bool isinputL;
+
     public bool btnJumpPress
     {
         get
@@ -369,14 +373,26 @@ public class PlayerController : MoveCharacter
     void OnSummon0()
     {
         isClickBtnWest = true;
+        if (isTransfiguration)
+        {
+            isinputJ = true;
+        }
     }
     void OnSummon1()
     {
         isClickBtnSouth = true;
+        if (isTransfiguration)
+        {
+            isinputK = true;
+        }
     }
     void OnSummon2()
     {
         isClickBtnEast = true;
+        if (isTransfiguration)
+        {
+            isinputL = true;
+        }
     }
     void OnSummonSpirit()
     {

+ 32 - 0
ActionTowerDefense/Assets/Scripts/Spirits/Trans_Float.cs

@@ -0,0 +1,32 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class Trans_Float : MonoBehaviour
+{
+    public PlayerController controller;
+
+    private void Start()
+    {
+        controller = GetComponentInParent<PlayerController>();
+    }
+
+    private void Update()
+    {
+        if (controller.isinputJ)
+        {
+            controller.isinputJ = false;
+            print(1);
+        }
+        if (controller.isinputK)
+        {
+            controller.isinputK = false;
+            print(2);
+        }
+        if (controller.isinputL)
+        {
+            controller.isinputL = false;
+            print(3);
+        }
+    }
+}

+ 11 - 0
ActionTowerDefense/Assets/Scripts/Spirits/Trans_Float.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b660f3489782e504b85f8fb950580491
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: