93 lines
2.9 KiB
C#
93 lines
2.9 KiB
C#
using CG.Framework;
|
|
using CG.UTility;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
/*******************************************************************************
|
|
*Create By CG
|
|
*Function 部件拆装场景控制
|
|
*******************************************************************************/
|
|
namespace ZXK.GYJQR
|
|
{
|
|
public class BJCZSceneCtrl : MonoBehaviour
|
|
{
|
|
public static BJCZSceneCtrl _Instance = null;
|
|
|
|
private AcquaintPartCtrl _acquaintCtrl = null;
|
|
private AllSplitCtrl _allSplitCtrl = null;
|
|
private OrderSplitCtrl _orderSplitCtrl = null;
|
|
private SchematicCtrl _schematicCtrl = null;
|
|
|
|
|
|
[ReadOnly]//是否正在播放拆解动画
|
|
public bool _isPlaySplitAnm = false;
|
|
|
|
[ReadOnly]//部件认知时独显物体
|
|
public GameObject _OnlyShowGeo = null;
|
|
|
|
private void Awake()
|
|
{
|
|
if (_Instance == null)
|
|
{
|
|
_Instance = this;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 切换不同状态和不同模型调用
|
|
/// </summary>
|
|
public void ModelAndStateChanged()
|
|
{
|
|
if (_acquaintCtrl == null)
|
|
{
|
|
_acquaintCtrl = transform.GetComponentInChildren<AcquaintPartCtrl>(true);
|
|
}
|
|
if (_allSplitCtrl == null)
|
|
{
|
|
_allSplitCtrl = transform.GetComponentInChildren<AllSplitCtrl>(true);
|
|
}
|
|
if (_orderSplitCtrl == null)
|
|
{
|
|
_orderSplitCtrl = transform.GetComponentInChildren<OrderSplitCtrl>(true);
|
|
}
|
|
if (_schematicCtrl == null)
|
|
{
|
|
_schematicCtrl = transform.GetComponentInChildren<SchematicCtrl>(true);
|
|
}
|
|
_acquaintCtrl?.End();
|
|
_allSplitCtrl?.End();
|
|
_orderSplitCtrl?.End();
|
|
_schematicCtrl?.End();
|
|
switch ((EnumCtrl.BJCZState)GameManager.Instance._DataBJCJHandler._CurState.Value)
|
|
{
|
|
case EnumCtrl.BJCZState.BJRZ:
|
|
_acquaintCtrl?.Enter();
|
|
break;
|
|
case EnumCtrl.BJCZState.YJCJ:
|
|
_allSplitCtrl?.EnterYJCJ();
|
|
break;
|
|
case EnumCtrl.BJCZState.YJPZ:
|
|
_allSplitCtrl?.EnterYJPZ();
|
|
break;
|
|
case EnumCtrl.BJCZState.SXCJ:
|
|
_orderSplitCtrl?.Enter();
|
|
break;
|
|
case EnumCtrl.BJCZState.YLSY:
|
|
_schematicCtrl?.Enter();
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 部件认知中双击
|
|
/// </summary>
|
|
/// <param name="showGroupName"></param>
|
|
/// <param name="geoName"></param>
|
|
public void DoubleClick(string showGroupName, string geoName)
|
|
{
|
|
_acquaintCtrl.DoubleClickShow(showGroupName, geoName);
|
|
}
|
|
}
|
|
} |