using System;
using System.Collections.Generic;
using UnityEngine.UI;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
public class StartState:ISceneState
{
public StartState(SceneStateController controller) : base("01StartScene",controller)
{
}
private Image mLogo;
private float mSmoothingSpeed = 1f;
private float mWaitTime = 2;//计时器
public override void StateStart()//寻找image
{
mLogo = GameObject.Find("Logo").GetComponent<Image>();
mLogo.color = Color.black;
}
public override void StateUpdate()
{
mLogo.color = Color.Lerp(mLogo.color, Color.white, mSmoothingSpeed * Time.deltaTime);
mWaitTime = Time.deltaTime;
if(mWaitTime <= 0)
{
mController.SetState(new MainMenuState(mController));//切换到主菜单
}
}
}
在开始场景得时候图片无限从黑到白然后反复循环,StartScene都不能加载完。