Commit 96e30b48 authored by wanqing's avatar wanqing

修改UI界面逻辑

parent a1a17897
......@@ -686,6 +686,9 @@
<Reference Include="UnityEditor.UI">
<HintPath>D:/wan/dyspaceGame/BoomMaster_Git/BoomMaster/Library/ScriptAssemblies/UnityEditor.UI.dll</HintPath>
</Reference>
<Reference Include="Unity.2D.Sprite.Editor">
<HintPath>D:/wan/dyspaceGame/BoomMaster_Git/BoomMaster/Library/ScriptAssemblies/Unity.2D.Sprite.Editor.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="Assembly-CSharp-firstpass.csproj">
......
......@@ -635,6 +635,9 @@
<Reference Include="UnityEditor.UI">
<HintPath>D:/wan/dyspaceGame/BoomMaster_Git/BoomMaster/Library/ScriptAssemblies/UnityEditor.UI.dll</HintPath>
</Reference>
<Reference Include="Unity.2D.Sprite.Editor">
<HintPath>D:/wan/dyspaceGame/BoomMaster_Git/BoomMaster/Library/ScriptAssemblies/Unity.2D.Sprite.Editor.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup></ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
......
......@@ -751,6 +751,9 @@
<Reference Include="UnityEditor.UI">
<HintPath>D:/wan/dyspaceGame/BoomMaster_Git/BoomMaster/Library/ScriptAssemblies/UnityEditor.UI.dll</HintPath>
</Reference>
<Reference Include="Unity.2D.Sprite.Editor">
<HintPath>D:/wan/dyspaceGame/BoomMaster_Git/BoomMaster/Library/ScriptAssemblies/Unity.2D.Sprite.Editor.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="Assembly-CSharp-firstpass.csproj">
......
......@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1}
m_IndirectSpecularColor: {r: 0.37311926, g: 0.38073996, b: 0.35872698, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &4
LightmapSettings:
......
......@@ -40,6 +40,12 @@ public class BattleUI : MonoBehaviour
public Transform m_starParent;//星级
public Sprite m_fullStarSprite;//满星星
public Sprite m_emptyStarSprite;//空星星
public Color m_fullColor;//达到颜色
public Color m_emptyColor;//没达到颜色
public Image m_progress;//进度条
public Text m_progressText;//进度条text
public Text m_leftBombNum;//剩余炸弹数量
public Image[] m_progressStar;//进度条星星
public Action onStartBtn;
public Action onPosUpBtn;
public Action onPosDownBtn;
......@@ -251,11 +257,18 @@ public class BattleUI : MonoBehaviour
{
//重置状态
m_bombIndex = 0;
for(int i = 0;i<m_boomUIS.Length;i++)
//for(int i = 0;i<m_boomUIS.Length;i++)
//{
// m_boomUIS[i].SetActive(true);
//}
m_boomBtn.interactable = false;
m_leftBombNum.text = "X3";
m_progressText.text = "0%";
m_progress.fillAmount = 0;
for (int i = 0; i < m_progressStar.Length; i++)
{
m_boomUIS[i].SetActive(true);
m_progressStar[i].color = m_emptyColor;
}
m_boomBtn.interactable = false;
m_levelText.text = string.Format("Level {0:D}", BattleCtrl.instance.levelManager.CurLevelIndex + 1);
......@@ -311,8 +324,9 @@ public class BattleUI : MonoBehaviour
m_boomBtn.interactable = true;
m_boomUIS[m_bombIndex].SetActive(false);
//m_boomUIS[m_bombIndex].SetActive(false);
m_bombIndex++;
m_leftBombNum.text = string.Format("X{0:d}", 3 - m_bombIndex);
Invoke("OnClickBoomBtn", 1.5f);
}
//点击爆破按钮
......@@ -322,4 +336,29 @@ public class BattleUI : MonoBehaviour
m_boomBtn.interactable = false;
BattleCtrl.instance.levelManager.curLevel.bombView.SetPlaceState(m_bombIndex < 3);
}
//设置进度
public void SetProgress(float progress)
{
m_progressText.text = string.Format("{0:D}%",(int)(progress * 100));
if(progress >= 0 && progress <= 0.6f)
{
m_progress.fillAmount = 0.25f * progress/0.6f;
}
else if(progress > 0.6f && progress <= 0.7f)
{
m_progress.fillAmount = 0.25f + 0.25f * progress / 0.7f;
}
else if (progress > 0.7f && progress <= 0.8f)
{
m_progress.fillAmount = 0.5f + 0.25f * progress / 0.8f;
}
else
{
m_progress.fillAmount = 0.75f + 0.25f * progress;
}
for(int i = 0;i<m_progressStar.Length;i++)
{
m_progressStar[i].color = (progress >= 0.6f + 0.1f * i) ? m_fullColor : m_emptyColor;
}
}
}
......@@ -125,6 +125,7 @@ public class BombView : MonoBehaviour
}
m_lastRotateAngle = m_curRotateAngle;
}
BattleCtrl.instance.battleUI.SetProgress((m_totalChildNum - m_rootTrans.childCount) / (float)m_totalChildNum);
//Debug.LogError(m_rootTrans.childCount + "................." + m_totalChildNum);
if(m_bControlWin)
{
......
......@@ -260,7 +260,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &767122297
RectTransform:
m_ObjectHideFlags: 0
......@@ -2491,7 +2491,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 0.8078432, b: 0, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
......@@ -2509,7 +2509,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 19%
m_Text: 0%
--- !u!1 &2248306077269551934
GameObject:
m_ObjectHideFlags: 0
......@@ -3381,7 +3381,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
......@@ -4679,7 +4679,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
......@@ -5813,7 +5813,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &6064464676328073067
RectTransform:
m_ObjectHideFlags: 0
......@@ -7795,6 +7795,15 @@ MonoBehaviour:
m_starParent: {fileID: 7185521293347283414}
m_fullStarSprite: {fileID: 21300000, guid: 97c8f922c3e6319499aa73341532c22d, type: 3}
m_emptyStarSprite: {fileID: 21300000, guid: 0a396cfe59c396140ba692545106b732, type: 3}
m_fullColor: {r: 1, g: 0.80784315, b: 0, a: 1}
m_emptyColor: {r: 1, g: 1, b: 1, a: 1}
m_progress: {fileID: 9029007964578279029}
m_progressText: {fileID: 5850246138086231298}
m_leftBombNum: {fileID: 2466615569219931308}
m_progressStar:
- {fileID: 988923566153165421}
- {fileID: 2204141827806908431}
- {fileID: 6895604516909073123}
--- !u!114 &1995691973
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -9140,7 +9149,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 0.8064977, b: 0, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
......@@ -9150,7 +9159,7 @@ MonoBehaviour:
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 0
m_FillAmount: 0.247
m_FillAmount: 0
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
......@@ -14047,8 +14056,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 0.8078432, b: 0, a: 1}
m_RaycastTarget: 1
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
......@@ -14140,7 +14149,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: X10
m_Text: X3
--- !u!1 &7975587463478854421
GameObject:
m_ObjectHideFlags: 0
......@@ -14713,7 +14722,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.254717, g: 0.254717, b: 0.254717, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
......
......@@ -3,7 +3,7 @@ guid: e3138a12a89af3c4e836b1b9b6d78ad2
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
......@@ -46,7 +46,7 @@ TextureImporter:
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteBorder: {x: 10, y: 0, z: 10, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
......@@ -57,6 +57,7 @@ TextureImporter:
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
......
{
"dependencies": {
"com.unity.2d.sprite": "1.0.0",
"com.unity.collab-proxy": "1.2.16",
"com.unity.ide.rider": "1.1.4",
"com.unity.ide.vscode": "1.2.0",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment