Exemplo n.º 1
0
 public override void MVCEnd(object obj)
 {
     base.MVCEnd(obj);
     mVCHelper.Unsubscribe(UIEvents.dataChanged, OnDataChanged);
     mVCHelper.Unsubscribe(UIEvents.backout, Backout);
     Pauser.UnpauseGame();
 }
Exemplo n.º 2
0
 // Use this for initialization
 void Awake()
 {
     pauser    = FindObjectOfType <Pauser>();
     playTween = playButton.transform.parent.GetComponent <TweenHeight>();
     UIEventListener.Get(playButton).onClick = OnPauseClick;
     UIEventListener.Get(quitButton).onClick = OnQuitClick;
 }
Exemplo n.º 3
0
    void Move()
    {
        if (Pauser.IsPaused())
        {
            return;
        }

        HandleSnakeBodies();
        CreateSnakeBody();

        if (direction == Direction.Up)
        {
            transform.position += new Vector3(0, moveSpeed, 0);
        }
        else if (direction == Direction.Down)
        {
            transform.position += new Vector3(0, -moveSpeed, 0);
        }
        else if (direction == Direction.Right)
        {
            transform.position += new Vector3(moveSpeed, 0, 0);
        }
        else if (direction == Direction.Left)
        {
            transform.position += new Vector3(-moveSpeed, 0, 0);
        }

        lastMove = direction;

        Debug.Log("Player moved to " + transform.position);
    }
Exemplo n.º 4
0
        public void TakeScreenshot()
        {
            if (!LiveStreamRunning && !Program.XBox.Ping())
            {
                new Settings().ShowDialog();
            }
            DateTime now = DateTime.Now;

            listImages.Items.Add(new ListViewItem(now.ToString() + " " + now.Second.ToString() + "." + now.Millisecond.ToString(), imageList.Images.Count, listImages.Groups[0]));
            Pauser.Reset();
            if (LiveStreamRunning)
            {
                Waiter.WaitOne();
            }
            Image screenshot = Program.XBox.Screenshot();

            Pauser.Set();
            Images.Add(screenshot);
            imageList.Images.Add(screenshot);
            if (!checkLiveStream.Checked)
            {
                listImages.SelectedItems.Clear();
                listImages.SelectedIndices.Clear();
                listImages.Items[listImages.Items.Count - 1].Selected = true;
            }
            cmdSaveChecked.Enabled  = true;
            cmdSaveSelected.Enabled = true;
        }
Exemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        if (Pauser.IsPaused() && !Pauser.IsFirstPaused())
        {
            return;
        }

        // Only handles input
        if (Input.GetKey("w") && lastMove != Direction.Down)
        {
            direction             = Direction.Up;
            transform.eulerAngles = new Vector3(0, 0, 0);
        }
        else if (Input.GetKey("a") && lastMove != Direction.Right)
        {
            direction             = Direction.Left;
            transform.eulerAngles = new Vector3(0, 0, 90);
        }
        else if (Input.GetKey("s") && lastMove != Direction.Up)
        {
            direction             = Direction.Down;
            transform.eulerAngles = new Vector3(0, 0, 180);
        }
        else if (Input.GetKey("d") && lastMove != Direction.Left)
        {
            direction             = Direction.Right;
            transform.eulerAngles = new Vector3(0, 0, 270);
        }
    }
Exemplo n.º 6
0
 // Use this for initialization
 void Start()
 {           //unchanged starter pack of ammo (will be changed with setting screen)
     ammonum = 0;
     //set up for needed objects and scripts
     ableToShoot = true;
     world       = GameObject.FindGameObjectWithTag("World").GetComponent("World") as World;
     mt          = GameObject.FindGameObjectWithTag("World").GetComponent("ModifyTerrain") as ModifyTerrain;
     if (gameObject.tag == "BSpawnP1")
     {
         player = GameObject.FindGameObjectWithTag("Player1");
         camera = GameObject.FindGameObjectWithTag("Player1Camera");
     }
     if (gameObject.tag == "BSpawnP2")
     {
         player = GameObject.FindGameObjectWithTag("Player2");
         camera = GameObject.FindGameObjectWithTag("Player2Camera");
     }
     p1       = GameObject.FindGameObjectWithTag("P1Hit").GetComponent("PlayerController") as PlayerController;
     p2       = GameObject.FindGameObjectWithTag("P2Hit").GetComponent("PlayerController") as PlayerController;
     pause    = GameObject.FindGameObjectWithTag("Pauser").GetComponent("Pauser") as Pauser;
     bullet   = pause.sBullet;
     rocket   = pause.sRocket;
     shotgun  = pause.sShotgun;
     crocket  = pause.sCRocket;
     cshotgun = pause.sCShotgun;
     missile  = pause.sAirstrike;
     cmissile = pause.sCAirstrike;
 }
Exemplo n.º 7
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetButtonDown("Submit"))
        {
            if (!isPause)
            {
                Pauser.Pause();
                FadeManager.Instance.Pause();
                isPause  = true;
                isFreeze = true;
            }
            else
            {
                Pauser.Resume();
                FadeManager.Instance.Resume();
                isPause  = false;
                isFreeze = false;
            }
        }

        if (!onceFlag)
        {
            StartCoroutine(Starting());
            onceFlag = true;
        }

        if (isClear)
        {
            StartCoroutine(Clearing());
        }
    }
Exemplo n.º 8
0
    // Update is called once per frame
    void Update()
    {
        if (GameManager.Instance.m_PlayMode != PlayMode.NoPlay)
        {
            if (Input.GetButtonDown("Pause"))
            {
                bool isPause = Pauser.s_TargetByTag[PauseTag.Pause].m_IsPause;
                if (!isPause)
                {
                    Pauser.Pause();
                    GameManager.Instance.m_GameStarter.AddScene("Pause");
                }
                //           else
                //           {
                //Pauser.Resume();
                //GameManager.Instance.m_GameStarter.RemoveScene("Pause");
                //           }
            }
        }

        if (Input.GetKeyDown(KeyCode.L))
        {
            bool isPause = Pauser.s_TargetByTag[PauseTag.Enemy].m_IsPause;
            if (!isPause)
            {
                Pauser.Pause(PauseTag.Enemy);
            }
            else
            {
                Pauser.Resume(PauseTag.Enemy);
            }
        }
    }
Exemplo n.º 9
0
 public void Command(Dictionary <string, string> command)
 {
     if (command ["command"] == "resume")
     {
         Pauser.Resume(command ["name"]);
     }
 }
    /// <summary>
    /// ポーズ処理
    /// </summary>
    private void Pause()
    {
        // ポーズするキーが押されたらポーズ
        if (Input.GetKeyDown(KeyCode.Escape))
        //if (Input.GetKeyDown(KeyCode.Joystick1Button7))
        {
            // ポーズしてなければポーズする
            if (!isPause)
            {
                // ポーズ中にする
                isPause = true;

                // ウィジェットを有効にする
                InitializeWidgetEnable(true);

                // 現在のメニューインデックスを初期化
                currentMenuIndex = 0;

                // メニューウィジェットの初期化
                InitializePauseMenuWidgetByCurrentIndex();

                // ポーズ直前のタイムスケールを保存
                prevTimeScale = Time.timeScale;

                // タイムスケールを0にする
                //
                // ここでタイムスケールの影響を受けるゲームオブジェクトは停止する
                //Time.timeScale  = 0;

                // ポーズ
                Pauser.Pause();
            }
        }
    }
Exemplo n.º 11
0
    /// <summary>
    /// トリガー検知
    /// </summary>
    public void OnTriggerEnter(Collider col)
    {
        // タグ別に処理
        string tag = col.transform.tag;

        switch (tag)
        {
        // プレイヤー
        case "Player":


            if (-1 == m_iCurrentSpeachIndex)
            {
                // 現在のセリフのインデックスを最初に合わせる
                m_iCurrentSpeachIndex = 0;



                col.GetComponent <AnimatorController>().AnimationChange(0);
                Pauser.Pause();
            }

            break;
        }
    }
Exemplo n.º 12
0
    void Start()
    {
        pauser = GameObject.Find("LevelManager").GetComponent <Pauser>();
        // Setting initial slot position. I'm doing an 8x5 grid, so we're going with these numbers
        Vector2 slotPosition = new Vector2(-350f, 200f);

        database       = new ItemDatabase();
        slotAmount     = 40;
        inventoryPanel = GameObject.Find("InventoryPanel");
        creditDisplay  = GameObject.Find("CreditDisplay");
        slotPanel      = inventoryPanel.transform.FindChild("SlotPanel").gameObject;

        for (int i = 0; i < slotAmount; i++)
        {
            playerItems.Add(new Item());
            playerSlots.Add(Instantiate(inventorySlot));
            playerSlots[i].GetComponent <Slot>().id = i;
            playerSlots[i].transform.SetParent(slotPanel.transform, false);
            playerSlots[i].transform.localPosition = slotPosition;
            // If it's zero or not the 8th slot, move right.  Otherwise, move down.
            if (i == 0 || (i + 1) % 8 != 0)
            {
                slotPosition = new Vector2(slotPosition.x + 100f, slotPosition.y);
            }
            else
            {
                slotPosition = new Vector2(-350f, slotPosition.y - 100f);
            }
        }

        LoadInventory();

        creditDisplay.GetComponent <Text>().text = credits.ToString();
    }
Exemplo n.º 13
0
    private void ToGo()
    {
        isPause = true;
        Pauser.Pause();

        Vector3 targetEulerAngles = new Vector3(90.0f, 0.0f, 0.0f);

        if (tabletMoveState == TabletMoveState.before && Application.loadedLevelName != Scenes.EndScene.name)
        {
            tabletPC = Instantiate(tabletPCPrefab, tabletTransform.position, tabletTransform.rotation) as GameObject;
            tabletPC.transform.parent = tabletTransform;

            StartCoroutine(TabletMovement(tabletPCAxis, targetEulerAngles, true));
            player.ShowMiniMap(false);
            ExamineIconManager.SetVisible(false);
        }

        if (tabletMoveState == TabletMoveState.after)
        {
            pauseState       = PauseState.Run;
            tabletMoveState  = TabletMoveState.before;
            Cursor.visible   = true;
            Cursor.lockState = CursorLockMode.None;
        }
    }
Exemplo n.º 14
0
 private void ShowPause()
 {
     if (Input.GetKeyDown(KeyCode.LeftControl))
     {
         Pauser.Pause();
     }
 }
 // Update is called once per frame
 void Update()
 {
     if (Input.GetButtonDown("Start"))
     {
         topMenu.GetComponent <SelectionController>().StartSelection();
         Pauser.PauseGame();
     }
 }
Exemplo n.º 16
0
    void Awake()
    {
        metaGame     = GameObject.Find("MetaGame");
        pauserScript = metaGame.GetComponent <Pauser>();

        //mainMenu = GameObject.Find ("MainMenu");
        //mainMenuScript = mainMenu.GetComponent<MenuScript>();
    }
Exemplo n.º 17
0
 public void EndMessage()
 {
     VoiceStop();
     //currentLine = 0;
     msgWindowInfo = currentTextName + "_End";
     Pauser.Resume();
     SetActive(false);
 }
Exemplo n.º 18
0
 public override void MVCSetup(object obj)
 {
     base.MVCSetup(obj);
     curLevelOfAdvancement = 0;
     mVCHelper.Subscribe(UIEvents.dataChanged, OnDataChanged);
     mVCHelper.Subscribe(UIEvents.backout, Backout);
     Pauser.PauseGame();
 }
Exemplo n.º 19
0
 /// <summary>
 /// <see cref="TimeReferee"/>'s constructor.
 /// </summary>
 /// <param name="pause">How to pause the game whenever a player scores.</param>
 /// <param name="end">How to end the game.</param>
 /// <param name="subscribe">How to subscribe to the match scoring.</param>
 /// <param name="duration">The desired duration of the match in seconds.</param>
 /// <param name="onUpdate">Callback to be invoked every time the timer ticks.</param>
 public TimeReferee(Pauser pause, Action end, Action <Scorer> subscribe, uint duration, Action <uint> onUpdate)
     : base(pause, end, subscribe)
 {
     _tokenSource = new CancellationTokenSource();
     _running     = true;
     _onUpdate    = onUpdate;
     _duration    = duration;
 }
Exemplo n.º 20
0
 public override void MVCSetup(object obj)
 {
     Pauser.PauseGame();
     base.MVCSetup(obj);
     selectionInfo = obj;
     mVCHelper.Subscribe(UIEvents.backout, BackoutOrExit);
     mVCHelper.Subscribe(UIEvents.execute, Select);
 }
Exemplo n.º 21
0
    IEnumerator Coroutine()
    {
        Time.timeScale = 0.3f;
        yield return(new WaitForSeconds(1));

        Time.timeScale = 1;
        Pauser.SaveMaterials();
        Application.LoadLevel("P" + playerNumber + "_FinishScreen");
    }
Exemplo n.º 22
0
 void Awake()
 {
     getScore = GameObject.Find ("guiSetup").GetComponent<guiSetup> ();
     pauser = GameObject.Find ("Pauser").GetComponent<Pauser> ();
     score1 = PlayerPrefs.GetInt ("Score1");
     score2 = PlayerPrefs.GetInt ("Score2");
     score3 = PlayerPrefs.GetInt ("Score3");
     score4 = PlayerPrefs.GetInt ("Score4");
 }
Exemplo n.º 23
0
    // Update is called once per frame
    void Update()
    {
        if (Pauser.IsPause())
        {
            return;
        }

        transform.position = new Vector3(transform.position.x, Mathf.Sin(Time.timeSinceLevelLoad * speed) * length, transform.position.z);
    }
Exemplo n.º 24
0
 // Use this for initialization
 void Start()
 {
     canFire   = true;
     dropspot  = transform.position;
     firstDrop = dropspot;
     p1        = GameObject.FindGameObjectWithTag("Player1");
     p2        = GameObject.FindGameObjectWithTag("Player2");
     pause     = GameObject.FindGameObjectWithTag("Pauser").GetComponent("Pauser") as Pauser;
 }
Exemplo n.º 25
0
    void Awake()
    {
        if (INSTANCE != null && INSTANCE != this)
        {
            Destroy(gameObject);
        }

        INSTANCE = this;
    }
Exemplo n.º 26
0
    // Use this for initialization
    void Start()
    {
        if (m_isAwake)
        {
            Run();
        }

        Pauser.Pause();
    }
Exemplo n.º 27
0
    void OnLevelWasLoaded(int level)
    {
        Pauser.SceneChangeInitialize();
        if (Application.loadedLevelName == Scenes.Menu.name || !player.ContainsItem(Items.Tablet) || AdvancedWriteMessageSingleton.instance.isWrite)
        {
            return;
        }

        Initialize();
    }
Exemplo n.º 28
0
    IEnumerator Coroutine()
    {
        PlayerIcon.StopWebcam();
        Time.timeScale = 0.6f;
        yield return(new WaitForSeconds(3));

        Time.timeScale = 1;
        Pauser.SaveMaterials();
        Application.LoadLevel("DrawFinishScreen");
    }
Exemplo n.º 29
0
    IEnumerator Coroutine()
    {
        //PlayerIcon.StopWebcam();
        Time.timeScale = 0.6f;
        yield return(new WaitForSeconds(3));

        Time.timeScale = 1;
        Pauser.SaveMaterials();
        UnityEngine.SceneManagement.SceneManager.LoadScene("P" + playerNumber + "_FinishScreen");
    }
Exemplo n.º 30
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 31
0
    //共通演出等を実行し、各演出を管理するコルーチン
    protected IEnumerator PerformManagement()
    {
        GameManager gm = GameManager.Instance;
        //フェード
        var async = gm.m_GameStarter.AddScene("FadeScene");

        while (async.isDone != false)
        {
            yield return(null);
        }
        //シーンのオブジェクトの作成を待つ(2フレ)
        yield return(null);

        yield return(null);

        //フェードイン
        bool             fadeEnd  = false;
        FadeSceneManager fadeMane = GameObject.Find("FadeSceneManager").GetComponent <FadeSceneManager>();

        fadeMane.EndEvent.AddListener(() => { fadeEnd = true; });
        fadeMane.FadeIn();

        while (!fadeEnd)
        {
            yield return(null);
        }

        /*暗転状態で行いたい処理*/
        //各オブジェクトの配置を初期化
        if (!CommonRedy())
        {
            yield break;
        }
        Redy();
        m_PerformAnim.clip.SampleAnimation(m_ParformAnimRootObj, 0.0f);
        GameManager.Instance.m_PlayCamera.SetActive(false);
        m_Camera.gameObject.SetActive(true);
        Pauser.Resume();
        yield return(null);

        //フェードアウト
        fadeEnd = false;
        fadeMane.FadeOut();
        while (!fadeEnd)
        {
            yield return(null);
        }

        //演出スタート
        yield return(StartCoroutine(PlayerParform()));

        //後処理
        EndPerform();
    }
Exemplo n.º 32
0
 void Awake()
 {
     pauser = GameObject.Find("Pauser").GetComponent<Pauser>();
     mancy = GameObject.Find("Mancy").GetComponent<Mancy>();
     //collider2D.enabled = false;
 }
Exemplo n.º 33
0
    private BallControl playerControl; // Reference to the player control script.

    #endregion Fields

    #region Methods

    void Awake()
    {
        pauser = GameObject.Find("Pauser").GetComponent<Pauser>();
        gameOver = GameObject.Find ("GM").GetComponent<GameOver> ();
    }
Exemplo n.º 34
0
    void Awake()
    {
        instance = this;

        camCS = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<CameraFollow>();

        playerT = GameObject.FindGameObjectWithTag("Player").transform;
        playerCS = playerT.GetComponent<PlayerControl>();
        nurse = GameObject.Find ("Nurse").gameObject;
        nursePointer = GameObject.Find ("nurse_UIpointer").gameObject;
        nursePointerHead = GameObject.Find ("nurse_PointerHead").gameObject;
        deathPanel = GameObject.Find ("DeathPanel").gameObject;
        winPanel = GameObject.Find ("WinPanel").gameObject;
        optionsPanel = GameObject.Find ("OptionsPanel").gameObject;

        pauser = transform.Find ("Pauser").GetComponent<Pauser>();
        //nursePointer.transform.parent = null;
        //nursePointer.GetComponent<OffscreenIndicator>().goToTrack = nurse;
        nursePointer.SetActive(false);
        nursePointerHead.SetActive(false);
        deathPanel.SetActive(false);
        winPanel.SetActive(false);
        optionsPanel.SetActive(false);
    }
Exemplo n.º 35
0
 void Awake()
 {
     //to create a singleton class
     if(gm == null)
         gm = GameObject.FindGameObjectWithTag ("GameController").GetComponent<GameMaster> ();
     pauser = gameObject.GetComponent<Pauser> ();
     cam = Camera.main;
     soundLevel = PlayerPrefs.GetFloat ("SoundLevel");		//getting sound level from player preference
     controlType = PlayerPrefs.GetString ("ControlType");	//getting control type from player preference
     Screen.sleepTimeout = SleepTimeout.NeverSleep;			//stop screen from timing out
     HighScore.getHighScore ();								//getting highScore into HighScore
     PlayGamesPlatform.Activate();
     screenManager = gameObject.GetComponent<ScreenManager>();
 }