Ejemplo n.º 1
0
 void Start()
 {
     //Find and assign script variables
     pauseMenu   = gameObject.GetComponent <GUIPauseMenu> ();
     optionsMenu = gameObject.GetComponent <GUIOptionsMenu> ();
     gridScript  = (GameObject.Find("Grid Controller")).GetComponent <GridCS> ();
     gridScript.CreateGrid();
     //Tell the grid to spawn
     //GridCS.Instance.CreateGrid ();
     //Set the currently loaded layer to the one designated by the grid script
     LayerSwitcher.Instance.CurrentLayer = GridCS.coreLayer;
     for (int layer = 0; layer <= GridCS.layerCount; layer++)
     {
         if (layer != GridCS.coreLayer)
         {
             LayerSwitcher.Instance.HideLayer(layer);
         }
     }
     //Go and find the main camera
     MainCamera = GameObject.Find("Main Camera").GetComponent <Camera> ();
     //Assign states, enter into the Insert phase
     turnState = TurnStates.InsertPhase;
     menuState = MenuStates.NullState;
     _EnterInsertPhase();
     //Put the Layer Switcher button into the main GUI
     guiFunction += LayerSwitcher.Instance.GUIFunction;
 }
Ejemplo n.º 2
0
 // Initialization
 void Awake()
 {
     optionsMenu  = gameObject.GetComponent <GUIOptionsMenu> ();  //as GUIOptionsMenu;
     unitChoice   = gameObject.GetComponent <UnitChoice> ();      //as UnitChoice;
     switchButton = gameObject.GetComponent <SwitchButton> ();    //as SwitchButton;
     gameManager  = gameObject.GetComponent <GameManager> ();
 }
Ejemplo n.º 3
0
 public override void OnAwake()
 {
     instance = this;
     Audio    = gameObject.GetComponent <AudioListener>();
     ImageBar = new List <ImageBaradjustment>();
     OldState = Textstate.NUMSTATES;
     Camera   = gameObject.GetComponent <Camera>();
     AddImagesAndText();
 }
Ejemplo n.º 4
0
    public override void Start()
    {
        #region Init GUI
        if (Camera == null)
        {
            Debug.Log("Camera Master cannot find camera");
        }

        JoinHost = gameObject.GetComponent <GUIJoinHost>();
        if (JoinHost == null)
        {
            Debug.Log("Camera Master cannot find GUI script for join/host");
        }
        MainMenu = gameObject.GetComponent <GUIMainMenu>();
        if (MainMenu == null)
        {
            Debug.Log("Camera master could not find GUI script for main menu");
        }
        SelectTeam = gameObject.GetComponent <GUISelectTeam>();
        if (SelectTeam == null)
        {
            Debug.Log("Camera Master cannot find GUI script for select");
        }

        ExitMenu = gameObject.GetComponent <GUIExitMenu>();
        if (ExitMenu == null)
        {
            Debug.Log("Camera Master cannot find GUI script for exit");
        }

        HostMenu = gameObject.GetComponent <GUIHostMenu>();
        if (HostMenu == null)
        {
            Debug.Log("Camera Master cannot find GUI script for host");
        }

        OptionsMenu = gameObject.GetComponent <GUIOptionsMenu>();
        if (OptionsMenu == null)
        {
            Debug.Log("Camera Master cannot find GUI script for Options");
        }


        LoadingScreen = gameObject.GetComponent <GUILoadingScreen>();
        if (LoadingScreen == null)
        {
            Debug.Log("Camera Maser cannot find GUI script for loading screen");
        }

        ChadCam = gameObject.GetComponent <ChadCam>();
        if (ChadCam == null)
        {
            Debug.Log("Camera Master cannot find ChadCam");
        }
        else
        {
            ChadCam.enabled = false;
        }

        SpectatorCam = gameObject.GetComponent <SpectatorCam>();
        if (SpectatorCam == null)
        {
            Debug.Log("Camera Master cannot find SpectatorCam");
        }
        else
        {
            SpectatorCam.enabled = false;
        }

        Hud = gameObject.GetComponent <ChadHud>();
        if (Hud == null)
        {
            Debug.Log("Camera Master could not find Hud");
        }

        ReplayCam         = gameObject.GetComponent <ReplayCamera>();
        ReplayCam.enabled = false;
        #endregion

        #region Chad Hats
        string settingsHat = UserSettings.GetSetting("Hat");

        if (settingsHat != null)
        {
            SelectedHat = System.Convert.ToInt32(settingsHat);
        }
        else
        {
            SelectedHat = (int)(Random.Range(0.0f, 1.0f) * (HatManager.Instance.Hats.Count - 2)) + 1;
            settingsHat = SelectedHat.ToString();
            UserSettings.AddOrUpdateAppSetting("Hat", settingsHat);
        }

        if (ChadMainMenu != null)
        {
            ChadMMHat = ChadMainMenu.GetComponent <Hatter>();
            ChadMMHat.SetHat(SelectedHat);
        }
        if (ChadTeam1 != null)
        {
            ChadT1Hat = ChadTeam1.GetComponent <Hatter>();
            ChadT1Hat.SetHat(SelectedHat);
        }
        if (ChadTeam1 != null)
        {
            ChadT2Hat = ChadTeam2.GetComponent <Hatter>();
            ChadT2Hat.SetHat(SelectedHat);
        }
        #endregion

        SetState(CAM_STATE.MAIN_MENU);
    }