public Vector3 _humanInitRotation; //사람일 경우 초기방향 -> 정지버튼을 눌렀을때 해당 방향으로 쳐다봄 void Start() { _clickedItemControl = GameObject.Find("ClickedItemCanvas").GetComponent <ClickedItemControl>(); /* 사람 객체일 경우, Animator Controller 변수를 할당 해 주도록! */ if (_thisItem._originNumber >= 2000 && _thisItem._originNumber < 3000) { _animator = _thisItem.item3d.GetComponent <Animator>(); //사람객체의 초기위치를 기억시켜놓음 //초기위치는 _item의 포지션 //_humanInitPosition = this.gameObject.transform.parent.transform.localPosition; //사람객체의 초기방향을 기억시켜놓음 //초기방향은 _item.item3d의 로테이션 //_humanInitRotation = this.gameObject.transform.rotation; } _cameraMoveAron = GameObject.Find("CameraController").GetComponent <CameraMoveAroun>(); if (_thisItem._originNumber == 2001) //남 { this.gameObject.transform.parent.name = "Man" + _thisItem._objectNumber; } else if (_thisItem._originNumber == 2000) //테스트 { this.gameObject.transform.parent.name = "Daughter" + _thisItem._objectNumber; } else if (_thisItem._originNumber == 2002) //여 { this.gameObject.transform.parent.name = "Woman" + _thisItem._objectNumber; } else if (_thisItem._originNumber == 2003) { this.gameObject.transform.parent.name = "Woongin" + _thisItem._objectNumber; } }
// Use this for initialization void Start() { _clickedItemControl = GameObject.Find("ClickedItemCanvas").GetComponent <ClickedItemControl>(); /* 사람 객체일 경우, Animator Controller 변수를 할당 해 주도록! */ if (_thisItem._originNumber >= 2000 && _thisItem._originNumber < 3000) { _animator = _thisItem.item3d.GetComponent <Animator>(); _cameraMoveAron = GameObject.Find("CameraController").GetComponent <CameraMoveAroun>(); } }
IEnumerator Start() { yield return(new WaitForEndOfFrame()); Debug.Log("StartDBController.cs 시작"); _hiddenMenuControl = GameObject.Find("HiddenMenu").GetComponent <HiddenMenuControl>(); /* * HiddenMenu에서 TotalTable 설정(?)을 마침. */ yield return(StartCoroutine(_hiddenMenuControl.Hidden_Start())); foreach (string file in saveFileName) { //같은 파일 이름으로 key 값이 설정 되있어야함. if (playedDic.ContainsKey(file) && keyDic.ContainsKey(file)) { GameObject tmp = Instantiate(_sampleButton) as GameObject; tmp.name = file; //실행 횟수를 추가하기 위해 GameObject를 검색해야함. tmp.transform.GetChild(0).GetComponent <Text>().text = "<color=#0000ff>" + keyDic[file] + ". </color>" + file + " : <color=#ff0000>" + playedDic[file] + "</color>"; tmp.transform.GetChild(2).GetComponent <Text>().text = timeDic[file]; tmp.transform.SetParent(_saveContent); tmp.transform.localScale = new Vector3(0.9f, 0.9f, 1); _vrCanvas._saveFileName.Add(file); //VRCanvas DataBase 파일 이름 리스트에 추가 _vrAndroidCanvas._saveFileName.Add(file); //VRCanvas DataBase 파일 이름 리스트에 추가 } } StartCoroutine(_vrCanvas.Init()); //VRCanvas 초기화 코루틴 함수 실행 StartCoroutine(_vrAndroidCanvas.Init()); //VRCanvas 초기화 코루틴 함수 실행 _clickedItemControl = GameObject.Find("ClickedItemCanvas").GetComponent <ClickedItemControl>(); _currentSearch._fileTable = new Dictionary <int, Dictionary <string, GameObject> >(); _allSearch._fileTable = new Dictionary <string, List <GameObject> >(); yield return(StartCoroutine(_clickedItemControl.ClickedItem_Start())); _pathText.text = _filePath = "."; contentInfo.Add(0, _voiceContent); /* * Directory 컨텐츠 생성 */ foreach (string dir_name in directoryName) { if (!directoryString.ContainsKey(dir_name)) { continue; } int idx = directoryString[dir_name]; if (!directoryPoint.ContainsKey(idx)) { continue; } int prev_idx = directoryPoint[idx]; Transform _parent = _viewPort; Transform tmp_content = Instantiate(_content); if (!contentInfo.ContainsKey(idx)) { tmp_content.SetParent(_viewPort); tmp_content.name = dir_name; tmp_content.localScale = new Vector3(1, 1, 1); tmp_content.GetComponent <RectTransform>().localPosition = new Vector3(0, 0, 0); tmp_content.GetComponent <RectTransform>().offsetMax = new Vector2(0, 0); tmp_content.GetChild(0).GetComponent <VoiceDirectoryButton>()._key = idx; tmp_content.GetChild(0).GetComponent <VoiceDirectoryButton>()._prev_key = prev_idx; tmp_content.gameObject.SetActive(false); contentInfo.Add(idx, tmp_content); } } StartCoroutine(MakePath(0, "")); /* * Directory 버튼 생성 */ foreach (string dir_name in directoryName) { if (!directoryString.ContainsKey(dir_name)) { continue; } int idx = directoryString[dir_name]; if (!directoryPoint.ContainsKey(idx) || !contentInfo.ContainsKey(idx) || !directoryTime.ContainsKey(idx) || !directoryTime[idx].ContainsKey(dir_name)) { continue; } int prev_idx = directoryPoint[idx]; if (!contentInfo.ContainsKey(prev_idx) || !contentInfo.ContainsKey(idx)) { continue; } if (idx == 0 && prev_idx == 0) { continue; } Transform _parent = contentInfo[prev_idx]; if (prev_idx == 0) { _parent.gameObject.SetActive(true); } GameObject tmp_btn = Instantiate(_directorySampleBtn) as GameObject; tmp_btn.name = dir_name; tmp_btn.transform.SetParent(_parent); tmp_btn.transform.GetChild(0).GetComponent <Text>().text = dir_name; tmp_btn.transform.GetChild(2).GetComponent <Text>().text = directoryTime[idx][dir_name]; tmp_btn.transform.GetComponent <VoiceDirectoryButton>()._key = idx; tmp_btn.transform.GetComponent <VoiceDirectoryButton>()._prev_key = prev_idx; tmp_btn.transform.GetComponent <VoiceDirectoryButton>()._change_btn = false; tmp_btn.SetActive(true); tmp_btn.transform.localScale = new Vector3(0.9f, 0.9f, 1); string _lower = dir_name.ToLower(); if (!_currentSearch._fileTable.ContainsKey(prev_idx)) { Dictionary <string, GameObject> sg = new Dictionary <string, GameObject>(); _currentSearch._fileTable.Add(prev_idx, sg); } if (!_currentSearch._fileTable[prev_idx].ContainsKey(_lower)) { tmp_btn = Instantiate(_directorySampleBtn) as GameObject; tmp_btn.name = _lower; tmp_btn.transform.SetParent(_current_content); tmp_btn.transform.GetChild(0).GetComponent <Text>().text = dir_name; tmp_btn.transform.GetChild(2).GetComponent <Text>().text = directoryTime[idx][dir_name]; tmp_btn.transform.GetComponent <VoiceDirectoryButton>()._key = idx; tmp_btn.transform.GetComponent <VoiceDirectoryButton>()._prev_key = prev_idx; tmp_btn.transform.GetComponent <VoiceDirectoryButton>()._change_btn = false; tmp_btn.SetActive(false); tmp_btn.transform.localScale = new Vector3(0.9f, 0.9f, 1); _currentSearch._fileTable[prev_idx].Add(_lower, tmp_btn); } if (!_allSearch._fileTable.ContainsKey(_lower)) { _allSearch._fileTable[_lower] = new List <GameObject>(); } tmp_btn = Instantiate(_directorySampleBtn) as GameObject; tmp_btn.name = _lower; tmp_btn.transform.SetParent(_all_content); tmp_btn.transform.GetChild(0).GetComponent <Text>().text = dir_name; tmp_btn.transform.GetChild(2).GetComponent <Text>().text = directoryTime[idx][dir_name]; tmp_btn.transform.GetComponent <VoiceDirectoryButton>()._key = idx; tmp_btn.transform.GetComponent <VoiceDirectoryButton>()._prev_key = prev_idx; tmp_btn.transform.GetComponent <VoiceDirectoryButton>()._change_btn = false; tmp_btn.SetActive(false); tmp_btn.transform.localScale = new Vector3(0.9f, 0.9f, 1); _allSearch._fileTable[_lower].Add(tmp_btn); } /* * file 버튼 생성 */ foreach (string dir_name in directoryName) { if (!directoryString.ContainsKey(dir_name)) { continue; } int idx = directoryString[dir_name]; if (!fileInfo.ContainsKey(idx) || !fileTime.ContainsKey(idx) || !audioInfo.ContainsKey(idx)) { continue; } Transform _parent = contentInfo[idx]; foreach (string file_name in fileInfo[idx]) { string[] tmp_name = file_name.Split('.'); if (!fileTime[idx].ContainsKey(file_name) || !audioInfo[idx].ContainsKey(tmp_name[0])) { continue; } GameObject tmp_btn = Instantiate(_fileSampleBtn) as GameObject; tmp_btn.name = file_name; tmp_btn.transform.SetParent(_parent); tmp_btn.transform.GetChild(0).GetComponent <Text>().text = file_name; tmp_btn.transform.GetChild(2).GetComponent <Text>().text = fileTime[idx][file_name]; tmp_btn.GetComponent <AudioSource>().clip = audioInfo[idx][tmp_name[0]]; tmp_btn.GetComponent <VoiceFileButton>()._key = idx; tmp_btn.GetComponent <VoiceFileButton>()._file_name = tmp_name[0]; tmp_btn.SetActive(true); tmp_btn.transform.localScale = new Vector3(0.9f, 0.9f, 1); string _lower = file_name.ToLower(); if (!_currentSearch._fileTable.ContainsKey(idx)) { Dictionary <string, GameObject> sg = new Dictionary <string, GameObject>(); _currentSearch._fileTable.Add(idx, sg); } if (!_currentSearch._fileTable[idx].ContainsKey(_lower)) { tmp_btn = Instantiate(_fileSampleBtn) as GameObject; tmp_btn.name = _lower; tmp_btn.transform.SetParent(_current_content); tmp_btn.transform.GetChild(0).GetComponent <Text>().text = file_name; tmp_btn.transform.GetChild(2).GetComponent <Text>().text = fileTime[idx][file_name]; tmp_btn.GetComponent <AudioSource>().clip = audioInfo[idx][tmp_name[0]]; tmp_btn.GetComponent <VoiceFileButton>()._key = idx; tmp_btn.GetComponent <VoiceFileButton>()._file_name = tmp_name[0]; tmp_btn.SetActive(false); tmp_btn.transform.localScale = new Vector3(0.9f, 0.9f, 1); _currentSearch._fileTable[idx].Add(_lower, tmp_btn); } if (!_allSearch._fileTable.ContainsKey(_lower)) { _allSearch._fileTable[_lower] = new List <GameObject>(); } tmp_btn = Instantiate(_fileSampleBtn) as GameObject; tmp_btn.name = _lower; tmp_btn.transform.SetParent(_all_content); tmp_btn.transform.GetChild(0).GetComponent <Text>().text = file_name; tmp_btn.transform.GetChild(2).GetComponent <Text>().text = fileTime[idx][file_name]; tmp_btn.GetComponent <AudioSource>().clip = audioInfo[idx][tmp_name[0]]; tmp_btn.GetComponent <VoiceFileButton>()._key = idx; tmp_btn.GetComponent <VoiceFileButton>()._file_name = tmp_name[0]; tmp_btn.SetActive(false); tmp_btn.transform.localScale = new Vector3(0.9f, 0.9f, 1); _allSearch._fileTable[_lower].Add(tmp_btn); } } _allSearch.root = new AllSearch.Trie(); //idxInfo.Sort(); foreach (int i in idxInfo) { if (directoryInteger.ContainsKey(i)) { _allSearch.root.insert(directoryInteger[i] + '\0', 0); } if (fileInfo.ContainsKey(i)) { foreach (string str in fileInfo[i]) { _allSearch.root.insert(str + '\0', 0); } } } }
public GameObject _smallAniBarParent; //요약스케줄러 부모 /* 동적인 부분이기 때문에 GameObject.Find사용*/ public void Start() { _clickedItemControl = GameObject.Find("ClickedItemCanvas").GetComponent <ClickedItemControl>(); }
// Use this for initialization void Start() { _hideSwitch = false; //false면 눈에 보임, true면 눈에 안보임 _clickedItemControl = GameObject.Find("ClickedItemCanvas").GetComponent <ClickedItemControl>(); }