示例#1
0
    // Update is called once per frame
    void Update()
    {
        if (!initmon)
        {
            if (Lists.IsActive() && MonInit.IsActive() && BattleMain3.IsActive())
            {
                //MonInv.AddMonster(MonInit.MakeFromPrefab(test));
                //MonInv.AddMonster(MonInit.MakeFromPrefab(test));

                initmon  = true;
                randopon = Lists.RandMon();
                randopon = MonInit.RandomFromPrefab(randopon);
                //randopon = MonInit.RandomFromPrefab(testopon);
                BattleMain3.SetMon(randopon);
                //you = MonInv.FirstActive();
                //you = MonInit.MakeFromPrefab(test);
                //you = new Monster.SubMonster(MonInv.FirstActive());

                //BattleMain3.SetYou(you);
                BattleMain3.TurnSet(true);
            }
        }
        else if (initmon)
        {
            gameObject.SetActive(false);
            //animation, activate BattleMain3, close this
        }
    }
示例#2
0
 public static void AddQueue(string ns)
 {
     instance.textbg.SetActive(true);
     instance.events.Enqueue(ns);
     if (instance.test == SM.S)
     {
         BattleMain3.TurnSet(false);
     }
 }
示例#3
0
    IEnumerator TextEvents()
    {
        while (true)
        {
            if (instance.test == SM.S)
            {
                if (!BattleMain3.TurnGet() && events.Count > 0 && cont)
                {
                    eventtext.text = events.Dequeue();
                    yield return(new WaitForSeconds(.5f));

                    while (!(Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Began) && !Input.GetKey(KeyCode.C))
                    {
                        yield return(new WaitForEndOfFrame());
                    }

                    if (events.Count == 0)
                    {
                        if (curdead)
                        {
                            cont = false;
                            StartCoroutine("DeadYou");
                        }

                        else if (!gohome && !goadventure && !curdead && !monturn && !youturn)
                        {
                            BattleMain3.TurnSet(true);
                            eventtext.text = "";
                            textbg.SetActive(false);
                        }
                        else if (goadventure)
                        {
                            SaveLoad.Save(SaveCallBack);
                            StartCoroutine("Fader", "Adventure");
                        }
                        else if (gohome)
                        {
                            SaveLoad.Save(SaveCallBack);
                            StartCoroutine("Fader", "TownTest");
                        }
                    }
                }
                else
                {
                    yield return(new WaitForSeconds(.01f));
                }
            }
            else
            {
                if (!BMMulti.TurnGet() && events.Count > 0 && cont)
                {
                    eventtext.text = events.Dequeue();
                    yield return(new WaitForSeconds(.5f));

                    while (!(Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Began) && !Input.GetKey(KeyCode.C))
                    {
                        yield return(new WaitForEndOfFrame());
                    }

                    if (events.Count == 0)
                    {
                        if (curdead)
                        {
                            cont = false;
                            StartCoroutine("DeadYou");
                        }

                        else if (!gohome && !goadventure && !curdead && !monturn && !youturn)
                        {
                            BMMulti.TurnSet(true);
                            eventtext.text = "";
                            textbg.SetActive(false);
                        }
                        else if (goadventure)
                        {
                            //SaveLoad.Save(SaveCallBack);
                            StartCoroutine("Fader", "Adventure");
                        }
                        else if (gohome)
                        {
                            //SaveLoad.Save(SaveCallBack);
                            StartCoroutine("Fader", "TownTest");
                        }
                    }
                }
                else
                {
                    yield return(new WaitForSeconds(.01f));
                }
            }
        }
    }