Esempio n. 1
0
    //called from GameManager.cs
    public void SpawnArbeauWinLose(int index, string type)
    {
        GameObject win;

        win = (GameObject)Instantiate(arbeau, new Vector2(0f, 0f), transform.rotation);
        win.transform.SetParent(GameObject.Find("Canvas").transform, false);

        win.transform.localPosition = RandomizePosition(index);

        CloseWindow   closeButton = win.transform.GetChild(3).GetComponent <CloseWindow>();
        List <string> contextList = new List <string>();

        win.name = "Arbeau " + type + " Window " + index;

        if (type.Equals("Win"))
        {
            contextList = GetWin(index);
            closeButton.SetTextList(contextList);
        }

        else if (type.Equals("Lose"))
        {
            contextList = GetLose(index);
            closeButton.SetTextList(contextList);
        }
    }
Esempio n. 2
0
    IEnumerator SpawnWindow()
    {
        gameMan.SetLoadingCursor(2);
        yield return(new WaitForSeconds(0.75f));

        GameObject winObj;

        winObj = (GameObject)Instantiate(window, new Vector2(0f, 0f), transform.rotation);
        winObj.transform.SetParent(GameObject.Find("Canvas").transform, false);
        winObj.transform.localPosition = new Vector2(-130f, 0f);

        if (winObjName.Length > 0)
        {
            winObj.name = winObjName;
        }

        //unopened = false;
        firstClick = false;

        if (spawn == SpawnType.ArbeauWindow)
        {
            winObj.name = "Arbeau Alert";
            CloseWindow closeButton = winObj.transform.GetChild(3).GetComponent <CloseWindow>();
            closeButton.SetTextList(winText);
        }
        //SetInactiveSprite();
    }
Esempio n. 3
0
    public IEnumerator SpawnArbeauContext()
    {
        yield return(new WaitForSeconds(1f));

        taskMan = GetComponent <TaskManager>();        //I feel like I put this here for a reason

        CreateTasks();

        int[] cnt = LowHighCount();

        if (!gameMan.GetArbeauOff())
        {
            for (int ii = 0; ii < taskIndex.Length; ii++)
            {
                GameObject win;

                List <string> contextList = new List <string>();

                win = (GameObject)Instantiate(arbeau, new Vector2(0f, 0f), transform.rotation);

                CloseWindow closeButton = win.transform.GetChild(3).GetComponent <CloseWindow>();

                win.transform.SetParent(GameObject.Find("Canvas").transform, false);

                win.transform.localPosition = RandomizePosition(ii);

                win.name = "Arbeau Context Window " + ii;

                contextList = GetContext(ii);

                closeButton.SetTextList(contextList);
            }
        }
    }