using System; using System.Collections.Generic; using System.IO; using Kasizuki; using UnityEngine; public class VRIKGeneralObjectSetter : MonoBehaviour { private NGUIWindow window { get { return this.m_Window = (this.m_Window ?? base.GetComponent()); } } private void Awake() { this.window.OnOpen = new Action(this.OnOpen); this.m_FullPathList = OvrIK.UpdateGeneralModelFileList(); this.CreateList(); UIButton component = UTY.GetChildObject(this.window.gameObject, "data list window/button reload", false).GetComponent(); UIButton component2 = UTY.GetChildObject(this.window.gameObject, "data list window/button delete", false).GetComponent(); EventDelegate.Add(component.onClick, new EventDelegate.Callback(this.OnClickReload)); EventDelegate.Add(component2.onClick, new EventDelegate.Callback(this.OnClickDelete)); } private void OnOpen() { } private void CreateList() { List fullPathList = this.m_FullPathList; this.m_WindowListData.Show(fullPathList, delegate(int index, string path, UIButton button) { UILabel componentInChildren = button.GetComponentInChildren(); if (componentInChildren != null) { componentInChildren.text = Path.GetFileName(path); } EventDelegate.Add(button.onClick, delegate() { OvrIK.LoadGeneralModelFile(path); }); }); Debug.Log("[VRIK_GeneralObjectSetter] 一般オブジェクト一覧の読み込み完了\n要素数 : " + fullPathList.Count); } private void OnClickReload() { this.m_FullPathList = OvrIK.UpdateGeneralModelFileList(); this.CreateList(); } private void OnClickDelete() { OvrIK.DestroyGeneralModelAll(); } [SerializeField] private ListViewerWindow m_WindowListData; private NGUIWindow m_Window; private List m_FullPathList = new List(); }