コード例 #1
0
ファイル: SaveLoadMenu.cs プロジェクト: DrDoak/GDS2
    public void OnDelete()
    {
        m_deleteProfile = "";
        if (MyInputField != null)
        {
            m_deleteProfile   = MyInputField.text;
            MyInputField.text = "";
        }
        else
        {
            m_deleteProfile = m_savedProfiles [m_selectedIndex];
        }
        if (m_deleteProfile == "")
        {
            m_message.text = "No profile selected to delete";
            return;
        }
        if (!SaveObjManager.Instance.ProfileExists(m_deleteProfile))
        {
            m_message.text = "Profile: " + m_deleteProfile + " does not exist";
            return;
        }
        if (m_deleteProfile == "AutoSave")
        {
            m_message.text = "AutoSave cannot be deleted.";
            return;
        }
        string w = "Are you sure you want to permanently delete: " + m_deleteProfile + "?";

        w += "\n Deleted saves cannot be recovered.";

        PauseGame.DisplayWarning(w, gameObject, m_delete);
    }
コード例 #2
0
ファイル: GOverManager.cs プロジェクト: Rafer45/squelch
 void Awake()
 {
     pg       = GetComponent <PauseGame>();
     sg       = GetComponent <StartGame>();
     btm      = GetComponent <BackToMain>();
     maxScore = PlayerPrefs.GetInt("high_score", 0);
 }
コード例 #3
0
    void Update()
    {
        if (_isPlaying)
        {
            Time.timeScale = 1f;
            _time         += Time.deltaTime;
            timePlaying    = System.TimeSpan.FromSeconds(_time);
        }

        if (!_haslost && !_hasWon)
        {
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                if (!_pause && _isPlaying)
                {
                    _pause     = true;
                    _isPlaying = false;
                    PauseGame?.Invoke(_pause);
                }
                else
                {
                    _pause     = false;
                    _isPlaying = true;
                    PauseGame?.Invoke(_pause);
                }
            }
        }
    }
コード例 #4
0
ファイル: RoundController.cs プロジェクト: LarssonSv/BeatBorn
    private void Update()
    {
        if (PauseGame.IsPaused() || !isSpawning || StartOnAwake)
        {
            return;
        }

        switch (currentState)
        {
        case State.NewRound:
            StartNewRound();
            break;

        case State.Playing:
            Play();
            break;

        case State.Paused:
            WaitForClear();
            break;

        case State.GameOver:
            //                Debug.Log("GameOver!");
            break;
        }

        if (spawnQue.Count > 0 && spawnTimer <= 0)
        {
            SpawnTest();
        }
        else if (spawnTimer > 0)
        {
            spawnTimer -= Time.deltaTime;
        }
    }
コード例 #5
0
 private void Awake()
 {
     PauseGameScript = GameObject.Find("GameController").GetComponent <PauseGame>();
     InventoryScript = GameObject.Find("Character").GetComponent <Inventory>();
     GamePaused      = PauseGame.GamePaused;
     lockViewScript  = gameObject.GetComponent <LockView>();
 }
コード例 #6
0
ファイル: LevelEnding.cs プロジェクト: ngwattcos/Corporeal
    // Use this for initialization
    void Start()
    {
        ui = uiManager.GetComponent <PauseGame>();

//		swb = GameObject.FindGameObjectWithTag("Cathode Ray Tube").GetComponent<SemiWeaponBehavior>();
//		bh = GameObject.FindGameObjectWithTag("Black Hole").GetComponent<BlackHole>();
    }
コード例 #7
0
 // Use this for initialization
 void Start()
 {
     buttonZ         = new Slowtime();
     buttonX         = new NormalizeTime();
     buttonLeftMouse = new FireWeapon();
     buttonESC       = new PauseGame();
 }
コード例 #8
0
ファイル: LumberYard.cs プロジェクト: zblouse/Fiefdoms
 // Use this for initialization
 void Start()
 {
     resources  = GameObject.FindGameObjectWithTag("Game Control").GetComponent <PlayerResources>();
     eTime      = GameObject.FindGameObjectWithTag("Game Control").GetComponent <ElapsedTime>();
     PopManager = GameObject.FindGameObjectWithTag("Game Control").GetComponent <PopulationManager>();
     pause      = GameObject.FindGameObjectWithTag("Game Control").GetComponent <PauseGame>();
 }
コード例 #9
0
    void Start()
    {
        // Initializers
        aspectUtil = FindObjectOfType <Camera>().GetComponent <AspectUtility>();
        dArrow     = GameObject.Find("Dialogue_Arrow");
        dBox       = GameObject.Find("Dialogue_Box");
        dFrame     = GameObject.Find("Dialogue_Frame").GetComponent <Image>();
        dText      = GameObject.Find("Dialogue_Text").GetComponent <Text>();
        dPic       = GameObject.Find("Dialogue_Picture").GetComponent <Image>();
        imgStrobe  = GameObject.Find("Dialogue_Arrow").GetComponent <ImageStrobe>();
        mainCamera = FindObjectOfType <CameraFollow>();
        oMan       = FindObjectOfType <OptionsManager>();
        pause      = FindObjectOfType <PauseGame>();
        pMove      = FindObjectOfType <PlayerMovement>();
        SFXMan     = FindObjectOfType <SFXManager>();
        touches    = FindObjectOfType <TouchControls>();
        uMan       = FindObjectOfType <UIManager>();

        bDialogueActive = false;
        bPauseDialogue  = false; // UX -- Prevents immediately reopening a dialogue while moving / talking
        pauseTime       = 0.333f;

        dArrowPoints = new float[4];
        dFramePoints = new float[4];
        dPicPoints   = new float[4];
        dTextPoints  = new float[4];

        ConfigureParameters();
    }
コード例 #10
0
    /// <summary>
    /// TransferProperty transfers both properties and skills between player and target
    /// </summary>
    protected virtual void TransferProperty()
    {
        PauseGame.Resume();
        CheckRemovals();

        foreach (Property p in _mPropertyToTransfer)
        {
            Target.GetComponent <PropertyHolder>().TransferProperty(p, Player.GetComponent <PropertyHolder>());
        }
        foreach (Property p in _mPropertiesToKeep)
        {
            Player.GetComponent <PropertyHolder>().TransferProperty(p, Target.GetComponent <PropertyHolder>());
        }

        if (InfectUpgrade)
        {
            int i = 0;
            foreach (Ability a in _mSelected)
            {
                Player.GetComponent <AbilityControl>().AbsorbAbility(a, i);
                i++;
            }
        }

        _mTriggered = false;
        Target      = null;

        EventManager.TriggerEvent(EventManager.TRANSFER_SPECIAL);
    }
コード例 #11
0
 private void Start()
 {
     pauseGame = GameObject.FindObjectOfType <PauseGame>();
     AudioSource[] audioSources = GetComponents <AudioSource>();
     rotatingSFX = audioSources[0];
     shootingSFX = audioSources[1];
 }
コード例 #12
0
    // Update is called once per frame
    void Update()
    {
        Horizontal = Input.GetAxis("Horizontal");
        Vertical   = Input.GetAxis("Vertical");

        if (Horizontal != 0 || Vertical != 0)
        {
            OnMove(Horizontal, Vertical);
        }

        //Liberarse Trampa
        if (trapped)
        {
            //Izquierda
            if (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.LeftArrow))
            {
                Liberarse?.Invoke("Left");
            }
            else if (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow))
            {
                Liberarse?.Invoke("Right");
            }
        }

        //Pausar o despausar juego
        if (Input.GetButtonDown("Pause"))
        {
            PauseGame?.Invoke();
        }
    }
コード例 #13
0
 /// <summary>
 /// Load the controls help screen
 /// </summary>
 private void controlsAction()
 {
     // Load the campaing level
     UnityEngine.SceneManagement.SceneManager.LoadScene("GamePlayScreen");
     // If the game was paused, we continue it
     PauseGame.Unpause();
 }
コード例 #14
0
 /// <summary>
 /// Load the first campaign level
 /// </summary>
 private void campaignAction()
 {
     // Load the campaing level
     UnityEngine.SceneManagement.SceneManager.LoadScene("ExplainScreenCampaign");
     // If the game was paused, we continue it
     PauseGame.Unpause();
 }
コード例 #15
0
    void Awake()
    {
        if (m_instance == null)
        {
            m_instance = this;
        }
        else if (m_instance != this)
        {
            Destroy(gameObject);
            return;
        }
        m_pauseMenuUI   = transform.GetChild(0).gameObject;
        m_saveScreen    = transform.GetChild(1).gameObject;
        m_loadScreen    = transform.GetChild(2).gameObject;
        m_deadScreen    = transform.GetChild(3).gameObject;
        m_warningScreen = transform.GetChild(4).gameObject;
        m_controlMap    = transform.Find("KeyboardMap").gameObject;

        m_pauseMenuUI.SetActive(false);
        m_saveScreen.SetActive(false);
        m_loadScreen.SetActive(false);
        m_deadScreen.SetActive(false);
        m_warningScreen.SetActive(false);
        m_controlMap.SetActive(false);
    }
コード例 #16
0
    /// <summary>
    /// Button: Retry current scene
    /// </summary>
    public void Retry()
    {
        PauseGame.Unpause();
        Scene scene = SceneManager.GetActiveScene();

        SceneManager.LoadScene(scene.name);
    }
コード例 #17
0
ファイル: CameraDefault.cs プロジェクト: LarssonSv/BeatBorn
    public virtual void UpdateState(Vector3 target, float xDegree, bool isMoving)
    {
        if (PauseGame.IsPaused())
        {
            return;
        }

        this.target    = target;
        xDeg           = xDegree;
        isTargetMoving = isMoving;

        if (!transitioning)
        {
            return;
        }

        if (transitionTimeHolder >= 1)
        {
            transitioning = false;
            return;
        }

        tempYPositionOffset    = Mathf.SmoothStep(tempYPositionOffset, yPositionOffset, transitionTimeHolder);
        tempXAngleOffset       = Mathf.LerpAngle(tempXAngleOffset, xAngleOffset, transitionTimeHolder);
        tempZoomDistancecIdle  = Mathf.SmoothStep(tempZoomDistancecIdle, zoomDistance.x, transitionTimeHolder);
        tempZoomDistanceMoving = Mathf.SmoothStep(tempZoomDistanceMoving, zoomDistance.y, transitionTimeHolder);

        transitionTimeHolder += Time.deltaTime * transitionStep;
    }
コード例 #18
0
    IEnumerator FinishDownload(WWWForm form)
    {
        WWW w = new WWW("http://angsila.cs.buu.ac.th/~58660001/pet/facebook.php", form);


        yield return(w);

        if (w.error != null)
        {
            print(w.error); //if there is an error, tell us
        }
        else
        {
            print("connection ok");
            print(w.data);
            var N = JSON.Parse(w.data);
            if (N["status"].Value.Equals("1"))
            {
                print("Login Sucessful");
                PauseGame p = new PauseGame(w.data);
                p.setItem(w.data);
                w.Dispose(); //clear our form in game
                Application.LoadLevel("mainGame");
            }
        }
        //Work with the retrieved info.
    }
コード例 #19
0
 void Start()
 {
     _pause    = GetComponent <PauseGame>();
     _movement = GetComponent <PlayerMovement>();
     _shoot    = GetComponent <Shoot>();
     _animator = GetComponentInChildren <Animator>();
 }
コード例 #20
0
        public static void Notify(object sender, GameEventArgs e)
        {
            switch (e.type)
            {
            case START_GAME:
                StartGame?.Invoke(sender, e);
                break;

            case PAUSE_GAME:
                PauseGame?.Invoke(sender, e);
                break;

            case RESUME_GAME:
                ResumeGame?.Invoke(sender, e);
                break;

            case STOP_GAME:
                StopGame?.Invoke(sender, e);
                break;

            case RESTART_GAME:
                RestartGame?.Invoke(sender, e);
                break;

            case START_MINI_GAME:
                StartMiniGame?.Invoke(sender, e);
                break;

            case END_MINI_GAME:
                EndMiniGame?.Invoke(sender, e);
                break;
            }
        }
コード例 #21
0
        /// <summary>
        /// Use it for notify from EventTrigger Component. Requires to be component on GameObject!
        /// </summary>
        /// <param name="sender">The sender object.</param>
        /// <param name="e">Event arguments</param>
        public void Notify(string type)
        {
            switch (type)
            {
            case START_GAME:
                StartGame?.Invoke(null, new GameEventArgs(type));
                break;

            case PAUSE_GAME:
                PauseGame?.Invoke(null, new GameEventArgs(type));
                break;

            case RESUME_GAME:
                ResumeGame?.Invoke(null, new GameEventArgs(type));
                break;

            case STOP_GAME:
                StopGame?.Invoke(null, new GameEventArgs(type));
                break;

            case RESTART_GAME:
                RestartGame?.Invoke(null, new GameEventArgs(type));
                break;

            case START_MINI_GAME:
                StartMiniGame?.Invoke(null, new GameEventArgs(type));
                break;

            case END_MINI_GAME:
                EndMiniGame?.Invoke(null, new GameEventArgs(type));
                break;
            }
        }
コード例 #22
0
    // Use this for initialization
    void Start()
    {
        // Initialize stats info
        currentStats           = new StatsInfo();
        currentStats.startTime = Time.time;
        totalStats             = new StatsInfo();
        totalStats.startTime   = Time.time;
        // Get the Message Manager
        msgManager = GetComponent <MessageManager> ();
        // Get the Player
        player = GameObject.FindGameObjectWithTag("Player");
        // Get the Ninja Controller
        ninjaController = player.GetComponent <NinjaController> ();
        ninjaController.setMessageManager(msgManager);
        // Get the Puzzles
        GameObject puzzle = GameObject.FindGameObjectWithTag("Puzzle");

        if (puzzle != null)
        {
            // Find the puzzles
            if (puzzle.name.Equals("Fire Puzzle", System.StringComparison.CurrentCultureIgnoreCase))
            {
                firePuzzle = puzzle;
            }
            else if (puzzle.name.Equals("Water Puzzle", System.StringComparison.CurrentCultureIgnoreCase))
            {
                waterPuzzle = puzzle;
            }
            else if (puzzle.name.Equals("Combo Puzzle", System.StringComparison.CurrentCultureIgnoreCase))
            {
                comboPuzzle = puzzle;
            }
        }
        // See if we need to find the pause UI
        if (pauseUI == null)
        {
            // Get the Pause UI
            pauseUI = GameObject.FindGameObjectWithTag("PauseUI");
        }
        // See if we need to find the stats UI
        if (statsUI == null)
        {
            // Get the Stats UI
            statsUI = GameObject.FindGameObjectWithTag("StatsUI");
            if (statsUI != null)
            {
                // Disable it for now
                statsUI.SetActive(false);
            }
        }
        // See if we need to find the ninja animation controller again
        if (ninjaAnimationController == null)
        {
            // Get the Ninja Animation Controller
            ninjaAnimationController = player.GetComponent <CyborgNinjaAnimationController> ();
        }
        // Get the pause script
        pauseScript = GetComponent <PauseGame> ();
    }
コード例 #23
0
ファイル: PauseMenu.cs プロジェクト: DrDoak/TourismGame
    public void QuickLoad()
    {
        PauseGame.Pause(false);
        string w = "Load Last QuickSave? ";

        w += "\n All unsaved Progress will be lost.";
        WarningMessage.DisplayWarning(w, m_pauseMenuUI, quickLoad, "Warning", SetFirstOption);
    }
コード例 #24
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         Canvas.SetActive(false);
         PauseGame.Unpause();
     }
 }
コード例 #25
0
ファイル: PlayerController.cs プロジェクト: jay-bennett/Genre
    void Start()
    {
        sr               = GetComponent <SpriteRenderer>();
        pauseObject      = GetComponent <PauseGame>();
        GOCanvas.enabled = false;

        Globals.difficulty = Difficulty.Easy;
    }
コード例 #26
0
 private void RaisePauseGame(bool pause)
 {
     _gamePaused = pause;
     if (PauseGame != null)
     {
         PauseGame.Invoke(_gamePaused);
     }
 }
コード例 #27
0
    public static void QuickLoad()
    {
        PauseGame.Pause(false);
        string w = "Load Last QuickSave? ";

        w += "\n All unsaved Progress will be lost.";
        PauseGame.DisplayWarning(w, Instance.m_pauseMenuUI, Instance.quickLoad, "Warning", Instance.SetFirstOption);
    }
コード例 #28
0
ファイル: FirstJump.cs プロジェクト: fitmat/trapped_game
    // Start is called before the first frame update
    void Start()
    {
        jumpVideoScreen.SetActive(false);
        windowFrame.SetActive(false);

        bc = FindObjectOfType <BallController>();
        pg = FindObjectOfType <PauseGame>();
    }
コード例 #29
0
ファイル: MainMenu.cs プロジェクト: noc1243/PI
    void initializeParameters()
    {
        selectedButton = 0;

        buttonClicks = GetComponentInParent <PauseGame> ();

        menuButtons = GetComponentsInChildren <Button> ();
    }
コード例 #30
0
    public void OnTriggerEnter(Collider other)
    {
        //Display the win canvas
        TestItOutText.SetActive(false);
        WinCanvas.SetActive(true);

        PauseGame.GameWin();
    }
コード例 #31
0
ファイル: PauseGame.cs プロジェクト: CharAlis/IndiesVSGamers
	void Awake()
	{
		Instance = this;
	}
コード例 #32
0
	void Awake(){
		pauseGame = GetComponent<PauseGame>();
	}
コード例 #33
0
	/*
	public void PickUpSacrifice(GameObject sacrifice)
	{
		print("pick up sacrafice");
		sacrifice.SetActive (false);
		sacrifice.GetComponent<Sacrifice> ().SetOwner (gameObject);
		m_Sacrifice = sacrifice;
	}
	
	public void DropSacrifice(Vector3 away)
	{
		if (m_Sacrifice != null)
		{
			print("drop sacrafice");
			m_Sacrifice.SetActive (true);
			m_Sacrifice.transform.position = transform.position;
			m_Sacrifice.transform.Translate (away * 2);
			m_Sacrifice.GetComponent<Sacrifice> ().SetOwner (null);
			m_Sacrifice = null;
		}
	}

	public void PlaceSacrifice()
	{
		if (m_Sacrifice != null)
		{
			print("place sacrafice in box");
			m_Sacrifice.GetComponent<Sacrifice> ().SetOwner (null);
			m_Sacrifice = null;
		}
	}
	*/

	// Use this for initialization
	void Start () {
		m_PauseGame = GameObject.Find ("PauseGame").GetComponent<PauseGame> ();
		m_IdleSprite = GetComponent<SpriteRenderer> ().sprite;

		m_DebuffTimers = new Dictionary<Debuffs, float>();
		m_PowerStateTimers = new Dictionary<PowerStates, float>();

		m_DebuffTimers.Add(Debuffs.Slow, 0);
		m_DebuffTimers.Add(Debuffs.Stun, 0);

		m_PowerStateTimers.Add(PowerStates.Invulnerability, 0);
		m_PowerStateTimers.Add(PowerStates.SuperSpeed, 0);


		PlayerMovement control = gameObject.GetComponent<PlayerMovement>();
		control._fMoveSpeed = m_MovementSpeed;

		animator = GetComponent<Animator> ();
	}