public void NextBlock(string blockname)
    {
        flowchart.StopBlock(blockname);
        flowchart.ExecuteBlock(blockname);

        lastActiveBlock = blockname;
    }
Beispiel #2
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         effectImage.SetActive(false);
         FlowchartManager.instance.isTalking = false;
         flowchart.StopBlock("Crank");
     }
 }
Beispiel #3
0
    public IEnumerator Execute(Action onComplete = null)
    {
        if (onComplete != null)
        {
            _callback = onComplete;
        }
        yield return(new WaitForEndOfFrame());

        flowchart.StopBlock("Action");
        yield return(new WaitForEndOfFrame());

        flowchart.ExecuteBlock("Action");
    }
 private void OnTriggerExit2D(Collider2D other)
 {
     if (other.tag == "StairsPrompt")
     {
         flow.StopAllBlocks();
         flow.ExecuteBlock("Go To Stairs");
     }
     if (other.tag == "Computer")
     {
         flow.StopAllBlocks();
         flow.StopBlock("Menu Options");
     }
     if (other.tag == "Files")
     {
         flow.StopAllBlocks();
         flow.StopBlock("Menu Options");
     }
     if (other.tag == "Stairs")
     {
         flow.StopAllBlocks();
         flow.StopBlock("Menu Options");
     }
 }
    void Die()
    {
        if (SceneManager.GetActiveScene().name == "Tutorial")
        {
            flow.StopBlock("An escapee");
            flow.ExecuteBlock("Damn");
        }

        //    if(!died)
        //    {
        //        if (flow.GetIntegerVariable("EnemyCount") == 0)
        //        {

        //            flow.ExecuteBlock("SecondaryWeapon");
        //            flow.StopBlock("AttackDroid");
        //            player.GetComponent<Tutorials>().doors[1].SetActive(false);
        //            flow.SetIntegerVariable("EnemyCount", 1);
        //            player.GetComponent<Tutorials>().firstTimeSword = false;
        //            died = true;
        //            Destroy(gameObject);
        //        }
        //        else if (flow.GetIntegerVariable("EnemyCount") == 1)
        //        {

        //            flow.ExecuteBlock("ProjectXXXXX");
        //            flow.StopBlock("SecondaryWeapon");
        //            player.GetComponent<Tutorials>().doors[3].SetActive(false);
        //            flow.SetIntegerVariable("EnemyCount", 2);
        //            player.GetComponent<Tutorials>().firstTimeLongSword = false;
        //            died = true;
        //            Destroy(gameObject);

        //        }
        //        else if (flow.GetIntegerVariable("EnemyCount") == 2)
        //        {

        //            flow.ExecuteBlock("End");
        //            flow.StopBlock("DefeatTheDroid");
        //            player.GetComponent<Tutorials>().doors[5].SetActive(false);
        //            flow.SetIntegerVariable("EnemyCount", 3);
        //            died = true;
        //            Destroy(gameObject);
        //        }

        //    }

        //}

        //Instantiate(deathEffect, transform.position, Quaternion.identity);
        if (isBoss)
        {
            StartCoroutine(Wait());
            SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
            //(GameObject.Find("GameController")).GetComponent<GameOver>().BossDeath();
        }
        //player.GetComponent<Player>().AddExperience();
        player.GetComponent <Player>().counter++;
        //instantiatedDeath = (GameObject)Instantiate(deathEffect, transform.position, transform.rotation);
        Destroy(gameObject);

        Destroy(instantiatedDeath);
    }
    private void OnTriggerEnter2D(UnityEngine.Collider2D collision)
    {
        if (collision.gameObject.tag == "Sword")
        {
            Debug.Log("Tag the sword!");
            if (SceneManager.GetActiveScene().name == "Tutorial" && !flowChart.GetBooleanVariable("regswordpickup"))
            {
                music.GetComponent <AudioSource>().PlayOneShot(music.music.Find(x => x.name.Contains("ItemPickup")).clip, 0.5f);
                flowChart.ExecuteBlock("Pick up the Sword?");
                flowChart.SetBooleanVariable("regswordpickup", true);
            }
        }
        if (collision.gameObject.name == "Flavor1")
        {
            flowChart.StopBlock("Pick up the Sword?");
            flowChart.ExecuteBlock("Oh????");
        }
        if (collision.gameObject.name == "Flavor2")
        {
            flowChart.StopBlock("Pick up the Sword?");
            flowChart.ExecuteBlock("Will");
        }
        if (collision.gameObject.name == "Flavor3")
        {
            flowChart.StopBlock("Pick up the Sword?");
            flowChart.ExecuteBlock("What the");
        }
        if (collision.gameObject.name == "Flavor4")
        {
            flowChart.StopBlock("Pick up the Sword?");
            flowChart.ExecuteBlock("I wonder how");
        }
        if (collision.gameObject.name == "Flavor5")
        {
            flowChart.ExecuteBlock("The orbs are a trap");
        }
        if (collision.gameObject.name == "Flavor6")
        {
            flowChart.ExecuteBlock("IsThisTheEnd?");
        }
        if (collision.gameObject.name == "Flavor7")
        {
            flowChart.ExecuteBlock("And So It Begins");
        }

        //if (collision.gameObject.name == "Flavor4")
        //{
        //    flowChart.StopBlock("I wonder how");
        //    flowChart.ExecuteBlock("I wonder how");
        //}
        if (collision.gameObject.name == "Enemy" && flowChart.GetBooleanVariable("firstenemyTrigger"))
        {
            //flowChart.StopBlock("Pick up the Sword?");
            flowChart.ExecuteBlock("An escapee");
        }
        if (collision.gameObject.tag == "Health")
        {
            music.GetComponent <AudioSource>().PlayOneShot(music.music.Find(x => x.name.Contains("ItemPickup")).clip, 0.5f);
            //flowChart.StopBlock("I wonder how");
            flowChart.ExecuteBlock("Weird");
        }
        if (collision.gameObject.tag == "Stairs")
        {
            flowChart.ExecuteBlock("And So It Begins");
        }
    }