12345678910111213141516171819202122232425262728293031323334353637 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using XRTool.Util;
- public class Mp4List : UnitySingleton<Mp4List>
- {
- public GameObject mp4Item;
- public void AddItem(FileConfig fileConfig)
- {
- if (RoomFile.Instance.FilePrefabConfigList.Contains(fileConfig))
- {
- RoomFile.IfFilePrefabConfigListAction?.Invoke(fileConfig);
- }
- else
- {
- RoomFile.Instance.FilePrefabConfigList.Add(fileConfig);
- GameObject obj = Instantiate(mp4Item, transform) as GameObject;
- obj.transform.GetComponent<Mp4Item>().Init(fileConfig);
- obj.transform.position = RoomFile.Instance.Mp4Point.position + new Vector3(0f, (- obj.transform.GetSiblingIndex() * 0.013f), 0f);
- obj.transform.eulerAngles = RoomFile.Instance.Mp4Point.eulerAngles;
- RoomFile.IfFilePrefabConfigListAction?.Invoke(fileConfig);
- }
- }
- public void DeleteAll()
- {
- if (transform.childCount > 0)
- {
- for (int i = 0; i < transform.childCount; i++)
- {
- Destroy(transform.GetChild(i).gameObject);
- }
- }
- }
- }
|