// Use this for initialization
    void Start()
    {
        UnityEngine.Events.UnityEvent ue = new UnityEngine.Events.UnityEvent();
        ue.AddListener(() =>
        {
            Debug.Log(1);
            boss.talking   = false;
            player.talking = true;
        });
        UnityEngine.Events.UnityEvent ue2 = new UnityEngine.Events.UnityEvent();
        ue2.AddListener(() =>
        {
            Debug.Log(2);
            boss.talking   = true;
            player.talking = false;
        });

        for (int i = 0; i < 2; ++i)
        {
            dialogTree.Current.DelegatePointer          = DelegatePointer.CreateInstance <DelegatePointer>();
            dialogTree.Current.DelegatePointer.Function = ue;
            dialogTree.MoveDown(0);
            dialogTree.Current.DelegatePointer          = DelegatePointer.CreateInstance <DelegatePointer>();
            dialogTree.Current.DelegatePointer.Function = ue2;
            dialogTree.MoveDown(0);
        }
        dialogTree.MoveDown(0);
        for (int i = 0; i < 2; ++i)
        {
            dialogTree.Current.DelegatePointer          = DelegatePointer.CreateInstance <DelegatePointer>();
            dialogTree.Current.DelegatePointer.Function = ue;
            dialogTree.MoveDown(0);
            dialogTree.Current.DelegatePointer          = DelegatePointer.CreateInstance <DelegatePointer>();
            dialogTree.Current.DelegatePointer.Function = ue2;
            dialogTree.MoveDown(0);
        }
        dialogTree.Current.DelegatePointer          = DelegatePointer.CreateInstance <DelegatePointer>();
        dialogTree.Current.DelegatePointer.Function = ue;
        dialogTree.MoveDown(0);
        //dialogTree.MoveDown(0);

        for (int i = 0; i < 2; ++i)
        {
            dialogTree.Current.DelegatePointer          = DelegatePointer.CreateInstance <DelegatePointer>();
            dialogTree.Current.DelegatePointer.Function = ue;
            dialogTree.MoveDown(0);
            dialogTree.Current.DelegatePointer          = DelegatePointer.CreateInstance <DelegatePointer>();
            dialogTree.Current.DelegatePointer.Function = ue2;
            dialogTree.MoveDown(0);
        }
        dialogTree.Current.DelegatePointer          = DelegatePointer.CreateInstance <DelegatePointer>();
        dialogTree.Current.DelegatePointer.Function = ue;
        dialogTree.MoveDown(0);
        dialogTree.Current.DelegatePointer          = DelegatePointer.CreateInstance <DelegatePointer>();
        dialogTree.Current.DelegatePointer.Function = new UnityEngine.Events.UnityEvent();
        dialogTree.Current.DelegatePointer.Function.AddListener(() => { Enable.SetActive(true); Disable.SetActive(false); });
    }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     m_dialogtree = Resources.Load <DialogTree>("Dialog/Droomba/DroombaImmobilizedTree");
     m_dialogtree.MoveDown(4);
     m_dialogtree.MoveDown(1);
     m_dialogtree.Current.DelegatePointer          = DelegatePointer.CreateInstance <DelegatePointer>();
     m_dialogtree.Current.DelegatePointer.Function = new UnityEngine.Events.UnityEvent();
     m_dialogtree.Current.DelegatePointer.Function.AddListener(() =>
     {
         UnityEngine.SceneManagement.Scene topdown = UnityEngine.SceneManagement.SceneManager.GetSceneByName("TopDownShooter");
         GetComponent <ChangeToTopDown>().Trigger();
         UnityEngine.SceneManagement.SceneManager.LoadScene("TopDownShooter");
         //foreach()
     }
                                                               );
 }