Inheritance: MonoBehaviour
Esempio n. 1
0
 // Update is called once per
 void Update()
 {
     ito_flag2 = PauseScript.GetItoFlag();
     if (Input.GetMouseButtonDown(0) && ito_flag2 == 1)
     {
         swing = true;
         if (rb_player.velocity.y < 0)
         {
             Debug.Log("good");
         }
         if (rb_player.velocity.y > 0)
         {
             Debug.Log("bad");
         }
     }
     if (Input.GetMouseButtonUp(0) && ito_flag2 == 1)
     {
         jump = true;
         if (Random.Range(0, 100) < p)
         {
             wool = Instantiate(woolPrefab) as GameObject;
             wool.transform.position = new Vector3(transform.position.x + 65f, Random.Range(5.0f, 10.0f), 0f);
         }
     }
 }
Esempio n. 2
0
        // Update is called once per frame
        private void Update()
        {
            // if (Input.GetKey(KeyCode.Return))
            // { m_MouseLook.Init(transform, m_Camera.transform);
            //     //m_Camera.transform.rotation = Quaternion.identity;
            // }
            if (!PauseScript.pause() && !SettingScript.Settingpause())
            {
                if (FPSCon.GetComponent <MyStatus>().GetHp() > 1)
                {
                    RotateView();

                    // the jump state needs to read here to make sure it is not missed
                    if (!m_Jump)
                    {
                        m_Jump = CrossPlatformInputManager.GetButtonDown("Jump");
                    }

                    if (!m_PreviouslyGrounded && m_CharacterController.isGrounded)
                    {
                        StartCoroutine(m_JumpBob.DoBobCycle());
                        PlayLandingSound();
                        m_MoveDir.y = 0f;
                        m_Jumping   = false;
                    }
                    if (!m_CharacterController.isGrounded && !m_Jumping && m_PreviouslyGrounded)
                    {
                        m_MoveDir.y = 0f;
                    }

                    m_PreviouslyGrounded = m_CharacterController.isGrounded;
                }
            }
        }
Esempio n. 3
0
    // Start is called before the first frame update
    void Start()
    {
        if (!isLocalPlayer)
        {
            return;
        }
        if (isClient)
        {
            Cursor.lockState = CursorLockMode.Locked;
        }

        //materialRed = (Material)Resources.Load("Materials/GunPolymerRed");
        //materialBlue = (Material)Resources.Load("Materials/GunPolymerBlue");

        gameObject.transform.GetChild(1).gameObject.SetActive(true);

        cam.fieldOfView = fov;
        lightcomp       = flashlight.GetComponent <Light>();
        audioListener   = cam.gameObject.GetComponent <AudioListener>();
        pauseScript     = FindObjectOfType <PauseScript>();
        if (!(playerDecoObject == null))
        {
            playerDecoObject.layer = 9;
        }

        Debug.Log(team.ToString() + "Spawn");
        spawns = GameObject.FindGameObjectsWithTag(team.ToString() + "Spawn");

        Debug.Log(team);

        //CmdSetTeamColors(gameObject, team);
    }
Esempio n. 4
0
 void OnGUI()
 {
     if (!PauseScript.sharedInstance().isPaused())
     {
         this.infoGUI();
     }
 }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        PlayAgain.GetComponent<Canvas>();

        pauseGame = GetComponent<PauseScript>();
        PlayAgain.enabled = false;
    }
Esempio n. 6
0
 void Start()
 {
     ball.SetActive(true);
     ball2.SetActive(false);
     pauseMenu = GetComponent <PauseScript>();
     victoryCanvas.SetActive(false);
 }
Esempio n. 7
0
 void EndingCutscene()
 {
     //setup
     cutsceneActivated = false;
     //Get the horizontal extent of the camera
     horzExtent = Camera.main.orthographicSize * Screen.width / Screen.height;
     //Get the glow objects on items
     itemsGlow = GameObject.FindGameObjectsWithTag ("ParticleGlow");
     //Find the light bulb
     bulb = GameObject.Find ("LightBulb_NOT_lit_1");
     //Find the glow attached to the bulb
     bulbGlow = GameObject.Find ("LightBulbParticleGlow");
     //Get the color of the glow
     if (itemsGlow.Length > 1)
     {
         defaultGlowColor = itemsGlow[itemsGlow.Length - 1].GetComponent<ParticleSystem>().startColor;
     }
     player = GameObject.FindGameObjectWithTag("Player");
     cam = Camera.main.gameObject;
     pause = Camera.main.GetComponent<PauseScript>();
     pause.busy = true;
     //prevent player from moving until end of cutscene
     playerScript = player.GetComponent<PlayerControl>();
     playerScript.normalSpeed = 0f;
     // Figure out where the left wall is so the camera's panning can stop there
     wallMargin = wall.transform.position.x + wallOffset;
     StartCoroutine(_Cutscene());
 }
Esempio n. 8
0
 // Update is called once per frame
 void Update()
 {
     if (!PauseScript.sharedInstance().isPaused())
     {
         this.updateSelection();
     }
 }
Esempio n. 9
0
    // Update is called once per frame
    void Update()
    {
        // カーソル表示

        abc = settingsUI.activeSelf;
        if (settingsUI.activeSelf)
        {
            Cursor.visible   = true;
            Cursor.lockState = CursorLockMode.None;
            if (Input.GetKeyDown(KeyCode.Return))
            {
                if (GametoTitle.GetAnswer())        // ポーズUIのアクティブ、非アクティブを切り替え
                {
                    settingsUI.SetActive(!settingsUI.activeSelf);
                    Time.timeScale = 1f;
                }
            }
        }
        // else{Cursor.visible = false;
        //     Cursor.lockState = CursorLockMode.Locked;}

        if (Input.GetKeyDown(KeyCode.Return) && PauseScript.pause() && GametoTitle.GetModeSelect() == "Settings")
        {
            // ポーズUIのアクティブ、非アクティブを切り替え
            settingsUI.SetActive(false);
            this.GetComponent <PauseScript>().OnPause();

            // ポーズUIが表示されてる時は停止
            if (settingsUI.activeSelf)
            {
                Time.timeScale = 0f;
                // ポーズUIが表示されてなければ通常通り進行
            }
        }
    }
Esempio n. 10
0
 /// <summary>
 /// アプリ起動時に一回だけ実行される関数
 /// 基本的には変数の初期化処理を行う
 /// </summary>
 void Start()
 {
     player          = GameObject.Find("Player");
     pos             = GetComponent <Transform>().position;
     defaultPos      = player.transform.position;
     defaultRot      = player.transform.localEulerAngles;
     checkpointflag  = false;
     meDirection     = BACK;
     moveObjList     = new List <GameObject>();
     moveList        = new List <string>();
     CSV             = GameObject.Find("CSVWriter").GetComponent <CSVWriter>(); //GameObject CSVWriterを探し出してアタッチする
     panelController = GameObject.Find("edit").GetComponent <panelController>();
     floarController = GameObject.Find("floar").GetComponent <floorController>();
     seList          = GetComponents <AudioSource>();
     //ashioto = seList[0];
     //awa = seList[1];
     ifCheckFlg     = false;
     pauseScript    = player.GetComponent <PauseScript>();
     moveFlg        = false;
     panelList      = new List <GameObject>();
     whilePanelList = new List <GameObject>();
     ifActionMap    = null;
     panelIndex     = 0;
     moveCount      = 0F;
     whileCount     = 0;
     whileIndex     = 0;
     stage          = SceneManager.GetActiveScene().name;
     CSV.WriteCSV(stage + "," + 0);
     switching = false;
 }
Esempio n. 11
0
 private void Update()
 {
     if (ps == null)
     {
         ps = GameObject.FindGameObjectWithTag("GameController").GetComponent <PauseScript>();
     }
 }
Esempio n. 12
0
 void EndingCutscene()
 {
     //setup
     cutsceneActivated = false;
     //Get the horizontal extent of the camera
     horzExtent = Camera.main.orthographicSize * Screen.width / Screen.height;
     //Get the glow objects on items
     itemsGlow = GameObject.FindGameObjectsWithTag("ParticleGlow");
     //Find the light bulb
     bulb = GameObject.Find("LightBulb_NOT_lit_1");
     //Find the glow attached to the bulb
     bulbGlow = GameObject.Find("LightBulbParticleGlow");
     //Get the color of the glow
     if (itemsGlow.Length > 1)
     {
         defaultGlowColor = itemsGlow[itemsGlow.Length - 1].GetComponent <ParticleSystem>().startColor;
     }
     player     = GameObject.FindGameObjectWithTag("Player");
     cam        = Camera.main.gameObject;
     pause      = Camera.main.GetComponent <PauseScript>();
     pause.busy = true;
     //prevent player from moving until end of cutscene
     playerScript             = player.GetComponent <PlayerControl>();
     playerScript.normalSpeed = 0f;
     // Figure out where the left wall is so the camera's panning can stop there
     wallMargin = wall.transform.position.x + wallOffset;
     StartCoroutine(_Cutscene());
 }
Esempio n. 13
0
 public void GotoTitleScene()
 {
     if (PauseScript.gamePause == true)
     {
         PauseScript.SetPause(false);
     }
     SceneManager.LoadScene("Title");
 }
 void Start()
 {
     HelpKeyPressed = true;
     Pause_Script = GetComponent<PauseScript>();
     Pause_Script.PauseFunction();
     Scale.x = Screen.width/OriginalWidth;
     Scale.y = Screen.height/OriginalHeight;
 }
Esempio n. 15
0
 // Use this for initialization
 void Start()
 {
     Panel.gameObject.SetActive(false);
     pause       = GameObject.Find("PauseMenu").GetComponent <PauseScript> ();
     gameManager = GameObject.Find("GameManager").GetComponent <GameManager>();
     leaderboard = GameObject.Find("GameManager").GetComponent <Leaderboard>();
     Debug.Log(pause == null);
 }
Esempio n. 16
0
    public void resumeGame()
    {
        GameObject  pauseCanvas = GameObject.Find("PauseCanvas");
        PauseScript pauseScript = pauseCanvas.GetComponent <PauseScript>();

        Debug.Log("Button clicked = ");
        pauseScript.resumeGame();
    }
Esempio n. 17
0
 void Start()
 {
     if (pauseScript == null)
     {
         pauseScript = this;
     }
     pauseMenu.SetActive(false);
 }
Esempio n. 18
0
	void Start()
    {
        mainCamera.SetActive(true);
        gui.SetActive(true);
		dialogues.SetActive(true);
        pauseMenu.SetActive(false);
        pauseScript = pauseMenu.GetComponent<PauseScript>();
        //Cursor.visible = false;
    }
Esempio n. 19
0
 void Start()
 {
     mainCamera.SetActive(true);
     gui.SetActive(true);
     dialogues.SetActive(true);
     pauseMenu.SetActive(false);
     pauseScript = pauseMenu.GetComponent <PauseScript>();
     //Cursor.visible = false;
 }
Esempio n. 20
0
 void Awake()
 {
     middlePoint     = DisplayMetricsAndroid.WidthPixels / 2;
     brunoController = bruno.GetComponent <BrunoController>();
     spawner         = levelSpawner.GetComponent <LevelBlockSpawner>();
     waitingToStart  = !spawner.isSpawnLevel;
     pauseScript     = pauseScreen.GetComponent <PauseScript>();
     Debug.Log("Bruno controls on awake");
 }
Esempio n. 21
0
    void Start()
    {
        ps = GetComponent <PauseScript>();

        playClick     = false;
        settingsClick = false;
        backClick     = false;

        DisableSettings();
    }
    // Use this for initialization
    void Start()
    {
        //want to activate the pause function at this stage of the tutorial
        pauseScript = GameObject.Find("SceneManagement Script").GetComponent <PauseScript>();
        pauseScript.allowPauseKey = true;

        playerScript = GameObject.Find("Player").GetComponent <PlayerController>();

        clickContinueButton.onClick.AddListener(ifClickedContinue);
    }
Esempio n. 23
0
    void Awake()
    {
        GameObject pauseUIObj = GameObject.FindWithTag("PauseUI");

        if (pauseUIObj != null)
        {
            current = this;
            pauseUI = pauseUIObj.GetComponent <Canvas> ();
        }
    }
Esempio n. 24
0
 //Events
 // Use this for initialization
 void Start()
 {
     ropeCollected = false;
     drawing       = false;
     ropelessHole  = GameObject.Find("EmptyDungeonHole");
     ropeHole      = GameObject.Find("DungeonHole");
     player        = GameObject.Find("Player");
     pause         = GameObject.Find("PauseMenu").GetComponent <PauseScript>();
     soundFX       = GameObject.Find("Main Camera").GetComponent <FxHandler>();
 }
Esempio n. 25
0
 void Start()
 {
     playerScript = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerControl>();
     pause        = Camera.main.GetComponent <PauseScript>();
     audioHandler = GameObject.Find("AudioHandler").GetComponent <AudioHandlerScript>();
     // player = GameObject.Find("Player").GetComponent<PlayerControl>();
     //itemTextPanel = transform.Find("UICanvas/Overlay/ItemTextPanel").gameObject;//GameObject.Find("ItemTextPanel");
     //itemTextPanel.SetActive(false);
     clickPosition = new Vector2(0f, 0f);
     //cameraScript = Camera.main.GetComponent<CameraFollowScript>();
 }
Esempio n. 26
0
 private void Initialize()
 {
     if (PauseManager == null)
     {
         PauseManager = this;
     }
     else
     {
         Destroy(this);
     }
 }
Esempio n. 27
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Esempio n. 28
0
 ///
 /// \brief Called when the escape key is pressed
 ///
 /// \return No return value
 ///
 /// \details Will close the top most window or pause if no window is open
 ///
 public void onEsc()
 {
     if (windows.Count > 0)
     {
         _closeWindow();
     }
     else
     {
         PauseScript.Pause();
     }
 }
Esempio n. 29
0
    void Awake()
    {
        animator = GetComponent <Animator>();
        rb       = GetComponent <Rigidbody>();

        audioSource     = GetComponent <AudioSource>();
        player          = GetComponent <CharacterControlRB>();
        sphereCollider  = GetComponent <SphereCollider>();
        capsuleCollider = GetComponent <CapsuleCollider>();
        PS = GetComponent <PauseScript>();
    }
 void Start()
 {
     playerScript = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerControl>();
     pause = Camera.main.GetComponent<PauseScript>();
     audioHandler = GameObject.Find("AudioHandler").GetComponent<AudioHandlerScript>();
     // player = GameObject.Find("Player").GetComponent<PlayerControl>();
     //itemTextPanel = transform.Find("UICanvas/Overlay/ItemTextPanel").gameObject;//GameObject.Find("ItemTextPanel");
     //itemTextPanel.SetActive(false);
     clickPosition = new Vector2(0f, 0f);
     //cameraScript = Camera.main.GetComponent<CameraFollowScript>();
 }
Esempio n. 31
0
 /*unpauses game, can be called by button in pause menu itself
  * public void Unpause()
  * {
  *  //Debug.Log("Unpause");
  *  //Cursor.lockState = CursorLockMode.Locked;
  *  Time.timeScale = 1;
  *  paused = false;
  *  pauseUI.gameObject.SetActive(false);
  *  pauseSettingsUI.SetActive(false);
  *  Player.playerObj.FPSEnable(true);
  * }
  * private void pause(){
  *  //Debug.Log("Pause");
  *  Player.playerObj.FPSEnable(false);
  *  Time.timeScale = 0;
  *  pauseUI.gameObject.SetActive(true);
  * }*/
 #endregion
 /// Use this for initialization
 void Awake()
 {
     Debug.Log(name);
     if (pauseScript == null)
     {
         pauseScript = this;
     }
     else
     {
         Destroy(transform.gameObject);
     }
 }
Esempio n. 32
0
 public void Awake()
 {
     // only keep the first copy of this script around
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
 private void Start()
 {
     hasKey         = false;
     pause          = GetComponent <PauseScript>();
     anim           = GetComponent <Animator>();
     speed          = stats.speed;
     lookSpeed      = stats.speed;
     rb             = GetComponent <Rigidbody>();
     canMove        = true;
     laserSight     = GetComponent <LineRenderer>();
     grenadeManager = GetComponent <GrenadeManager>();
 }
    // Start is called before the first frame update
    void Start()
    {
        controller = GetComponent <CharacterController>();

        anim = GetComponent <Animator>();

        pause = FindObjectOfType <PauseScript>();

        sprintEnabled = true;

        mouseLook = true;
    }
Esempio n. 35
0
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     pausePanel = gameObject;
     pausePanel.SetActive(false);
 }
Esempio n. 36
0
    // Use this for initialization
    void Start()
    {
        initializeAnimator(gameObject.GetComponent<Animator>());
        obj1 = GameObject.Find("sBuildingO");
        obj2 = GameObject.Find("signO");
        obj3 = GameObject.Find("bBuildingO");
        obj4 = GameObject.Find("stationO");

        objectives[0] = obj1;
        objectives[1] = obj2;
        objectives[2] = obj3;
        objectives[3] = obj4;
        pauseScene = FindObjectOfType<PauseScript>();
    }
Esempio n. 37
0
 void Setup()
 {
     player = GameObject.FindGameObjectWithTag ("Player");
     cam = Camera.main.gameObject;//GameObject.FindGameObjectWithTag ("MainCamera");
     pause = Camera.main.GetComponent<PauseScript>();
     pause.busy = true;
     // Move the player to the center
     if (Application.loadedLevelName != "Tutorial Stage")
     {
         player.transform.position = new Vector3(143, player.transform.position.y, 0);
     }
     //prevent player from moving until end of cutscene
     playerScript = player.GetComponent<PlayerControl>();
     playerScript.normalSpeed = 0f;
     // Figure out where the left wall is so the camera's panning can stop there
     wallMargin = wall.transform.position.x + wallOffset;
 }
    // Use this for initialization
    void Start()
    {
        audioHandler = GameObject.Find("AudioHandler").GetComponent<AudioHandlerScript>();
        door = GameObject.Find ("DoorLeft");
        activated = false;
        wall = GameObject.Find ("LeftWall");
        //hunterEnemy = GameObject.FindGameObjectWithTag ("HunterEnemy");
        hunterEnemy.SetActive (false);
        levelBounds = this.transform.GetComponent<Renderer>().bounds;
        minY = levelBounds.center.y - levelBounds.extents.y;
        maxY = levelBounds.center.y + levelBounds.extents.y;
        player = GameObject.FindGameObjectWithTag ("Player");
        cam = Camera.main.gameObject;
        pause = Camera.main.GetComponent<PauseScript>();

        //player.transform.position = new Vector3 (128, player.transform.position.y, 0);
        playerScript = player.GetComponent<PlayerControl>();
        wallMargin = wall.transform.position.x + wallOffset;
        defaultSpeedTemp = playerScript.defaultSpeed;
    }
Esempio n. 39
0
 void OnDestroy()
 {
     PauseScript.singleton = null;
 }
Esempio n. 40
0
 void Start()
 {
     initializeAnimator(gameObject.GetComponent<Animator>());
     audioSource = gameObject.GetComponent<AudioSource>();
     pauseScene = FindObjectOfType<PauseScript>();
 }
 void Start()
 {
     PausingFunction = GetComponent<PauseScript>();
 }
Esempio n. 42
0
 void Awake()
 {
     PauseScript.singleton = this;
 }
Esempio n. 43
0
 // Use this for initialization
 void Start()
 {
     if (GameObject.FindObjectOfType<ConfirmScript>())
     {
         _p1Score = GameObject.FindObjectOfType<ConfirmScript>().SavedP1Score;
         _p2Score = GameObject.FindObjectOfType<ConfirmScript>().SavedP2Score;
         _levelScript = GameObject.FindObjectOfType<Player1LevelScript>();
         _levelp2Script = GameObject.FindObjectOfType<Player2LevelScript>();
         _finishScript = GameObject.FindObjectOfType<Finish>();
         _pauseScript = GameObject.FindObjectOfType<PauseScript>();
         _confirmScript = GameObject.FindObjectOfType<ConfirmScript>();
         _p1Text = GameObject.Find("P1 Text");
         _p2Text = GameObject.Find("P2 Text");
     }
 }
Esempio n. 44
0
 void Start()
 {
     pauseScript = FindObjectOfType(typeof(PauseScript)) as PauseScript;
 }
Esempio n. 45
0
 void Start()
 {
     animator = gameObject.GetComponent<Animator>();
     aud = gameObject.GetComponent<AudioSource>();
     pauseScene = FindObjectOfType<PauseScript>();
 }
 void Start()
 {
     Scale.x = Screen.width/OriginalWidth;
     Scale.y = Screen.height/OriginalHeight;
     PausingFunction = GetComponent<PauseScript>();
 }
Esempio n. 47
0
 // Use this for initialization
 void Start()
 {
     counterTime = startTime;
     pauseScene = FindObjectOfType<PauseScript>();
     timeCounter = GetComponent<Text>();
 }