示例#1
0
        // Update is called once per frame
        void Update()
        {
            if (Input.GetKeyDown(KeyCode.C))
            {
                rootModel.ClearSteps();
                ready = true;
            }

            if (ready && Input.GetKeyDown(KeyCode.F))
            {
                rootModel.NextStep();
            }

            if (ready && Input.GetKeyDown(KeyCode.R))
            {
                rootModel.PreviousStep();
            }
        }
        public bool NextStep()
        {
            Transform currPart = transform.GetChild(currPartIdx);

            if (currPart.GetComponent <Step>() != null)
            {
                currPartIdx++;
            }

            for (; currPartIdx < transform.childCount; currPartIdx++)
            {
                currPart = transform.GetChild(currPartIdx);

                Step nextStep = currPart.GetComponent <Step>();
                if (nextStep != null)
                {
                    nextStep.PlayAnimations();
                    return(true);
                }

                SubModel nestedSubModel = currPart.GetComponent <SubModel>();
                if (nestedSubModel != null)
                {
                    nestedSubModel.transform.localPosition = nestedSubModel.startPosition;
                    if (!nestedSubModel.NextStep())
                    {
                        continue;
                    }
                    return(true);
                }

                currPart.gameObject.SetActive(true);
            }

            currPartIdx = transform.childCount - 1;
            return(false);
        }
示例#3
0
 public void NextStep()
 {
     rootModel.NextStep();
 }