CQ_Intelligent-Technology-T.../Assets/Scripts/Furniture_Manager.cs

156 lines
4.5 KiB
C#

using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
/// <summary>
/// 소야밗잿
/// </summary>
public class Furniture_Manager : MonoBehaviour
{
public static Furniture_Manager Instance;
/// <summary>
/// 뻔쓱왠齡
/// </summary>
public Transform Environment;
/// <summary>
/// 빳젬
/// </summary>
public Transform Interconnection;
/// <summary>
/// 例콘소든
/// </summary>
public Transform Intelligent;
private void Awake()
{
Instance = this;
}
void Start()
{
}
void Update()
{
}
/// <summary>
/// 꿴冷소야list
/// </summary>
/// <param name="name">혐堵츰냔</param>
/// <param name="type">소야잚謹</param>
/// <returns></returns>
public List<Transform> FindHomes(string name, string type)
{
List<Transform> list = new List<Transform>();
switch (name)
{
case "뻔쓱":
list = FindtypeHomes(type, Environment);
break;
case "빳젬":
list = FindtypeHomes(type, Interconnection);
break;
case "소든":
list = FindtypeHomes(type, Intelligent);
break;
}
return list;
}
/// <summary>
/// 꿴冷뚤壇돨소야
/// </summary>
/// <param name="type">소야잚謹</param>
/// <param name="typetransform">뚤壇혐堵잚謹</param>
/// <returns></returns>
private List<Transform> FindtypeHomes(string type, Transform typetransform)
{
List<ClickModelType> temp = new List<ClickModelType>();
temp = typetransform.GetComponentsInChildren<ClickModelType>().ToList();
List<Transform> list = new List<Transform>();
for (int i = 0; i < temp.Count; i++)
{
if (type == "됐" && temp[i].typeoffurniture == Typeoffurniture.)
{
list.Add(temp[i].transform);
}
if (type == "왕딧" && temp[i].typeoffurniture == Typeoffurniture.)
{
list.Add(temp[i].transform);
}
if (type == "눗졈" && temp[i].typeoffurniture == Typeoffurniture.)
{
list.Add(temp[i].transform);
}
if (type == "눗빵" && temp[i].typeoffurniture == Typeoffurniture.)
{
list.Add(temp[i].transform);
}
if (type == "든柬" && temp[i].typeoffurniture == Typeoffurniture.)
{
list.Add(temp[i].transform);
}
}
return list;
}
/// <summary>
/// 꿴冷소야list
/// </summary>
/// <param name="name">혐堵츰냔</param>
/// <param name="type">소야잚謹</param>
/// <returns></returns>
public Transform FindHome(string name, string type)
{
Transform transform = null;
switch (name)
{
case "뻔쓱":
transform = FindtypeHome(type, Environment);
break;
case "빳젬":
transform = FindtypeHome(type, Interconnection);
break;
case "소든":
transform = FindtypeHome(type, Intelligent);
break;
}
return transform;
}
/// <summary>
/// 꿴冷뚤壇돨소야
/// </summary>
/// <param name="type">소야잚謹</param>
/// <param name="typetransform">뚤壇혐堵잚謹</param>
/// <returns></returns>
private Transform FindtypeHome(string type, Transform typetransform)
{
List<ClickModelType> temp = new List<ClickModelType>();
temp = typetransform.GetComponentsInChildren<ClickModelType>().ToList();
Transform list = null;
for (int i = 0; i < temp.Count; i++)
{
if (type == "됐" && temp[i].typeoffurniture == Typeoffurniture.)
{
list = temp[i].transform;
}
if (type == "왕딧" && temp[i].typeoffurniture == Typeoffurniture.)
{
list = temp[i].transform;
}
if (type == "눗졈" && temp[i].typeoffurniture == Typeoffurniture.)
{
list = temp[i].transform;
}
if (type == "눗빵" && temp[i].typeoffurniture == Typeoffurniture.)
{
list = temp[i].transform;
}
if (type == "든柬" && temp[i].typeoffurniture == Typeoffurniture.)
{
list = temp[i].transform;
}
}
return list;
}
}