wangguan
2020-11-12 9a07073abba13afa28b85a2e0a59575bc6b7e417
手机拖拽监听
修改LoadingScene适配
5 files modified
81 ■■■■ changed files
Assets/Materials/UI/tileTowerVSMat.mat 2 ●●● patch | view | raw | blame | history
Assets/Resources/UI/Final/FinalPanel.prefab 4 ●●● patch | view | raw | blame | history
Assets/Scenes/LoadingScene.unity 18 ●●●● patch | view | raw | blame | history
Assets/Scripts/TowerDefense/Input/EndlessTowerDefenseTouchInput.cs 55 ●●●●● patch | view | raw | blame | history
Assets/Scripts/TowerDefense/UI/HUD/PlacementTile.cs 2 ●●● patch | view | raw | blame | history
Assets/Materials/UI/tileTowerVSMat.mat
@@ -40,7 +40,7 @@
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _MainTex:
        m_Texture: {fileID: 2800000, guid: 93f40a01d57fbff418fc0b54b6ab7d9f, type: 3}
        m_Texture: {fileID: 2800000, guid: 8c9a3d26120e78f40aa4ef9ed23d573c, type: 3}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _MetallicGlossMap:
Assets/Resources/UI/Final/FinalPanel.prefab
@@ -294,6 +294,8 @@
  rank_icon_0: {fileID: 21300000, guid: 8a601bd3e6cea2648bda74cc5d41890e, type: 3}
  rank_icon_1: {fileID: 21300000, guid: 84dda34663c79e645897598a6ab9f925, type: 3}
  rank_icon_2: {fileID: 21300000, guid: 8728e3959d828724c83a5c407bb53443, type: 3}
  endlessGameScene: Endless
  loadingScene: LoadingScene
--- !u!1 &2453499008035776559
GameObject:
  m_ObjectHideFlags: 0
@@ -969,7 +971,7 @@
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
  m_AnchorMin: {x: 0.5, y: 0.5}
  m_AnchorMax: {x: 0.5, y: 0.5}
  m_AnchoredPosition: {x: -4.4, y: 461}
  m_AnchoredPosition: {x: -4.4, y: 599.66}
  m_SizeDelta: {x: 572.84656, y: 146.90869}
  m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8224162413350209359
Assets/Scenes/LoadingScene.unity
@@ -157,7 +157,7 @@
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
  m_AnchorMin: {x: 1, y: 1}
  m_AnchorMax: {x: 1, y: 1}
  m_AnchoredPosition: {x: -118.400024, y: -20.699951}
  m_AnchoredPosition: {x: -118.40015, y: -20.699707}
  m_SizeDelta: {x: 220.91876, y: 30}
  m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &63699121
@@ -277,10 +277,10 @@
  m_Father: {fileID: 2142699187}
  m_RootOrder: 0
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
  m_AnchorMin: {x: 0, y: 0}
  m_AnchorMax: {x: 1, y: 1}
  m_AnchorMin: {x: 0.5, y: 0.5}
  m_AnchorMax: {x: 0.5, y: 0.5}
  m_AnchoredPosition: {x: 0, y: 0}
  m_SizeDelta: {x: 0, y: 0}
  m_SizeDelta: {x: 1080, y: 1920}
  m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &494017139
MonoBehaviour:
@@ -988,7 +988,7 @@
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
  m_AnchorMin: {x: 0.5, y: 0}
  m_AnchorMax: {x: 0.5, y: 0}
  m_AnchoredPosition: {x: 0, y: 96.01}
  m_AnchoredPosition: {x: 0, y: 96.009766}
  m_SizeDelta: {x: 325, y: 81}
  m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1592474034
@@ -1570,7 +1570,7 @@
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
  m_AnchorMin: {x: 0, y: 1}
  m_AnchorMax: {x: 0, y: 1}
  m_AnchoredPosition: {x: 162.57, y: -20.699951}
  m_AnchoredPosition: {x: 162.57007, y: -20.699707}
  m_SizeDelta: {x: 286.04895, y: 30}
  m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2019698822
@@ -1733,10 +1733,10 @@
  m_Father: {fileID: 501810474}
  m_RootOrder: 0
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
  m_AnchorMin: {x: 0, y: 0}
  m_AnchorMax: {x: 1, y: 1}
  m_AnchorMin: {x: 0.5, y: 0.5}
  m_AnchorMax: {x: 0.5, y: 0.5}
  m_AnchoredPosition: {x: 0, y: 0}
  m_SizeDelta: {x: 0, y: 0}
  m_SizeDelta: {x: 1080, y: 1920}
  m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2142699188
MonoBehaviour:
Assets/Scripts/TowerDefense/Input/EndlessTowerDefenseTouchInput.cs
@@ -192,19 +192,35 @@
                }
            }
        }
        float currentTimeScale = 1.0f;
        /// <summary>
        /// Called on input release, for flicks
        /// </summary>
        protected override void OnRelease(PointerActionInfo pointer)
        {
            // // EndDrag 只能放置相关的GhostTower.
            // if (this.isInDragState)
            //     m_GameUI.onEndTowerDrag(pointer);
            // //m_GameUI.TryPlaceTower(pointer);
            // this.isInDragState = false;
            // return;
            //按照鼠标键盘的修改
            // EndDrag 只能放置相关的GhostTower.
            if (this.isInDragState)
            {
                EndlessUIStart.instance.SetDarkGround(false);
                AudioSourceManager.Ins.Play(AudioEnum.PutTower);
                m_GameUI.CloseCanPlaceRenderer();//关闭所有宝石示意
                m_GameUI.onEndTowerDrag(pointer);
            //m_GameUI.TryPlaceTower(pointer);
            this.isInDragState = false;
            return;
                Time.timeScale = currentTimeScale;
            }
        }
@@ -223,13 +239,34 @@
        /// <param name="pointer"></param>
        protected virtual void OnStartDrag(PointerActionInfo pointer)
        {
            //Debug.Log("TouchInput StartDraged.");
            // //Debug.Log("TouchInput StartDraged.");
            // // select towers
            // m_GameUI.TrySelectTower(pointer);
            // // River: 为了开始拖动后可以直接显示GhostTower
            // m_GameUI.TryMoveGhost(pointer, false);
            // this.isInDragState = true;
            //按照鼠标键盘的修改
            // select towers
            m_GameUI.TrySelectTower(pointer);
            // River: 为了开始拖动后可以直接显示GhostTower
            m_GameUI.TryMoveGhost(pointer, false);
            Debug.LogError("OnStartDrag");
            if (m_GameUI.HasTower)
            {
                Debug.LogError("m_GameUI.HasTower:" + m_GameUI.HasTower);
                EndlessUIStart.instance.SetDarkGround(true);
            this.isInDragState = true;
                AudioSourceManager.Ins.Play(AudioEnum.DragTower);
                m_GameUI.CheckAllCanPlace();//检查上阵宝石有么有可以合成的位置
                currentTimeScale = Time.timeScale;
                Time.timeScale = 0.5f;
            }
        }
        /// <summary>
@@ -237,12 +274,20 @@
        /// </summary>
        protected override void OnDrag(PointerActionInfo pointer)
        {
            // if ((pointer != null) && (m_GameUI.isBuilding))
            // {
            //     m_GameUI.TryMoveGhost(pointer, false);
            // }
            // return;
            //按照鼠标键盘的修改
            if ((pointer != null) && (m_GameUI.isBuilding))
            {
                m_GameUI.TryMoveGhost(pointer, false);
            }
            return;
                m_GameUI.CheckTowerPlace(pointer);
            }
        }
        /// <summary>
Assets/Scripts/TowerDefense/UI/HUD/PlacementTile.cs
@@ -209,7 +209,7 @@
        {
            // shaderPropertyName = ShaderUtil.GetPropertyName(towerVSMat.shader, 0);
            shaderPropertyName = "_MainTex";
            Debug.Log("获取到了Shader的名字" + shaderPropertyName);
            //Debug.Log("获取到了Shader的名字" + shaderPropertyName);
            towerVSRenderer.enabled = false;
        }