38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class PeiDianShiDianGuiParent : MonoBehaviour
|
|
{
|
|
public static PeiDianShiDianGuiParent Instance;
|
|
public List<PeiDianShiDianGui> dianShiDianGuiList = new List<PeiDianShiDianGui>();
|
|
private void Start()
|
|
{
|
|
Instance = this;
|
|
var dianGuiArray = GetComponentsInChildren<PeiDianShiDianGui>();
|
|
foreach (PeiDianShiDianGui item in dianGuiArray)
|
|
{
|
|
dianShiDianGuiList.Add(item);
|
|
}
|
|
}
|
|
|
|
public void CameraShow(string type, string name)
|
|
{
|
|
for (int i = 0; i < dianShiDianGuiList.Count; i++)
|
|
{
|
|
if (dianShiDianGuiList[i].name.Contains(type))
|
|
{
|
|
var electric = dianShiDianGuiList[i].GetComponent<PeiDianShiDianGui>().electric;
|
|
for (int j = 0; j < electric.Count; j++)
|
|
{
|
|
if (electric[j].name.Contains(name))
|
|
{
|
|
dianShiDianGuiList[i].GetComponent<PeiDianShiDianGui>().MoveCamera(dianShiDianGuiList[i].GetComponent<PeiDianShiDianGui>().electricCamPos[j], j);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|