// Use this for initialization
 void Start()
 {
     Move           = this.transform.position;
     pause          = GameObject.FindGameObjectWithTag("MainCamera").GetComponentInParent <PauseMenuController>();
     player         = GameObject.FindGameObjectWithTag("Player").GetComponentInParent <PlayerController>();
     gameController = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>();
 }
 private void Start()
 {
     inputs              = new List <string>();
     playerController    = levelController.getPlayerController();
     inputVisualizer     = levelController.getInputVisualizer();
     pauseMenuController = levelController.getPauseMenuController();
 }
Beispiel #3
0
 private void InitializeManager()
 {
     mainMenu   = GetComponent <MainMenuController>();
     inGameMenu = GetComponent <InGameMenuController>();
     pauseMenu  = GetComponent <PauseMenuController>();
     shopMenu   = GetComponent <ShopMenuController>();
 }
Beispiel #4
0
    // Update is called once per frame
    void Update()
    {
        float move = Input.GetAxis("Horizontal");

        moveX = move * maxSpeed;


        if (Input.GetKeyDown(KeyCode.Space) && isGrounded)
        {
            moveY = 5;
        }
        else
        {
            moveY = rb2d.velocity.y;
        }

        rb2d.velocity = new Vector3(moveX, moveY);

        if (move <= 0.1 && move >= -0.1)
        {
            if (isGrounded)
            {
                ResetRotation();
                animator.Play("idle");
            }
            else
            {
                FreezRotation();
                animator.Play("jump");
            }
        }
        else
        {
            if (isGrounded)
            {
                ResetRotation();
                animator.Play("run");
            }
            else
            {
                FreezRotation();
                animator.Play("jump");
            }
        }

        if (move < 0 && !facingLeft)
        {
            Flip();
        }
        else if (move > 0 && facingLeft)
        {
            Flip();
        }

        if (rb2d.transform.position.y <= -5)
        {
            PauseMenuController.PauseGame();
        }
    }
Beispiel #5
0
 private void DisablePauseMenu()
 {
     if (pauseMenuController == null)
     {
         pauseMenuController = PlayerManager.Instance.PlayerGameObject.GetComponent <PauseMenuController>();
     }
     pauseMenuController.Disable();
 }
Beispiel #6
0
    // Start() is called once at the beginning of the Scene load.
    void Start()
    {
        // "PMC" is set to the PauseMenuController script from the "pauseMenuCanvas" object that was passed to this script earlier.
        PMC = pauseMenuCanvas.GetComponent <PauseMenuController>();

        // This disables the "about" menu at the start of the game so that it doesn't show up on accident.
        thisSameCanvas.enabled = false;
    }
Beispiel #7
0
 public void Construct([InjectOptional] IDifficultyBeatmap difficultyBeatmap, AudioTimeSyncController audioTimeSyncController, PauseMenuController pauseMenuController, GameplayCoreSceneSetupData gameplayCoreSceneSetupData, Submission submission)
 {
     this.difficultyBeatmap          = difficultyBeatmap;
     this.audioTimeSyncController    = audioTimeSyncController;
     this.pauseMenuController        = pauseMenuController;
     this.gameplayCoreSceneSetupData = gameplayCoreSceneSetupData;
     this.submission = submission;
 }
 void Awake()
 {
     shootableMask = LayerMask.GetMask("Shootable");
     gunParticles  = GetComponent <ParticleSystem> ();
     gunLine       = GetComponent <LineRenderer> ();
     gunAudio      = GetComponent <AudioSource> ();
     gunLight      = GetComponent <Light> ();
     PM            = GameObject.FindGameObjectWithTag(Tags.HUD).GetComponent <PauseMenuController>();
 }
Beispiel #9
0
 public void Awake()
 {
     if (!PauseMenuController.Instance)
     {
         PauseMenuController.Instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
 protected override void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Debug.LogWarning("Only one pause menu controller should be in the scene!");
     }
 }
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         this.enabled = false;
     }
 }
Beispiel #12
0
 public void Clicked()
 {
     if (!PauseMenuController.control.pauseAndUnpause.getPaused())
     {
         PauseMenuController.Pause();
     }
     else
     {
         PauseMenuController.Unpause();
     }
 }
    private void Awake()
    {
        // Keep the instantiated object for PauseMenu only

        if (instance != null)
        {
            Destroy(instance.gameObject);
        }

        instance = this;
        DontDestroyOnLoad(this.gameObject);
    }
	// Make sure there is only one instance of this class, initiate pause canvase, default canvase to disabled
	void Awake () {
		if (menuController == null) {
			DontDestroyOnLoad (gameObject);
			canvas = Instantiate (canvas);
			DontDestroyOnLoad (canvas);
			canvas.enabled = false;
			menuController = this;
		}
		else if (menuController != this) {
			Destroy (gameObject);
		}
	}
 // Use this for initialization
 void Awake()
 {
     if (pauseMenuController == null)
     {
         DontDestroyOnLoad(gameObject);
         pauseMenuController = this;
     }
     else if (pauseMenuController != this)
     {
         Destroy(gameObject);
     }
 }
 void Awake()
 {
     if (!instance)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
         Debug.LogWarning("More than one instance of class PauseMenuController exists. Deleting duplicate instance.");
     }
 }
    bool active = true; //Tells is the main menu is active or showing a sub window

    void Start()
    {
        menu          = GetComponent <PauseMenuController>();
        teamMenu      = transform.Find("TeamMenu").GetComponent <TeamMenu>();
        bagMenu       = transform.Find("BagMenu").GetComponent <BagMenu>();
        ApiController = gameObject.GetComponent <APIController>();

        usernameText = transform.Find("Username").GetComponent <Text>();
        moneyText    = transform.Find("Money").GetComponent <Text>();
        coredexText  = transform.Find("Coredex").GetComponent <Text>();

        usernameText.text = GameData.saveData.username;
    }
 void Awake()
 {
     if (control == null)
     {
         control = this;
         DontDestroyOnLoad(this);
         SceneManager.activeSceneChanged += control.UnpauseOnLevelLoad;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Beispiel #19
0
    void Start()
    {
        pc = GameObject.FindObjectOfType <PauseMenuController> ();

        cancelTyping = false;
        isTyping     = false;

        storyLine.Add("Congratulations!\n" +
                      "You saved the princess and her kingdom!\n" +
                      "Thanks to your bravery, you will live in the castle as the princess's royal guard.\n" +
                      "With the end of this adventure there is only one thing to say:\n 'And they lived happily ever after'!\n");

        StartCoroutine(TextScroll((string)storyLine [0]));
    }
 void Update()
 {
     if (Input.GetKeyDown(Keys.PAUSE))
     {
         if (PauseMenuController.MenuStatic.activeSelf != true)
         {
             PauseMenuController.Show();
         }
         else
         {
             PauseMenuController.Hide();
         }
     }
 }
Beispiel #21
0
    // Use this for initialization
    void Start()
    {
        drone           = controlDrone.GetComponent <Drone>();
        fader           = GameObject.Find("ScreenFadeCanvas");
        faderScript     = fader.GetComponent <ScreenFadeInOut> ();
        gravityDisplay  = gravityButton.GetComponent <DisplayButton> ();
        rotationDisplay = rotationButton.GetComponent <DisplayButton> ();
        slider          = forceSlider.GetComponent <Slider> ();
        slider.maxValue = drone.maxForce;
        slider.minValue = drone.minForce;

        spawnPoints = FindObjectsOfType <SpawnPoint>();

        pauseMenuController = pauseMenu.GetComponent <PauseMenuController>();
    }
Beispiel #22
0
    void Awake()
    {
        // Singleton Pattern
        if (pauseMenuController == null)
        {
            DontDestroyOnLoad(gameObject);
            pauseMenuController = this;
        }
        else if (pauseMenuController != this)
        {
            Destroy(gameObject);
        }

        gameObject.SetActive(false);
    }
 public void CheckForLevelEnded()
 {
     if (levelService.BallCount <= 0 &&
         GameObject.FindGameObjectsWithTag(Tags.BALL).Length == 0)
     {
         Instantiate(levelEndedMenuPrefab, new Vector2(), Quaternion.identity);
         levelService.IsLevelPaused = true;
         PauseMenuController menuOnScene = FindObjectOfType(typeof(PauseMenuController)) as PauseMenuController;
         if (menuOnScene != null)
         {
             Destroy(menuOnScene.gameObject);
         }
         progressService.UpdateScore(levelService.CurrentLevel, levelService.GetStarCount());
         progressService.SetStarsCountTotal();
     }
 }
Beispiel #24
0
    void Start()
    {
        if (Main != this)
        {
            if (Main != null)
            {
                throw new UnityException("Multiple PauseMenuController active");
            }
            else
            {
                Main = this;
                Debug.Log("PauseMenuController found");
            }
        }

        gameObject.SetActive(false);
        m_IsPaused = false;
    }
        public override void Init()
        {
            LoadLevelType();

            camController            = FindObjectOfType <CamControllerGameplay>();
            poolingManager           = FindObjectOfType <PoolingManager>();
            playerController         = FindObjectOfType <PlayerSpawner>().SpawnPlayer();
            moveToMousePos           = FindObjectOfType <MoveToMousePosition>();
            bulletManager            = FindObjectOfType <Weapon_BulletManager>();
            worldInteractionsManager = FindObjectOfType <WorldInteractionsManager>();
            challenegeManager        = FindObjectOfType <ChallengeManager>();

            aimCursorManager           = FindObjectOfType <AimCursorManager>();
            uiWorldInteractionManager  = FindObjectOfType <UI_WorldInteractionManager>();
            uiLevelRestartManager      = FindObjectOfType <UI_LevelRestartManager>();
            uiReloadProgressBar        = FindObjectOfType <UI_ReloadProgressBar>();
            pauseMenuController        = FindObjectOfType <PauseMenuController>();
            weaponSelectionMenuManager = FindObjectOfType <WeaponSelectionMenuManager>();

            aiManager = FindObjectOfType <AIManager>();

            camController.Init();
            poolingManager.Init();
            moveToMousePos.Init();
            bulletManager.Init();
            playerController.Init();
            worldInteractionsManager.Init();

            aimCursorManager.Init();
            uiWorldInteractionManager.Init();
            uiLevelRestartManager.Init();
            uiReloadProgressBar.Init();
            weaponSelectionMenuManager.Init();

            aiManager.Init();
            challenegeManager.Init();
            pauseMenuController.Init();


            //Place Code Above Here
            base.Init();
        }
Beispiel #26
0
    // Use this for initialization
    void Start()
    {
        mainCam   = FindObjectOfType <CameraFollow>();
        levelExit = FindObjectOfType <LevelExit>();
        player    = FindObjectOfType <PlayerController>();
        player.GetComponent <Rigidbody2D>().gravityScale = gravity;

        tipPane = FindObjectOfType <TipPaneController>();

        pauseMenu = FindObjectOfType <PauseMenuController>();
        pauseMenu.TogglePauseMenu(false);

        allEnemies = FindObjectsOfType <EnemyController>();

        //Play sounds
        if (GetComponent <AudioSource>().isPlaying)
        {
            GetComponent <AudioSource>().Stop();
        }
        GetComponent <AudioSource>().PlayOneShot(readyVoice);
    }
Beispiel #27
0
    // Start is called before the first frame update
    void Start()
    {
        Debug.Log("Starting main controller");
        //Manually set character type here
        mainCamera = Camera.main;
        SetupMainCharacter();

        //Setup score controller
        Statics.ScoreController = FindObjectOfType <ScoreController>();
        Statics.ScoreController.LoadHighScore();

        Statics.DeathController = FindObjectOfType <DeathController>();

        UpdateCameraPosition();
        UpdateGunPosition();

        UpdateCameraAngleMobile();
        UpdateCameraAngleComputer();

        UpdateTargetPosition();

        //Disable gun for now
        gun.SetActive(false);

        //Start game sounds
        pauseMenuController = FindObjectOfType <PauseMenuController>();
        if (Statics.GameSoundsEnabled)
        {
            pauseMenuController.UnmuteGame();
        }
        else
        {
            pauseMenuController.MuteGame();
        }

        //Convert this to a unit test to confirm that the
        //zombies colliders are actually being loaded properly
        LoadZombieColliders();
    }
 void Awake()
 {
     //Set Animator...
     anim = GameObject.FindGameObjectWithTag (Tags.canvas).GetComponent<Animator> ();
     pauseMenuController = GameObject.FindGameObjectWithTag (Tags.canvas).GetComponentInChildren<PauseMenuController> ();
     persistentData = GameObject.FindGameObjectWithTag (Tags.mainCamera).GetComponent<PersistentData> ();
     //persistentData.realGameObjectsToDestroyListArray = null;
     smoothCamera2D = GameObject.FindGameObjectWithTag (Tags.mainCamera).GetComponent<SmoothCamera2D> ();
 }
Beispiel #29
0
    public override void Construct()
    {
        base.Construct();

        controller = FindObjectOfType <PauseMenuController>();
    }
 public void Construct(AudioTimeSyncController audioTimeSyncController, PauseMenuController pauseMenuController)
 {
     this.audioTimeSyncController = audioTimeSyncController;
     this.pauseMenuController     = pauseMenuController;
 }
Beispiel #31
0
 void Start()
 {
     rb = GetComponent <Rigidbody2D>();
     _pauseController = _HUDCanvas.GetComponent <PauseMenuController>();
     _audioController = GetComponent <AudioSource>();
 }
Beispiel #32
0
 void start()
 {
     pauseMenu = GetComponent<PauseMenuController> ();
     isPaused = pauseMenu.getIsPaused ();
 }
Beispiel #33
0
 // Use this for initialization
 void Start()
 {
     _PauseController = _HUDCanvas.GetComponent <PauseMenuController>();
 }
Beispiel #34
0
	public void add(PauseMenuController controller){
		r_Controllers.Add(controller);
	}