131 lines
3.0 KiB
C#
131 lines
3.0 KiB
C#
|
using UnityEngine;
|
|||
|
using System.Collections;
|
|||
|
using GCGame.Table;
|
|||
|
|
|||
|
public class GuideStepNewFunc : GuideStepBase
|
|||
|
{
|
|||
|
public string BtnFuncName;
|
|||
|
public bool _IsExFunc;
|
|||
|
public int _SoundID;
|
|||
|
|
|||
|
private BtnFunc _CopyBtn;
|
|||
|
|
|||
|
public override void StartGuideStep()
|
|||
|
{
|
|||
|
base.StartGuideStep();
|
|||
|
|
|||
|
InitGuideUIGO();
|
|||
|
|
|||
|
ShowGuide();
|
|||
|
}
|
|||
|
|
|||
|
public override void FinishGuideStep()
|
|||
|
{
|
|||
|
GameObject.DestroyImmediate(_CopyGuideGO);
|
|||
|
base.FinishGuideStep();
|
|||
|
}
|
|||
|
|
|||
|
private void InitGuideUIGO()
|
|||
|
{
|
|||
|
//if (!FunctionButtonLogic.Instance())
|
|||
|
// return;
|
|||
|
|
|||
|
GameObject go = null;
|
|||
|
if (_IsExFunc)
|
|||
|
{
|
|||
|
if (FunctionExLogic.Instance())
|
|||
|
{
|
|||
|
go = FunctionExLogic.Instance().GetBtn(BtnFuncName, true);
|
|||
|
if (go == null)
|
|||
|
return;
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
go = GameObject.Find(BtnFuncName);
|
|||
|
if (go == null)
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
_GuideUIGO = go.gameObject;
|
|||
|
_CopyBtn = _GuideUIGO.GetComponent<BtnFunc>();
|
|||
|
|
|||
|
if (_SoundID > 0)
|
|||
|
{
|
|||
|
GameManager.gameManager.SoundManager.PlaySoundEffect(_SoundID);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
protected override void ShowGuide()
|
|||
|
{
|
|||
|
if (_GuideUIGO == null)
|
|||
|
{
|
|||
|
FinishGuideStep();
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
GuideLogic.Instance().SetForceBackActive(true);
|
|||
|
|
|||
|
|
|||
|
GuideLogic.Instance().ShowNewFuncInfo();
|
|||
|
|
|||
|
_CopyGuideGO = GameObject.Instantiate(_GuideUIGO);
|
|||
|
var redtip = _CopyGuideGO.transform.Find("RedPoint");
|
|||
|
if (redtip != null)
|
|||
|
{
|
|||
|
redtip.gameObject.SetActive(false);
|
|||
|
}
|
|||
|
|
|||
|
var scripts = _CopyGuideGO.GetComponentsInChildren<UnityEngine.UI.Button>(true);
|
|||
|
foreach (var script in scripts)
|
|||
|
{
|
|||
|
script.enabled = false;
|
|||
|
}
|
|||
|
//var scripts = copyUIGO.GetComponentsInChildren<MonoBehaviour>();
|
|||
|
//foreach (var script in scripts)
|
|||
|
//{
|
|||
|
// script.enabled = false;
|
|||
|
//}
|
|||
|
_CopyGuideGO.transform.SetParent(GuideLogic.Instance().transform);
|
|||
|
_CopyGuideGO.transform.position = GuideLogic.Instance()._FuncImage.transform.position;
|
|||
|
_CopyGuideGO.transform.localScale = Vector3.one;
|
|||
|
|
|||
|
StartCoroutine(MoveNewFunc());
|
|||
|
}
|
|||
|
|
|||
|
private IEnumerator MoveNewFunc()
|
|||
|
{
|
|||
|
if (_CopyBtn != null)
|
|||
|
{
|
|||
|
_CopyBtn.HideImage();
|
|||
|
}
|
|||
|
|
|||
|
yield return new WaitForSeconds(2.0f);
|
|||
|
|
|||
|
GuideLogic.Instance()._NewFuncInfo.SetActive(false);
|
|||
|
|
|||
|
if (_IsExFunc)
|
|||
|
{
|
|||
|
iTween.MoveTo(_CopyGuideGO, FunctionExLogic.Instance()._OpenBtn.transform.position, 1.0f);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
iTween.MoveTo(_CopyGuideGO, _GuideUIGO.transform.position, 1.0f);
|
|||
|
}
|
|||
|
|
|||
|
yield return new WaitForSeconds(1.2f);
|
|||
|
|
|||
|
FinishGuideStep();
|
|||
|
|
|||
|
if (_CopyBtn != null)
|
|||
|
{
|
|||
|
_CopyBtn.ShowImage();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
}
|