public void BigAnimationInfoSave(BigAniBar _info) { _info._animationName = this.gameObject.name; }
public void DeleteClick() { if (_smallAniBar.GetComponent <SmallAniBar>()._voice) { foreach (BigAniBar A in _itemListControl._dataBaseBigVoice) { Debug.Log("a = " + A); if (A == _bigAniBar.GetComponent <BigAniBar>()) { _itemListControl._dataBaseBigVoice.Remove(A); break; } } foreach (SmallAniBar A in _itemListControl._dataBaseSmallVoice) { if (A == _smallAniBar.GetComponent <SmallAniBar>()) { _itemListControl._dataBaseSmallVoice.Remove(A); break; } } } else { foreach (BigAniBar A in _itemListControl._dataBaseBigAnimation) { if (A == _bigAniBar.GetComponent <BigAniBar>()) { Debug.Log(1); _itemListControl._dataBaseBigAnimation.Remove(A); break; } } foreach (SmallAniBar A in _itemListControl._dataBaseSmallAnimation) { if (A == _smallAniBar.GetComponent <SmallAniBar>()) { Debug.Log(2); _itemListControl._dataBaseSmallAnimation.Remove(A); break; } } } if (_smallAniBar.GetComponent <SmallAniBar>()._voice) { BigAniBar _tmp = _bigAniBar.GetComponent <BigAniBar>(); SmallAniBar _tmp1 = _smallAniBar.GetComponent <SmallAniBar>(); float _barX = _tmp.gameObject.transform.localPosition.x; float _barWidth = _tmp1._aniBarWidth; string _voiceName = Static.STATIC._clickAniBar.transform.GetChild(0).GetComponent <Text>().text; int _dir_key = _tmp1._dir_key; int _originNumber = _tmp1._item._originNumber; string _parentName = ""; if (_originNumber == 2000) { _parentName = _tmp.transform.parent.transform.parent.name.Substring(0, 8); } if (_originNumber == 2001) { _parentName = _tmp.transform.parent.transform.parent.name.Substring(0, 3); } if (_originNumber == 2002) { _parentName = _tmp.transform.parent.transform.parent.name.Substring(0, 5); } HistoryController.pushAniBarVoiceDeleteHist(_barX, _barWidth, _voiceName, _parentName, _dir_key, _originNumber); } else { BigAniBar _tmp = _bigAniBar.GetComponent <BigAniBar>(); SmallAniBar _tmp1 = _smallAniBar.GetComponent <SmallAniBar>(); float _barX = _tmp.gameObject.transform.localPosition.x; float _barWidth = _tmp1._aniBarWidth; string _animationName = _tmp1._animationName; string _animationText = _tmp.transform.GetChild(0).GetComponent <Text>().text; int _moveOrState; int _actionOrFace; int _rotation; if (_tmp1._moveCheck) { _moveOrState = 1; } else { _moveOrState = 0; } if (_tmp1._actionOrFace) { _actionOrFace = 1; } else { _actionOrFace = 0; } if (_tmp1._rotation) { _rotation = 1; } else { _rotation = 0; } int _layerNumber = _tmp1._layerNumber; float _arriveX = _tmp1._arriveLocation.x; float _arriveY = _tmp1._arriveLocation.y; float _arriveZ = _tmp1._arriveLocation.z; int _originNumber = _tmp1._item._originNumber; string _parentName = ""; if (_originNumber == 2000) { _parentName = _tmp.transform.parent.transform.parent.name.Substring(0, 8); } if (_originNumber == 2001) { _parentName = _tmp.transform.parent.transform.parent.name.Substring(0, 3); } if (_originNumber == 2002) { _parentName = _tmp.transform.parent.transform.parent.name.Substring(0, 5); } HistoryController.pushAniBarDeleteHist(_barX, _barWidth, _animationName, _parentName, _animationText, _moveOrState, _actionOrFace, _layerNumber, _arriveX, _arriveY, _arriveZ, _originNumber, _rotation); } Destroy(_smallAniBar); Destroy(_bigAniBar); Static.STATIC._clickAniBar = null; this.transform.parent.parent.gameObject.SetActive(false); }
public void AddVoiceDB(BigAniBar _bigAniBar, SmallAniBar _smallAniBar) { _dataBaseBigVoice.Add(_bigAniBar); _dataBaseSmallVoice.Add(_smallAniBar); _voiceDBIndex++; }
/* ClickedItemMenu의 DeleteButton 눌렀을 경우*/ public void OnclickDeleteItem() { GameObject _schedulerController = GameObject.Find("Controllers").transform.GetChild(0).gameObject; if (_clickedItem._originNumber >= 2000 && _clickedItem._originNumber <= 2005) //즉 사람이면 스케줄러 삭제 실행 { HumanItem _history; _history = _clickedItem.item3d.GetComponent <ItemObject>()._thisHuman; if (_history._shirt != null) { _history._shirtName = _history._shirt.name; } if (_history._pant != null) { _history._pantName = _history._pant.name; } if (_history._shoes != null) { _history._shoesName = _history._shoes.name; } _schedulerController.GetComponent <SchedulerController>()._deleteObjectName = _clickedItem.item3d.transform.parent.gameObject.name; _schedulerController.GetComponent <SchedulerController>()._deleteObjectNmber = _clickedItem._objectNumber; Debug.Log("OnclickDeleteItem : " + _clickedItem.item3d.transform.parent.gameObject.name); GameObject _deleteSmallScheduler = GameObject.Find("Canvas").transform.GetChild(2).transform.GetChild(4).transform.GetChild(1).transform.GetChild(0).transform.GetChild(0).transform.GetChild(1).transform.Find(_clickedItem.item3d.transform.parent.gameObject.name).gameObject; GameObject _deleteBigScheduler = _deleteSmallScheduler.GetComponent <SmallSchedulerBar>()._bigScheduler; List <AniBarDelete> abd = new List <AniBarDelete>(); List <AniBarVoiceDelete> abvd = new List <AniBarVoiceDelete>(); for (int i = 0; i < _itemListControl._dataBaseSmallAnimation.Count; i++) { try { BigAniBar _tmp = _itemListControl._dataBaseBigAnimation[i]; SmallAniBar _tmp1 = _itemListControl._dataBaseSmallAnimation[i]; if (_tmp.transform.parent.transform.parent.name != _clickedItem.item3d.transform.parent.gameObject.name) { continue; } float _barX = _tmp.gameObject.transform.localPosition.x; float _barWidth = _tmp1._aniBarWidth; string _animationName = _tmp1._animationName; string _animationText = _tmp.transform.GetChild(0).GetComponent <Text>().text; string _parentName = _tmp.transform.parent.transform.parent.name; int _moveOrState; int _actionOrFace; int _rotation; if (_tmp1._moveCheck) { _moveOrState = 1; } else { _moveOrState = 0; } if (_tmp1._actionOrFace) { _actionOrFace = 1; } else { _actionOrFace = 0; } if (_tmp1._rotation) { _rotation = 1; } else { _rotation = 0; } int _layerNumber = _tmp1._layerNumber; float _arriveX = _tmp1._arriveLocation.x; float _arriveY = _tmp1._arriveLocation.y; float _arriveZ = _tmp1._arriveLocation.z; int _originNumber = _tmp1._item._originNumber; abd.Add(new AniBarDelete(_barX, _barWidth, _animationName, _parentName, _animationText, _moveOrState, _actionOrFace, _layerNumber, _arriveX, _arriveY, _arriveZ, _originNumber, _rotation)); } catch (Exception e) { Debug.Log(e); } } for (int i = 0; i < _itemListControl._dataBaseBigVoice.Count; i++) { try { BigAniBar _tmp = _itemListControl._dataBaseBigVoice[i]; SmallAniBar _tmp1 = _itemListControl._dataBaseSmallVoice[i]; if (_tmp.transform.parent.transform.parent.name != _clickedItem.item3d.transform.parent.gameObject.name) { continue; } float _barX = _tmp.gameObject.transform.localPosition.x; float _barWidth = _tmp1._aniBarWidth; string _voiceName = _tmp.transform.GetChild(0).GetComponent <Text>().text; int _dir_key = _tmp1._dir_key; int _originNumber = _tmp1._item._originNumber; string _parentName = ""; if (_originNumber == 2000) { _parentName = _tmp.transform.parent.transform.parent.name.Substring(0, 8); } if (_originNumber == 2001) { _parentName = _tmp.transform.parent.transform.parent.name.Substring(0, 3); } if (_originNumber == 2002) { _parentName = _tmp.transform.parent.transform.parent.name.Substring(0, 5); } if (_originNumber == 2003) { _parentName = _tmp.transform.parent.transform.parent.name.Substring(0, 7); } abvd.Add(new AniBarVoiceDelete(_barX, _barWidth, _voiceName, _parentName, _dir_key, _originNumber)); } catch (Exception e) { Debug.Log(e); } } /* DB에서 삭제해야 하는 부분 */ Debug.Log(abvd.Count); HistoryController.pushHumanDeleteHist(_clickedItem._originNumber, _clickedItem._objectNumber, _clickedItem.itemName, _clickedItem.item3d.transform.parent.transform.position, _clickedItem.item3d.transform.eulerAngles, _clickedItem.item3d.transform.parent.transform.localScale, abd, abvd, _history); _itemListControl.DeleteDBHuman(_clickedItem._objectNumber); _schedulerController.GetComponent <SchedulerController>().SchedulerDelete(); Debug.Log("사람 삭제"); } else { Debug.Log(_clickedItem.item3d.transform.parent.transform.eulerAngles); /* DB에서 삭제해야 하는 부분 */ HistoryController.pushObjectDeleteHist(_clickedItem._objectNumber, _clickedItem._originNumber, _clickedItem.itemName, _clickedItem.item3d.transform.parent.transform.position, _clickedItem.item3d.transform.parent.transform.eulerAngles, _clickedItem.item3d.transform.parent.transform.localScale); _itemListControl.DeleteDBitem(_clickedItem._objectNumber); Debug.Log("아이템 삭제"); } /* 아이템 파괴 */ Destroy(_clickedItem.item3d.transform.parent.gameObject); /* 메뉴 리셋 */ BasePanelReset(); ResetClickMenu(); ResetAnimationPanel(); ///* 카메라 제자리로 */ //_cameraMoveAron.CameraZoomOut(); /* * History * date : 2018-11-26 * author : Lugup * 내 용 : Item Deleted * 실행시 : 객체를 제거함 - 객체와 연결된 애니메이션, 스케쥴러의 내용 전부 삭제 * 취소시 : 제거했던 객체를 다시 불러옴, 객체와 연결됬던 애니메이션, 스케쥴러의 내용 전부 복구하는 작업. * */ }
/** * date 2018.07.23 * author Lugub * desc * AnimationBar를 List만들어서 DataBase저장용의 List를 만듬 * 객체와는 다르게 선언이 "List<AnimationBar>" 이기 때문에 스크립트 단위로 저장 * AddActionDB() - AnimationBar가 하나 생성되었을 때 이걸 리스트에 저장함. * DeleteActionDB() - AnimationBar를 삭제했을 경우 호출 */ public void AddActionDB(BigAniBar _bigAniBar, SmallAniBar _smallAniBar) { _dataBaseBigAnimation.Add(_bigAniBar); _dataBaseSmallAnimation.Add(_smallAniBar); _actionDBIndex++; }