Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        if (storyManager == null)
        {
            storyManager = GameManagerManager.forestProgression;
        }
        if (cameraMover == null)
        {
            cameraMover = Camera.main.GetComponent <SwipeCamera> ();
        }
        if (goToBenchBtn == null)
        {
            goToBenchBtn = GameObject.Find("ToWorkshop");
        }
        if (kaPow == null)
        {
            kaPow = GameObject.Find("KAPOW");
        }
        if (dodo == null)
        {
            dodo = GameObject.Find("Dodo").GetComponent <DodoController> ();
        }
        if (buildKite == null)
        {
            buildKite = GameObject.Find("BigThoughtBubble").GetComponent <ThoughtBubble>();
        }

        wiggling = wiggleAround();
    }
Ejemplo n.º 2
0
    void Start()
    {
        damButton    = GameObject.Find("Cliff to Dam");
        bubbleScript = GetComponentInChildren <ThoughtBubble> ();
        audSrc       = GetComponent <AudioSource>();
        animator     = GetComponent <Animator>();
        GameObject tissueBox = transform.GetChild(0).gameObject;

        tissueBoxRenderer    = tissueBox.GetComponent <SpriteRenderer>();
        tissueBoxProgression = tissueBox.GetComponent <CliffProgression> ();
        progression          = GameManagerManager.forestProgression;
        if (progression.haveTissueBox())
        {
            animator.SetBool("hasBox", false);
        }
        else
        {
            StartCoroutine(BeginCliffDialog());
            enableSkipButton();
        }

        if (progression.haveBanjo())
        {
            int children = transform.childCount;
            for (int i = 0; i < children; i++)
            {
                Destroy(transform.GetChild(i).gameObject);
            }
            animator.SetBool("hasBanjo", true);
            CliffProgression.canBeginLevel = true;
            StartCoroutine(FinishCliffDialog());
        }
    }
Ejemplo n.º 3
0
    private void CreateThoughtBubble(int index)
    {
        Destroy(newBubble);

        newBubble = Instantiate(thoughtPrefab, transform.position, Quaternion.identity);

        primaryBubble = newBubble.transform.GetChild(0).gameObject;
        firstBubble   = newBubble.transform.GetChild(3).gameObject;

        joint.connectedBody = firstBubble.GetComponent <Rigidbody2D>();
        joint.distance      = 0.5f;
        joint.enabled       = true;

        Vector2 randomDir = Random.insideUnitCircle * speed;

        randomDir = new Vector2(randomDir.x, Mathf.Abs(randomDir.y));
        primaryBubble.GetComponent <Rigidbody2D>().AddForce(randomDir, ForceMode2D.Impulse);

        currentThought = thoughts[index];

        ThoughtBubble bubble = newBubble.GetComponent <ThoughtBubble>();


        bubble.timeBetweenImageChange = currentThought.timeBetweenImages;
        bubble.repeat = currentThought.repeat;
        bubble.images = currentThought.images;

        StartCoroutine(Delay(bubble.timeBetweenImageChange * bubble.images.Count + 1));

        if (newBubble.GetComponent <SortingGroup>())
        {
            newBubble.GetComponent <SortingGroup>().sortingLayerName = transform.parent.GetComponent <SortingGroup>().sortingLayerName;
        }
    }
Ejemplo n.º 4
0
    private void CreateSpeechBubble(Thought thought)
    {
        Destroy(newBubble);

        newBubble = Instantiate(speechPrefab, transform.position, Quaternion.identity);

        joint.connectedBody = newBubble.GetComponent <Rigidbody2D>();
        joint.distance      = 3f;
        joint.enabled       = true;

        tail         = newBubble.transform.GetChild(0).GetChild(1).GetChild(0);
        maintainTail = true;

        Vector2 randomDir = Random.insideUnitCircle * speed;

        randomDir = new Vector2(randomDir.x, Mathf.Abs(randomDir.y));
        newBubble.GetComponent <Rigidbody2D>().AddForce(randomDir, ForceMode2D.Impulse);

        ThoughtBubble bubble = newBubble.GetComponent <ThoughtBubble>();

        bubble.timeBetweenImageChange = thought.timeBetweenImages;
        bubble.repeat = thought.repeat;
        bubble.images = thought.images;
        if (transform.parent.GetComponent <SortingGroup>())
        {
            newBubble.GetComponent <SortingGroup>().sortingLayerName = transform.parent.GetComponent <SortingGroup>().sortingLayerName;
        }

        if (thought == question)
        {
            bubble.onEnd += OnQuestionAsked;
        }
    }
Ejemplo n.º 5
0
 protected override void setup()
 {
     tutorialTextBalloon.SetActive(true);
     ThoughtBubble.SetActive(false);
     firstGreenAdventurer.isMoving   = false;
     secondGreendAdventurer.isMoving = false;
     thirdGreenAdventurer.isMoving   = false;
     CrusherButton.GetComponent <Collider2D>().enabled = false;
 }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        Player player = FindObjectOfType <Player>();

        target        = (Transform)player.GetComponent(typeof(Transform));
        animator      = GetComponent <Animator>();
        thoughtBubble = (ThoughtBubble)GetComponentInChildren(typeof(ThoughtBubble));
        UpdateState(State.idle);
    }
Ejemplo n.º 7
0
 private void Step2()
 {
     steve.ChangeHunger(new List <AdventurerType>()
     {
         AdventurerType.GREEN, AdventurerType.BLUE, AdventurerType.BLUE, AdventurerType.BLUE
     });
     base.zoomCamera(1.5f, 1);
     tutorialText.text = "Steve is also ravenous.";
     ThoughtBubble.SetActive(true);
 }
Ejemplo n.º 8
0
 void Start()
 {
     bubble = FindObjectOfType <ThoughtBubble> ();
     Rover.OnCommandRunForFirstTime += OnCommandUsed;
     Rover.OnCommandsFinished       += OnCommandsFinished;
     Rover.OnStuck          += OnStuck;
     Rover.OnTopple         += OnTopple;
     Rover.OnBegin          += Rover_OnBegin;
     Rover.OnWin            += OnWin;
     Console.OnHelpMenuOpen += ClearThought;
 }
Ejemplo n.º 9
0
    private void Awake()
    {
        // This should work but it is not so going the longer way
        // navMeshAgent = navMeshAgent ?? GetComponent<NavMeshAgent>();
        if (navMeshAgent == null)
        {
            navMeshAgent = GetComponent <NavMeshAgent>();
        }

        thoughtBubble       = GetComponentInChildren <ThoughtBubble>();
        deathCamera.enabled = false;
    }
Ejemplo n.º 10
0
 // Use this for initialization
 void Start()
 {
     if (storyManager == null)
     {
         storyManager = GameManagerManager.forestProgression;
     }
     if (cameraMover == null)
     {
         cameraMover = Camera.main.GetComponent <SwipeCamera> ();
     }
     if (kaPow == null)
     {
         kaPow = GameObject.Find("KAPOW");
     }
     if (dodo == null)
     {
         dodo = GameObject.Find("Dodo").GetComponent <DodoDamController> ();
     }
     if (buildSlingshot == null)
     {
         buildSlingshot = GameObject.Find("BigThoughtBubble").GetComponent <ThoughtBubble>();
     }
 }
Ejemplo n.º 11
0
    // Use this for initialization
    void Start()
    {
        bubbleScript = transform.GetChild(0).GetComponent <ThoughtBubble> ();
        progression  = GameManagerManager.forestProgression;
        audSrc       = GetComponent <AudioSource>();
        animator     = GetComponent <Animator>();

        if (progression.haveSlingshot())
        {
            StartCoroutine(StartOutroDialog());
            int children = transform.childCount;

            for (int i = 0; i < children; i++)
            {
                Destroy(transform.GetChild(i).gameObject);
            }
        }
        else
        {
            enableSkipButton();
            StartCoroutine(StartIntroDialog());
        }
    }