您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
39 行
916 B
39 行
916 B
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Serialization;
|
|
using UnityEngine.UI;
|
|
|
|
namespace GameLobby.UI
|
|
{
|
|
[RequireComponent(typeof(Image))]
|
|
public class UITinter : MonoBehaviour
|
|
{
|
|
|
|
[SerializeField]
|
|
Color[] m_TintColors;
|
|
Image m_Image;
|
|
void Awake()
|
|
{
|
|
m_Image = GetComponent<Image>();
|
|
}
|
|
|
|
public void SetToColor(bool firstTwoColors)
|
|
{
|
|
int colorInt = firstTwoColors ? 1 : 0;
|
|
if (colorInt >= m_TintColors.Length)
|
|
return;
|
|
m_Image.color = m_TintColors[colorInt];
|
|
}
|
|
|
|
public void SetToColor(int colorInt)
|
|
{
|
|
if (colorInt >= m_TintColors.Length)
|
|
return;
|
|
m_Image.color = m_TintColors[colorInt];
|
|
}
|
|
}
|
|
|
|
|
|
}
|