Ejemplo n.º 1
0
    public void OnClick()
    {
        Debug.Log("MakingFace.cs 50번째 줄 : 표정 3");
        /* 버튼 클릭시, ClickedItem에 저장된 객체를 가져온다. */
        _3dObject = _clickedItemControl._clickedItem.item3d;

        _aniBarParent      = GameObject.Find("Canvas/ItemMenuCanvas/SchedulerMenu/Scroll View/Viewport/Content/BigScheduler");   //빅바스케줄러를 찾아감
        _smallAniBarParent = GameObject.Find("Canvas/ItemMenuCanvas/SchedulerMenu/Scroll View/Viewport/Content/SmallScheduler"); //스몰스케줄러를 찾아감

        GameObject _animationBar = Instantiate(Resources.Load("Prefab/Big")) as GameObject;

        _animationBar.GetComponent <Image>().color = new Color((float)212 / 255, (float)238 / 255, (float)204 / 255);
        _animationBar.transform.GetChild(1).GetComponent <Image>().color = new Color((float)212 / 255, (float)238 / 255, (float)204 / 255);
        _animationBar.transform.GetChild(2).GetComponent <Image>().color = new Color((float)212 / 255, (float)238 / 255, (float)204 / 255);

        GameObject _smallAnimationBar = Instantiate(Resources.Load("Prefab/Small")) as GameObject; //스몰 애니메이션 바를 생성

        _smallAnimationBar.GetComponent <Image>().color = new Color((float)212 / 255, (float)238 / 255, (float)204 / 255);
        if (_clickedItemControl._clickedItem._originNumber == 2001)
        {
            _aniBarParent      = _aniBarParent.transform.Find("Man" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(2).gameObject;
            _smallAniBarParent = _smallAniBarParent.transform.Find("Man" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(1).gameObject;
        }
        else if (_clickedItemControl._clickedItem._originNumber == 2000)
        {
            _aniBarParent      = _aniBarParent.transform.Find("Daughter" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(2).gameObject;
            _smallAniBarParent = _smallAniBarParent.transform.Find("Daughter" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(1).gameObject;
        }
        else
        {
            _aniBarParent      = _aniBarParent.transform.Find("Woman" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(2).gameObject;
            _smallAniBarParent = _smallAniBarParent.transform.Find("Woman" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(1).gameObject;
        }
        Debug.Log("MakingFace.cs 66줄 애니바 부모 이름 = " + _aniBarParent.name);
        _animationBar.transform.SetParent(_aniBarParent.transform, false);
        _smallAnimationBar.transform.SetParent(_smallAniBarParent.transform, false);
        _animationBar.transform.localPosition      = new Vector3(0, 0, 0); //위치 지정
        _smallAnimationBar.transform.localPosition = new Vector3(0, 0, 0); //새로운 부모에서의 로컬 위치 지정
        _animationBar.transform.GetComponent <BigAniBar>()._smallAniBar        = _smallAnimationBar;
        _smallAnimationBar.transform.GetComponent <SmallAniBar>()._bigAniBar   = _animationBar;
        _smallAnimationBar.transform.GetComponent <SmallAniBar>()._layerNumber = 5;
        _animationBar.transform.GetChild(0).GetComponent <Text>().text         = this.name;

        _smallAnimationBar.transform.GetComponent <SmallAniBar>()._item          = _clickedItemControl._clickedItem;
        _smallAnimationBar.transform.GetComponent <SmallAniBar>()._animationName = this.gameObject.name;
        _smallAnimationBar.transform.GetComponent <SmallAniBar>()._animationBar  = _animationBar; //smallAnimationBar는 animationBar에 의해서 움직이니 해당 애니메이션바를 저장

        for (int i = 0; i < 4; i++)
        {
            _smallAnimationBar.transform.GetComponent <SmallAniBar>()._face[i] = _face[i];
        }
        _itemListControl.AddActionDB(_animationBar.transform.GetComponent <BigAniBar>(), _smallAnimationBar.transform.GetComponent <SmallAniBar>());
        //HistoryController.pushAniBarCreateHist(_animationBar, _smallAnimationBar, this.gameObject.name, _clickedItemControl._clickedItem._objectNumber,1);
    }
Ejemplo n.º 2
0
    public void CreateAniBar(bool check)
    {
        _bigAniBarParent   = GameObject.Find("Canvas/ItemMenuCanvas/SchedulerMenu/Scroll View/Viewport/Content/BigScheduler");   //빅바스케줄러를 찾아감
        _smallAniBarParent = GameObject.Find("Canvas/ItemMenuCanvas/SchedulerMenu/Scroll View/Viewport/Content/SmallScheduler"); //스몰스케줄러를 찾아감

        /*빅애니바를 생성*/
        GameObject _bigAniBar = Instantiate(Resources.Load("Prefab/Big")) as GameObject;

        _bigAniBar.GetComponent <Image>().color = new Color(196 / 255.0f, 244 / 255.0f, 254 / 255.0f);                       //빅애니바의 색상을 변경
        _bigAniBar.transform.GetChild(1).GetComponent <Image>().color = new Color(196 / 255.0f, 244 / 255.0f, 254 / 255.0f); //왼쪽드래그바의 색상 변경
        _bigAniBar.transform.GetChild(2).GetComponent <Image>().color = new Color(196 / 255.0f, 244 / 255.0f, 254 / 255.0f); //오른쪽 드래그바의 색상 변경
                                                                                                                             // 빅애니바의 정보를 저장함
        BigAnimationInfoSave(_bigAniBar.transform.GetComponent <BigAniBar>());
        string str = this.name;

        _bigAniBar.gameObject.transform.GetChild(0).GetComponent <Text>().text = str;

        /*스몰애니바를 생성*/
        GameObject _smallAniBar = Instantiate(Resources.Load("Prefab/Small")) as GameObject;

        _smallAniBar.GetComponent <Image>().color = new Color(196 / 255.0f, 244 / 255.0f, 254 / 255.0f); //빅애니바의 색상을 변경
                                                                                                         // 스몰애니바의 정보를 저장함
        SmallAnimationInfoSave(_smallAniBar.transform.GetComponent <SmallAniBar>(), check);

        /*스케줄러에 도달했으니 해당 사람의 스케줄바를 찾음*/
        if (_clickedItemControl._clickedItem._originNumber == 2001)
        {
            _bigAniBarParent   = _bigAniBarParent.transform.Find("Man" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(5).gameObject;
            _smallAniBarParent = _smallAniBarParent.transform.Find("Man" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(4).gameObject;
        }
        else if (_clickedItemControl._clickedItem._originNumber == 2000)
        {
            _bigAniBarParent   = _bigAniBarParent.transform.Find("Daughter" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(5).gameObject;
            _smallAniBarParent = _smallAniBarParent.transform.Find("Daughter" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(4).gameObject;
        }
        else
        {
            _bigAniBarParent   = _bigAniBarParent.transform.Find("Woman" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(5).gameObject;
            _smallAniBarParent = _smallAniBarParent.transform.Find("Woman" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(4).gameObject;
        }

        /*빅애니바, 스몰애니바의 부모설정*/
        _bigAniBar.transform.SetParent(_bigAniBarParent.transform, false);
        _bigAniBar.transform.localPosition = new Vector3(0, 0, 0);   //부모를 지정해둔 뒤 위치를 새로 지정
        _smallAniBar.transform.SetParent(_smallAniBarParent.transform, false);
        _smallAniBar.transform.localPosition = new Vector3(0, 0, 0); //부모를 지정해둔 뒤 위치를 새로 지정

        _bigAniBar.transform.GetComponent <BigAniBar>()._smallAniBar   = _smallAniBar;
        _smallAniBar.transform.GetComponent <SmallAniBar>()._bigAniBar = _bigAniBar;


        _itemListControl.AddActionDB(_bigAniBar.transform.GetComponent <BigAniBar>(), _smallAniBar.transform.GetComponent <SmallAniBar>());
    }
Ejemplo n.º 3
0
    /* 클릭하면 중첩 애니메이션 <-> 단일 애니메이션 전환 */
    public void OnClickAction()
    {
        Debug.Log("MultiAnimation.cs 32번째 줄 : 부분 동작 2");
        _animator = _clickedItemControl._clickedItem.item3d.GetComponent <Animator>();

        _aniBarParent      = GameObject.Find("Canvas/ItemMenuCanvas/SchedulerMenu/Scroll View/Viewport/Content/BigScheduler");   //빅바스케줄러를 찾아감
        _smallAniBarParent = GameObject.Find("Canvas/ItemMenuCanvas/SchedulerMenu/Scroll View/Viewport/Content/SmallScheduler"); //스몰스케줄러를 찾아감

        GameObject _animationBar = Instantiate(Resources.Load("Prefab/Big")) as GameObject;                                      //애니메이션 바를 생성

        _animationBar.GetComponent <Image>().color = new Color((float)252 / 255, (float)198 / 255, (float)247 / 255);
        _animationBar.transform.GetChild(1).GetComponent <Image>().color = new Color((float)252 / 255, (float)198 / 255, (float)247 / 255);
        _animationBar.transform.GetChild(2).GetComponent <Image>().color = new Color((float)252 / 255, (float)198 / 255, (float)247 / 255);
        //보이스 색상은 202 233 189 로 지정

        GameObject _smallAnimationBar = Instantiate(Resources.Load("Prefab/Small")) as GameObject; //스몰 애니메이션 바를 생성

        _smallAnimationBar.GetComponent <Image>().color = new Color((float)252 / 255, (float)198 / 255, (float)247 / 255);

        if (_clickedItemControl._clickedItem._originNumber == 2001)
        {
            _aniBarParent      = _aniBarParent.transform.Find("Man" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(3).gameObject;
            _smallAniBarParent = _smallAniBarParent.transform.Find("Man" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(2).gameObject;
        }
        else if (_clickedItemControl._clickedItem._originNumber == 2000)
        {
            _aniBarParent      = _aniBarParent.transform.Find("Daughter" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(3).gameObject;
            _smallAniBarParent = _smallAniBarParent.transform.Find("Daughter" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(2).gameObject;
        }
        else if (_clickedItemControl._clickedItem._originNumber == 2002)
        {
            _aniBarParent      = _aniBarParent.transform.Find("Woman" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(3).gameObject;
            _smallAniBarParent = _smallAniBarParent.transform.Find("Woman" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(2).gameObject;
        }
        else
        {
            _aniBarParent      = _aniBarParent.transform.Find("Woongin" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(3).gameObject;
            _smallAniBarParent = _smallAniBarParent.transform.Find("Woongin" + (_clickedItemControl._clickedItem._objectNumber)).transform.GetChild(2).gameObject;
        }

        /*빅애니바, 스몰애니바의 부모설정*/
        _animationBar.transform.SetParent(_aniBarParent.transform, false);
        _animationBar.transform.localPosition = new Vector3(0, 0, 0);      //부모를 지정해둔 뒤 위치를 새로 지정
        _smallAnimationBar.transform.SetParent(_smallAniBarParent.transform, false);
        _smallAnimationBar.transform.localPosition = new Vector3(0, 0, 0); //부모를 지정해둔 뒤 위치를 새로 지정

        _animationBar.transform.GetComponent <BigAniBar>()._smallAniBar       = _smallAnimationBar;
        _smallAnimationBar.transform.GetComponent <SmallAniBar>()._bigAniBar  = _animationBar;
        _animationBar.transform.GetComponent <BigAniBar>()._thisAniBar        = _animationBar;
        _smallAnimationBar.transform.GetComponent <SmallAniBar>()._thisAniBar = _smallAnimationBar;
        SmallAnimationInfoSave(_smallAnimationBar.GetComponent <SmallAniBar>(), false);

        _itemListControl.AddActionDB(_animationBar.transform.GetComponent <BigAniBar>(), _smallAnimationBar.transform.GetComponent <SmallAniBar>());
        Debug.Log(_itemListControl._actionDBIndex);

        _animationBar.transform.GetComponent <BigAniBar>()._animationName     = _smallAnimationBar.transform.GetComponent <SmallAniBar>()._animationName;
        _smallAnimationBar.transform.GetComponent <SmallAniBar>()._anibarName = _smallAnimationBar.transform.GetComponent <SmallAniBar>()._animationName + _itemListControl._actionDBIndex.ToString();
        _animationBar.transform.GetComponent <BigAniBar>()._anibarName        = _smallAnimationBar.transform.GetComponent <SmallAniBar>()._anibarName;
        _smallAnimationBar.gameObject.name = _smallAnimationBar.transform.GetComponent <SmallAniBar>()._anibarName;
        _animationBar.gameObject.name      = _smallAnimationBar.gameObject.name;

        _animationBar.transform.GetChild(0).GetComponent <Text>().text = _smallAnimationBar.gameObject.name;
        Debug.Log("UpperAnimation.cs _anibarName : " + _smallAnimationBar.transform.GetComponent <SmallAniBar>()._anibarName);

        HistoryController.pushAniBarCreateHist(_animationBar, _smallAnimationBar, _smallAnimationBar.transform.GetComponent <SmallAniBar>()._animationName, _animationBar.gameObject.name,
                                               _clickedItemControl._clickedItem._objectNumber, 1);

        /*
         * History
         * date   : 2018-11-26
         * author : Lugup
         * 내  용 : AnimationStatus change
         * 실행시 : 현재 상태의 애니메이션을 바꿈
         * 취소시 : 현재 상태의 애니메이션을 바꿈
         *
         */
    }