Ejemplo n.º 1
0
    void Start()
    {
        // Setting instance for external access
        instance    = this;
        initialized = true;

        // Setting up references to ui elements

        // Mass
        massInput1 = GameObject.Find("Mass 1").GetComponent <InputField>();
        massInput2 = GameObject.Find("Mass 2").GetComponent <InputField>();
        massInput3 = GameObject.Find("Mass 3").GetComponent <InputField>();

        // Angle
        angleSlider = GameObject.Find("Angle Slider").GetComponent <Slider>();

        // Fire Delay
        fireDelaySlider = GameObject.Find("Fire Delay Slider").GetComponent <Slider>();

        // Auto Fire
        autoFireToggle = GameObject.Find("Auto Fire Toggle").GetComponent <Toggle>();

        // Time Scale
        timeScaleSlider = GameObject.Find("Time Scale Slider").GetComponent <Slider>();

        // Induction
        inductionInput = GameObject.Find("Induction Input").GetComponent <InputField>();
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        uiController = canvas.GetComponent <UserInterfaceController>();
        playerScript = player.GetComponent <PlayerScript>();
        enemyScript  = enemy.GetComponent <EnemyScript>();

        StartCoroutine(PlayGame());
    }
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else if (Instance != null)
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 4
0
    //private methods

    private void CheckInstantiation()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
    }
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 6
0
 public void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != null)
     {
         Destroy(this.gameObject);
     }
     DontDestroyOnLoad(this.gameObject);
 }
 void Awake()
 {
     singleton = this;
     if (ResourceManager.isResourcesLoaded)
     {
         OnResourasLoaded();
     }
     else
     {
         ResourceManager.OnAllResoucesLoadedEvent -= OnResourasLoaded;
         ResourceManager.OnAllResoucesLoadedEvent += OnResourasLoaded;
     }
     myIp = NetController.GetLocalIpAddress();
 }
Ejemplo n.º 8
0
 private void Update()
 {
     if (Time.timeScale > 0)
     {
         if (player != null && player.inputInteract && !activationSent)
         {
             UserInterfaceController.RequestTradeInterface();
             activationSent = true;
         }
         else
         {
             activationSent = false;
         }
     }
 }
Ejemplo n.º 9
0
        public void InitializeConsoleText(
            UserInterfaceController userInterfaceController,
            FileSystemState fileSystemState,
            DirectoryController directoryController,
            Text inputText,
            Text outputText)
        {
            Debug.Assert(inputText != null, "The input text object is not properly set.");
            Debug.Assert(outputText != null, "The output text object is not properly set.");

            // Ensure that the console text objects are empty to start (except for prompts and path metadata)
            var currentDirectory     = fileSystemState.GetCurrentDirectory();
            var currentDirectoryPath = directoryController.GetDirectoryPath(currentDirectory);

            userInterfaceController.SetUserInterfaceTextWithInputPrompt(inputText, string.Empty, currentDirectoryPath);
            userInterfaceController.SetUserInterfaceText(outputText, updatedText: string.Empty);
        }
Ejemplo n.º 10
0
        public Director(ContentManager content, GraphicsDeviceManager graphics, GlobalVariablesInstance globalVariablesInstance)
        {
            GetGlobalVariablesInstance = globalVariablesInstance;
            GetClock                   = new Clock();
            GetIdGenerator             = new IdGenerator();
            GetSoundManager            = new SoundManager();
            GetInputManager            = new InputManager();
            GetStoryManager            = new StoryManager(this);
            GetPathManager             = new PathManager();
            GetUserInterfaceController = new UserInterfaceController(this);
            GetDistributionDirector    = new DistributionDirector(this);
            GetMilitaryManager         = new MilitaryManager(this);
            GetActionManager           = new ActionManager();
            GetEventLog                = new EventLog(GetUserInterfaceController, this, content);
            GetGraphicsDeviceManager   = graphics;
            GetDeathManager            = new DeathManager();

            GetSoundManager.LoadContent(content);
            GetSoundManager.PlaySoundTrack();

            GetStoryManager.LoadAchievements();
        }
Ejemplo n.º 11
0
 public static void StartNetWatchGame(GameStateProxy proxy)
 {
     if (singleton._curGameMode != GameMode.netView)
     {
         UserInterfaceController.ChangeUserInterfaceMode(InterfaceMode.WatchNetGame);
         singleton._curGameMode = GameMode.netView;
         singleton.DestroyAllBubblesInDict();
         singleton._curGameMode = GameMode.netView;
         singleton._curLevel    = proxy.level;
         singleton._score       = proxy.score;
         ResourceManager.GenerateNewTexturesSet();
         singleton.smallBubbleSpeed = proxy.smallBubbleSpeed;
         singleton.bigBubbleSpeed   = proxy.bigBubbleSpeed;
         singleton._levelTimer      = proxy.timer;
         for (int i = 0; i < proxy.bubbles.Length; i++)
         {
             BubbleController newBubble = singleton.bubblesGenerator.GenerateNewNetWatchBubble(proxy.bubbles[i],
                                                                                               singleton.smallBubbleSpeed, singleton.bigBubbleSpeed);
             singleton.bubblesDict.Add(newBubble.id, newBubble);
         }
     }
 }
    // Start is called before the first frame update
    void Start()
    {
        panel_Building.SetActive(true);
        panel_GoToMap.SetActive(true);

        // TODO: Sometimes when we start the game, we want to go to the right state

        panel_GoToShip.SetActive(false);
        panel_LaunchJourney.SetActive(false);
        panel_LandShip.SetActive(false);

        CloseAllBuilding();
        if (Instance == null)
        {
            Instance = this;
        }

        tooltipInstance.SetActive(false);

        NotificationPanel.SetActive(false);
        ObjectivesPanel.SetActive(false);
    }
Ejemplo n.º 13
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            _container.UseInstance(spriteBatch);

            _container.RegisterDelegate(x => Helpers.GetDecorations(), Reuse.Singleton);
            _container.UseInstance(graphics);
            _container.UseInstance(_container);
            _container.RegisterDelegate(x => new List <Message>(), Reuse.Singleton);
            _container.RegisterDelegate(x => new Random(), Reuse.Singleton);
            _container.RegisterDelegate(x => Helpers.GetConfiguration <Config>(CONFIG_PATH), Reuse.Singleton);
            _container.RegisterDelegate(x => Helpers.LoadTextures <TileType>(Content), Reuse.Singleton);
            _container.RegisterDelegate(x => Helpers.LoadTextures <DecorationType>(Content), Reuse.Singleton);
            _container.RegisterDelegate(x => Helpers.LoadTextures <PlayerTexture>(Content), Reuse.Singleton);
            _container.RegisterDelegate(x => Content.Load <SpriteFont>("fonts/vga"), Reuse.Singleton);
            _container.RegisterDelegate(x => Helpers.GetConfiguration <Generator.MapGenerationConfig>(MAP_GEN_CONFIG_PATH));
            _container.Register <PlayerController, PlayerController>(Reuse.Singleton);
            _container.Register <UserInterfaceController, UserInterfaceController>(Reuse.Singleton);

            // register tile types
            _container.Register <GrassTile, GrassTile>();
            _container.Register <DirtTile, DirtTile>();
            _container.Register <CobblestoneTile, CobblestoneTile>();

            _container.Register <TileMap, TileMap>(Reuse.Singleton);

            _map = _container.Resolve <TileMap>();

            _player                    = _container.Resolve <PlayerController>();
            _player.Position           = _map.GetPlayerStartingPosition();
            _player.PlayerMoveAttempt += HandlePlayerMoveAttempt;
            _player.PlayerMoved       += HandlePlayerMoved;

            _ui = _container.Resolve <UserInterfaceController>();

            _messages = _container.Resolve <List <Message> >();
        }
Ejemplo n.º 14
0
 public DistributionDirector(Director director)
 {
     mUserInterfaceController = director.GetUserInterfaceController;
     mDMs = new Dictionary <int, DistributionManager>();
 }
Ejemplo n.º 15
0
 public void ReloadContent(UserInterfaceController uic)
 {
     mUserInterfaceController = uic;
 }
Ejemplo n.º 16
0
 private void Awake()
 {
     this.gameObject.name = "Player";
     thisRigidBody        = this.gameObject.GetComponent <Rigidbody>();
     gameUI = GameObject.Find("GameController").GetComponent <UserInterfaceController>();
 }
Ejemplo n.º 17
0
 void Start()
 {
     Debug.Log("Hello");
     userIC = GameObject.Find("GameController").GetComponent <UserInterfaceController>();
 }
 void Start()
 {
     UIC = this;
     HideReloadUI();
     SetupStateMachine();
 }
Ejemplo n.º 19
0
 private void Start()
 {
     scoreController = GameObject.Find("GameController").GetComponent <UserInterfaceController>();
 }
Ejemplo n.º 20
0
 public void Initialize()
 {
     current = userInterfaces[0];
     current.Initialize();
 }