start画面button颜色动画添加
start画面button颜色动画添加 button颜色Changer修改为通用。
This commit is contained in:
+4
-4
@@ -5,7 +5,7 @@ using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class TargetButtonActivateColorChanger : MonoBehaviour
|
||||
public class ButtonActivateColorChanger : MonoBehaviour
|
||||
{
|
||||
public List<Button> clickableButton = new List<Button>();
|
||||
public List<Button> unclickableButton = new List<Button>();
|
||||
@@ -133,7 +133,7 @@ public class TargetButtonActivateColorChanger : MonoBehaviour
|
||||
/// </summary>
|
||||
/// <param name="btn">The button object to add to the button list.</param>
|
||||
/// <param name="clickable">Indicates whether the button is clickable.</param>
|
||||
public void AddButtonToColorChangerButtonList(Button btn,bool clickable)
|
||||
public void AddButtonToColorChangerButtonList(Button btn, bool clickable)
|
||||
{
|
||||
if (clickable)
|
||||
{
|
||||
@@ -149,7 +149,7 @@ public class TargetButtonActivateColorChanger : MonoBehaviour
|
||||
|
||||
public void InitializeAllButtonColor()
|
||||
{
|
||||
foreach(Button btn in clickableButton)
|
||||
foreach (Button btn in clickableButton)
|
||||
{
|
||||
btn.image.color = normalBGColor;
|
||||
btn.GetComponentInChildren<TextMeshProUGUI>().color = normalTextColor;
|
||||
@@ -160,4 +160,4 @@ public class TargetButtonActivateColorChanger : MonoBehaviour
|
||||
btn.GetComponentInChildren<TextMeshProUGUI>().color = disableTextColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48f605c5c3d09384fa6b248789466476
|
||||
guid: 3ca7ca2329898e343bafa8ba9db0cbb0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -256,7 +256,7 @@ public class TargetController : MonoBehaviour
|
||||
/// </remarks>
|
||||
private void RandomSpawnSceneBlock(SceneBlockContainer.Targets targetType)
|
||||
{
|
||||
randLevel = GetRandomLevelIndex(targetType);
|
||||
randLevel = RollRandomLevelIndex(targetType);
|
||||
randBlockType = Random.Range(0, sceneBlockCon.scenePrefabSet.GetBlockNumber(targetType,randLevel));
|
||||
sceneBlockSize = sceneBlockCon.scenePrefabSet.GetBlockSize(targetType, randLevel, randBlockType);
|
||||
|
||||
@@ -638,7 +638,7 @@ public class TargetController : MonoBehaviour
|
||||
/// </summary>
|
||||
/// <param name="target">The target type.</param>
|
||||
/// <returns>A random level index.</returns>
|
||||
public int GetRandomLevelIndex(SceneBlockContainer.Targets target)
|
||||
public int RollRandomLevelIndex(SceneBlockContainer.Targets target)
|
||||
{
|
||||
List<float> targetProbs;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class TargetUIController : MonoBehaviour
|
||||
private EnvironmentUIControl envUICon;
|
||||
private TargetController targetCon;
|
||||
private MessageBoxController messageBoxController;
|
||||
private TargetButtonActivateColorChanger buttonColorChanger;
|
||||
private ButtonActivateColorChanger buttonColorChanger;
|
||||
|
||||
public enum PrimaryButtonType
|
||||
{ Goto, Attack, Free }
|
||||
@@ -47,7 +47,7 @@ public class TargetUIController : MonoBehaviour
|
||||
mouseInMapCon = mouseSelectorObj.GetComponent<MouseInMap>();
|
||||
envUICon = environmentUIObj.GetComponent<EnvironmentUIControl>();
|
||||
messageBoxController = GetComponent<MessageBoxController>();
|
||||
buttonColorChanger = GetComponent<TargetButtonActivateColorChanger>();
|
||||
buttonColorChanger = GetComponent<ButtonActivateColorChanger>();
|
||||
|
||||
gotoLevelPanel.GetComponent<LevelPanel>().InitLevelPanel(
|
||||
targetCon.gotoLevelNum,
|
||||
|
||||
@@ -11,6 +11,7 @@ public class StartUIManager : MonoBehaviour
|
||||
public TextMeshProUGUI waitTimeTextObj;
|
||||
private SceneLoader sceneLoader;
|
||||
private StartSeneData startSceneData;
|
||||
private ButtonActivateColorChanger buttonActivateColorChanger;
|
||||
private float startTime;
|
||||
private float nowTime;
|
||||
// Start is called before the first frame update
|
||||
@@ -18,7 +19,9 @@ public class StartUIManager : MonoBehaviour
|
||||
{
|
||||
sceneLoader = sceneLoaderObj.GetComponent<SceneLoader>();
|
||||
startSceneData = startSceneDataObj.GetComponent<StartSeneData>();
|
||||
buttonActivateColorChanger = GetComponent<ButtonActivateColorChanger>();
|
||||
messageTextObj.text = "";
|
||||
buttonActivateColorChanger.InitializeAllButtonColor();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
||||
Reference in New Issue
Block a user