예제 #1
0
    void Awake()
    {
        mNetHUD = GetComponent <NetworkManagerHUDCustom>();

        GameManager.OnGameOver           += GameManager_OnGameOver;
        GameManager.OnDefeat             += GameManager_OnDefeat;
        GameManager.OnStart              += GameManager_OnStart;
        GameManager.OnGameTimeLeftChange += GameManager_OnGameTimeLeftChange;

        mScreens = new Canvas[(int)Screens.NumScreens];
        Canvas[] screens = GetComponentsInChildren <Canvas>();
        for (int count = 0; count < screens.Length; ++count)
        {
            for (int slot = 0; slot < mScreens.Length; ++slot)
            {
                if (mScreens[slot] == null && ((Screens)slot).ToString() == screens[count].name)
                {
                    mScreens[slot] = screens[count];
                    break;
                }
            }
        }

        for (int screen = 1; screen < mScreens.Length; ++screen)
        {
            mScreens[screen].enabled = false;
        }

        mCurrentScreen = Screens.TitleScreen;
    }
예제 #2
0
    private void Start()
    {
        if (DBManager.LoggedIn)
        {
            userDisplay.text = DBManager.username;
            string[] achievementsArray = new string[DBManager.achievements.Count];
            DBManager.achievements.CopyTo(achievementsArray);
            achiveDisplay.text = string.Join(", ", achievementsArray);

            hud = FindObjectOfType <NetworkManagerHUDCustom>();
            if (hud != null)
            {
                hud.showGUI = true;
            }

            windowRect = new Rect(Screen.width - 160, Screen.height - 80, 150, 65);
        }
    }