55 lines
1.7 KiB
C#
55 lines
1.7 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using ZXK.UTility;
|
|
/*******************************************************************************
|
|
*Create By CG
|
|
*Function Ê×Ò³½çÃæ¿ØÖÆ
|
|
*******************************************************************************/
|
|
namespace ZXK.ZPS
|
|
{
|
|
public class HomeManager : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private GameObject _typeGeoPrefab = null;
|
|
[SerializeField]
|
|
private GameObject _modelGeoPrefab = null;
|
|
|
|
private GameObject typeGeo = null;
|
|
|
|
private void Start()
|
|
{
|
|
GameRoot.Instance._CurModel = EnumCtrl.Model.Home;
|
|
GameRoot.Instance._CurFirstProcess = null;
|
|
GameRoot.Instance._CurSecondProcess = null;
|
|
|
|
if (GameRoot.Instance._CurType == EnumCtrl.Type.None)
|
|
{
|
|
ShowTypeSelect();
|
|
}
|
|
else
|
|
{
|
|
ShowModelSelect(GameRoot.Instance._CurType);
|
|
}
|
|
|
|
}
|
|
|
|
private void ShowTypeSelect()
|
|
{
|
|
typeGeo = Instantiate(_typeGeoPrefab, transform);
|
|
typeGeo.transform.SetSiblingIndex(transform.childCount-2);
|
|
TypePanelCtrl typeCtrl = typeGeo.GetComponent<TypePanelCtrl>();
|
|
typeCtrl.Init();
|
|
}
|
|
public void ShowModelSelect(EnumCtrl.Type type)
|
|
{
|
|
GameRoot.Instance._CurType = type;
|
|
if(typeGeo!=null)
|
|
Destroy(typeGeo);
|
|
GameObject modelGeo = Instantiate(_modelGeoPrefab, transform);
|
|
ModelPanelCtrl modelCtrl = modelGeo.GetComponent<ModelPanelCtrl>();
|
|
modelCtrl.Init();
|
|
}
|
|
|
|
}
|
|
} |