Beispiel #1
0
 public void Extend()
 {
     isOpen = !isOpen;
     if (isOpen && whoIsOpen != this)
     {
         if (whoIsOpen == null)
         {
             whoIsOpen = this;
         }
         else if (whoIsOpen.isOpen)
         {
             whoIsOpen.Extend();
             whoIsOpen = this;
         }
     }
     else if (isOpen == false)
     {
         whoIsOpen = null;
     }
     extAnim.SetBool("isOpen", isOpen);
 }
Beispiel #2
0
    IEnumerator tutorialEvent()
    {
        while (true)
        {
            yield return(new WaitForSeconds(2f));

            var moverButtonPosition = moverButton.GetComponent <RectTransform>().position + new Vector3(0, 75, 0);
            arrow.position = moverButtonPosition;
            arrow.gameObject.SetActive(true);
            yield return(upAndDown(4));

            moverButton.Select();
            yield return(new WaitForSeconds(.5f));

            eventSystem.SetSelectedGameObject(null);
            moverButtonClick.Extend();
            arrow.gameObject.SetActive(false);
            yield return(new WaitForSeconds(1f));

            arrow.gameObject.SetActive(true);
            var instructionPosition = instruction.position + new Vector3(0, 75, 0);
            var targetPlacePosition = targetPlace.position;
            arrow.position = instructionPosition;
            yield return(upAndDown(2));

            yield return(new WaitForSeconds(1f));

            var arrowParent = arrow.parent;
            var instance    = Instantiate(instantiatedInstruction, instruction.position, Quaternion.identity, targetPlace.parent);
            arrow.SetParent(instance.transform);
            yield return(Utils.LerpObject(instance.GetComponent <RectTransform>(), instructionPosition, targetPlacePosition, 1f));

            yield return(new WaitForSeconds(1f));

            arrow.SetParent(arrowParent);
            arrow.gameObject.SetActive(false);
            yield return(new WaitForSeconds(1f));

            arrow.gameObject.SetActive(true);
            var playButtonPosition = playButtonPlace.position + new Vector3(0, 75, 0);
            arrow.position = playButtonPosition;
            yield return(upAndDown(4));

            playButton.Select();
            yield return(new WaitForSeconds(.5f));

            eventSystem.SetSelectedGameObject(null);
            yield return(new WaitForSeconds(1f));

            yield return(Utils.LerpObject(catTransform, catTransform.position, catTransform.position + new Vector3(0, 2, 0), .2f));

            arrow.gameObject.SetActive(false);

            yield return(new WaitForSeconds(2f));

            SaveManager.SetFinishedTutorial(1);
            exitButton.SetActive(true);

            yield return(fadeOut());

            Destroy(instance);
            catTransform.position -= new Vector3(0, 2, 0);
            moverButtonClick.Extend();
            yield return(new WaitForSeconds(1f));

            yield return(fadeIn());
        }
    }