Inheritance: MonoBehaviour
コード例 #1
0
ファイル: Library.cs プロジェクト: taboo1/arena
    // Use this for initialization
    void Start()
    {
        currentScore = GameObject.Find("CurrentScore").GetComponent<CurrentScore>();
        fullScore = GameObject.FindObjectOfType<FullScore>();
        score = GetComponent<Score>();
        energy = GetComponent<Energy>();
        energyLine = GameObject.FindObjectOfType<EnergyLine>();
        inputController = GameObject.FindObjectOfType<InputController>();
        timerScript = GameObject.FindObjectOfType<TimerScript>();
        timerUI = GameObject.FindObjectOfType<TimerUI>();
        info = GetComponent<Info>();
        taskStrings = GetComponent<TaskStrings>();
        pauseButton = GameObject.FindObjectOfType<PauseButton>().gameObject;
        pauseMenu = GameObject.Find("Canvas").GetComponentInChildren<PauseMenu>();
          //  endMenu = GameObject.FindObjectOfType<EndMenu>();
        taskHelper = GameObject.FindObjectOfType<TaskHelper>();
        globalController = GetComponent<GlobalController>();
        cam = GameObject.Find("MainCamera");
        secondCamera = GameObject.Find("SecondCamera");
        wordRideCanvas = GameObject.FindObjectOfType<WordRideCanvas>();

        metalSparksPrefab = Resources.Load("Prefabs/Particles/MetalSpark") as GameObject;
        carUserParametres = GetComponent<CarUserParametres>();
        gameUI = GameObject.FindObjectOfType<GameUI>();
        canvasController = GameObject.FindObjectOfType<CanvasController>();

        particleCanvas = GameObject.Find("ParticleCanvas");
        carCreator = GameObject.FindObjectOfType<CarCreator>();

        mainBonus = GameObject.FindObjectOfType<MainBonus>();

        waitBackground = GameObject.FindObjectOfType<WaitBackground>();
    }
コード例 #2
0
	void Start()
	{
		Time.timeScale = 0f;
		pauseScript = GameObject.Find ("PauseMenu").gameObject.GetComponent<PauseMenu> ();
		pauseScript.Continue ();
		isBossDead = false;
		boss = GameObject.Find("Boss_01");
		core = GameObject.Find("Boss_01/core");
		canvas = GameObject.Find("Boss_01/core/Canvas");
		shield2 = GameObject.Find("Boss_01/boss01_shield_2");
		shield3 = GameObject.Find("Boss_01/boss01_shield_3");
		Eur = GameObject.Find("Boss_01/EUR");
		Eur2 = GameObject.Find("Boss_01/EUR_2");
		astroid = GameObject.Find("Boss_01/Astorid_Inner_Circle");
		astroid2 = GameObject.Find("Boss_01/Astorid_Inner_Circle_2");
		InvokeRepeating("SwitchSides", 1f, 2f);

		laser1.SetActive (false);

		laser2 = (GameObject) Instantiate (laser1, new Vector3 (laserBoss.transform.position.x, laserBoss.transform.position.y - 0.2f, 0.0f), 
			Quaternion.Euler(laser1.transform.rotation.x,laser1.transform.rotation.y,90));
		laser2.SetActive (false);
		//laser2OriginalScale = new Vector3(laser1.transform.localScale.x, 6.0f, laser1.transform.localScale.z);
		laser2.transform.localScale = new Vector3 (laser1.transform.localScale.x, 6.0f, laser1.transform.localScale.z);
	}
コード例 #3
0
	// Use this for initialization
	void Start () {
		Screen.orientation = ScreenOrientation.Landscape;
		//cam = GetComponent<CameraController>();
		spawnCamera ();
		spawnPointSytem ();
		spawnPlayer ();
		pause = cam.GetComponent<PauseMenu>();
	}
コード例 #4
0
ファイル: PauseMenu.cs プロジェクト: Jonanory/Reputations
 void Awake()
 {
     if(master == null){
         master = this;
     } else if (master != this){
         Destroy(gameObject);
     }
 }
コード例 #5
0
ファイル: TimeManager.cs プロジェクト: maxwellnewage/smiley
 //public GameObject gameOverScreen;
 //public PlayerController player;
 // Use this for initialization
 void Start()
 {
     countingTime = startingTime;
     theText = GetComponent<Text> ();
     thePauseMenu = FindObjectOfType<PauseMenu> ();
     theHealth = FindObjectOfType<HealthManager> ();
     //player = FindObjectOfType<PlayerController>();
 }
コード例 #6
0
 void Awake()
 {
     instance = this;
     inOptions = false;
     UITools.SetActiveState(instance.PausePanel, false);
     UITools.SetActiveState(instance.OptionsPanel,false);
     UITools.SetActiveState(instance.BackgroundPanel,false);
     if (Application.loadedLevelName == "Game") UITools.SetActiveState(TrialMessagePanel, false);
 }
コード例 #7
0
	void Start() {

		pauseMenu = this.GetComponent<PauseMenu> ();
		pauseMenu.enabled = false;

		settingsMenu = this.GetComponent<SettingsMenu> ();
		settingsMenu.enabled = false;

		levelSelect = this.GetComponent<LevelSelect> ();
		levelSelect.enabled = false;
	}
コード例 #8
0
ファイル: FPSController.cs プロジェクト: Thaon/IRNBRU
	// Use this for initialization
	void Start () {

        // Set target direction to the camera's initial orientation.
        targetDirection = transform.localRotation.eulerAngles;
        paused = GetComponent<PauseMenu>();
        player = GetComponent<FPSController>();

        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible = false;

    }
コード例 #9
0
ファイル: BaseLevel.cs プロジェクト: forwolk/HamburgTest
        public virtual void Pause()
        {
            if ( State == LevelState.Done )
                return;

            State = State == LevelState.Running ? LevelState.Paused : LevelState.Running;
            TimeProvider.Pause = State == LevelState.Paused;
            if ( State == LevelState.Paused )
                pauseMenu = Locator.UI.Show< PauseMenu >();
            else
                pauseMenu.Close();
        }
コード例 #10
0
ファイル: ItemStore.cs プロジェクト: OrlandoAguilar/Orly
 public ItemStore(Texture2D textDisk,Texture2D textInmune,Texture2D textFreeze,Texture2D coinsTexture,Texture2D textArrow,Texture2D textJewel,Texture2D textMas,PauseMenu father)
 {
     toolbarstrings=Globals.texts.itemToolbar;
     this.textDisk=textDisk;
     this.textInmune=textInmune;
     this.textFreeze=textFreeze;
     this.coinsTexture=coinsTexture;
     this.father=father;
     this.textArrow=textArrow;
     this.textJewel=textJewel;
     this.textMas=textMas;
 }
コード例 #11
0
        private void Awake()
        {
            _uiContainer = new GameObject("UI");

            _startupLogo = Instantiate(_startupLogoPrefab, _uiContainer.transform);
            EnableStartupLogo(false);

            _pauseMenu = Instantiate(_pauseMenuPrefab, _uiContainer.transform);
            EnablePauseUI(false);

            _debugUI = Instantiate(_debugUIPrefab, _uiContainer.transform);
            EnableDebugUI(false);
        }
コード例 #12
0
 // Use this for initialization
 void Awake()
 {
     if (!created)
     {
         DontDestroyOnLoad(this.gameObject);
         created = true;
     }
     stage1StartingPosition       = new Vector3(-3.83f, 0f, -1.34f);
     stage2StartingPosition       = new Vector3(-3.725f, 0f, -1.766f);
     stage3StartingPosition       = new Vector3(-3.942f, 0f, -1.54f);
     trainingRoomStartingPosition = new Vector3(-2.5f, 0f, -1.85f);
     pauseMenu = GetComponent <PauseMenu> ();
 }
コード例 #13
0
    private void Update()
    {
        if (_destroyedDevices >= 3 && !_gameOver)
        {
            _gameOver = true;
            PauseMenu _pauseScript = GameObject.Find("Canvas").GetComponent(typeof(PauseMenu)) as PauseMenu;

            if (_pauseScript != null)
            {
                _pauseScript.GameOver();
            }
        }
    }
コード例 #14
0
ファイル: PauseMenuButton.cs プロジェクト: Maximillian13/HS2
    // Setup
    void Start()
    {
        mr         = this.GetComponent <MeshRenderer>();
        mr.enabled = false;
        Transform pTrans = this.transform.parent;

        while (pTrans.GetComponent <PauseMenu>() == null)
        {
            pTrans = pTrans.parent;
        }

        master = pTrans.GetComponent <PauseMenu>();
    }
コード例 #15
0
 protected override void LateUpdate()
 {
     // Pausing
     if (Keybinds.EscapeDown() && !PauseMenu.IsPaused)
     {
         PauseMenu.Pause();
     }
     // Displaying Help Overlay
     if (Keybinds.ToggleHelpOverlay())
     {
         HUD.HelpOverlayController.Toggle();
     }
 }
コード例 #16
0
 private void Setup()
 {
     gameOverMenu   = GameObject.Find("GameOver");
     pauseMenuPanel = GameObject.Find("PauseMenu");
     timerText      = GameObject.Find("Timer").GetComponent <Text>();
     gameOver       = gameOverMenu.GetComponent <GameOver>();
     pauseMenu      = pauseMenuPanel.GetComponent <PauseMenu>();
     youWin         = GameObject.Find("YouWin").GetComponent <YouWin>();
     eventSystem    = EventSystem.current;
     mTime          = 0f;
     isPaused       = false;
     isStopped      = false;
 }
コード例 #17
0
 // Start is called before the first frame update
 void Start()
 {
     if (!journalExist)
     {
         journalExist = true;
         DontDestroyOnLoad(transform.gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
     pausedMG = FindObjectOfType <PauseMenu>();
 }
コード例 #18
0
 public void Pause()
 {
     if (isGamePaused)
     {
         return;
     }
     isGamePaused   = true;
     Time.timeScale = 0;
     audioController.Pause();
     pauseScoreText.text = "SCORE: " + score;
     HUD.SetActive(false);
     PauseMenu.SetActive(true);
 }
コード例 #19
0
        public void SetValues(string saveName, string saveTime, GameController gcScript, PauseMenu pmScript)
        {
            var nText = textName.GetComponent <TextMeshProUGUI>();

            sName = saveName;
            nText.SetText(saveName);
            var tText = time.GetComponent <TextMeshProUGUI>();

            tText.SetText(saveTime);

            gc = gcScript;
            pm = pmScript;
        }
コード例 #20
0
ファイル: Player.cs プロジェクト: muhedwardc/wescapek
    // Use this for initialization
    void Start()
    {
        speed     = 3;
        end       = false;
        bossShoot = false;
        rb2d      = GetComponent <Rigidbody2D>();
        pauseMenu = GetComponent <PauseMenu>();

        toBeContinuedUI.SetActive(false);
        gameOver = false;
        count    = 0;
        setCountText();
    }
コード例 #21
0
 // Use this for initialization
 void Start()
 {
     //SETTING UP REFERENCES
     rb          = GetComponent <Rigidbody2D>();
     GroundCheck = transform.Find("GroundCheck");
     anim        = GetComponent <Animator>();
     sr          = GetComponent <SpriteRenderer>();
     obj         = GameObject.Find("Objective").GetComponent <Objective>();
     tfObj       = GameObject.Find("Objective").GetComponent <Transform>();
     gameMaster  = GameObject.Find("GameMaster").GetComponent <GameMaster>();
     pauseMenu   = GameObject.Find("MENU").GetComponent <PauseMenu>();
     //playAnim = GameObject.Find("Dead").GetComponent<PlayAnimation>();
 }
コード例 #22
0
        public void PauseGame()
        {
            string textToHud = "kOS script has triggered a Pause Game.  Manual intervention needed to resume.";

            ScreenMessages.PostScreenMessage("<color=#ffff80><size=20>" + textToHud + "</size></color>", 10, ScreenMessageStyle.UPPER_CENTER);

            PauseMenu.Display();

            // It would be weird to execute the rest of the IPU's instructions when the script said to pause the game.
            // Presumably most users would expect calling Pause to make the script stop right there, not
            // like 3 or 4 lines later.  Therefore stop this FixedUpdate tick here:
            shared.Cpu.YieldProgram(new YieldFinishedNextTick());
        }
コード例 #23
0
    void Start()
    {
        pauseMenu       = PauseMenu.instance;
        currencyDisplay = FindObjectOfType <ResourceDisplay>();

        defendersParent = GameObject.Find(DEFENDERS_PARENT_NAME);
        if (defendersParent == null)
        {
            defendersParent = new GameObject(DEFENDERS_PARENT_NAME);
        }

        gameObject.SetActive(false);
    }
コード例 #24
0
    private void Start()
    {
        Time.timeScale = 1f;
        gameHasEnded   = false;
        score          = 0;

        pauseMenuUI.SetActive(false);
        optionsMenuUI.SetActive(false);
        completeMenuUI.SetActive(false);
        playerDiedUI.SetActive(false);

        pauseMenu = FindObjectOfType <PauseMenu>();
    }
コード例 #25
0
ファイル: TacticalMode.cs プロジェクト: emqk/Lands-of-Akslop
 public void Toggle()
 {
     if (isEnabled && !PauseMenu.IsEnabled())
     {
         Disable();
         AudioManager.instance.ClickButton();
     }
     else if (!PauseMenu.IsEnabled())
     {
         AudioManager.instance.ClickButton();
         Enable();
     }
 }
コード例 #26
0
 // Start is called before the first frame update
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
         return;
     }
     DontDestroyOnLoad(gameObject);
 }
コード例 #27
0
    // Use this for initialization
    void Start()
    {
        if (SceneManager.GetActiveScene().buildIndex <= 6)
        {
            StartCoroutine(StartMatchAnimation());
            pController = GameObject.FindGameObjectWithTag("Player").GetComponent <Controller>();
        }
        pauseMenu    = GetComponent <PauseMenu>();
        ambientSound = GetComponent <AudioSource>();
        ambientSound.Play();

        Time.timeScale = 1;
    }
コード例 #28
0
 // Use this for initialization
 void Start()
 {
     pauseMenu              = (PauseMenu)GameObject.FindGameObjectWithTag("MainCamera").GetComponent("PauseMenu");
     goPlayer               = GameObject.FindGameObjectWithTag("Player");
     player                 = (Player)goPlayer.GetComponent("Player");
     anim                   = gameObject.GetComponent <Animator>();
     rb2d                   = gameObject.GetComponent <Rigidbody2D>();
     lastDirectionX         = 1;
     reverseMode            = false;
     currentTimeReverseMode = 0f;
     Physics2D.IgnoreLayerCollision(UserInterfaceGraphics.LAYER_ENEMY, UserInterfaceGraphics.LAYER_ENEMY, true);
     Physics2D.IgnoreLayerCollision(UserInterfaceGraphics.LAYER_ENEMY, UserInterfaceGraphics.LAYER_ENEMY_SHOOT, true);
 }
コード例 #29
0
    void Update()
    {
        if (PauseMenu.IsOpen())
        {
            return;
        }

        // if( Input.GetKeyDown( KeyCode.Escape ) )
        // {
        //  Cursor.lockState = CursorLockMode.None;
        //  Cursor.visible = true;
        // }
        // if( Input.GetMouseButtonDown( 0 ) )
        // {
        //  Cursor.lockState = CursorLockMode.Locked;
        //  Cursor.visible = false;
        // }

        aim = new Vector2(Input.GetAxis("Mouse X"),
                          Input.GetAxis("Mouse Y")) * sensitivity;

        // cam.transform.eulerAngles = new Vector3(
        //  cam.eulerAngles.x - aim.y * rotationSpeed * Time.deltaTime,
        //  cam.eulerAngles.y + aim.x * rotationSpeed * Time.deltaTime,
        //  cam.eulerAngles.z );

        if (aim.y > maxAimMove)
        {
            aim.y = maxAimMove;
        }
        if (aim.y < -maxAimMove)
        {
            aim.y = -maxAimMove;
        }

        var tempAng = cam.transform.eulerAngles;

        tempAng.x = tempAng.x - aim.y * rotationSpeed * Time.fixedDeltaTime;
        // if( tempAng.x < 0.0f + verticalCutoff ) tempAng.x = 0.0f + verticalCutoff;
        if (tempAng.x > 90.0f - verticalCutoff && tempAng.x < 180.0f)
        {
            tempAng.x = 90.0f - verticalCutoff;
        }
        if (tempAng.x < 270.0f + verticalCutoff && tempAng.x > 180.0f)
        {
            tempAng.x = 270.0f + verticalCutoff;
        }
        tempAng.y = tempAng.y + aim.x * rotationSpeed * Time.fixedDeltaTime;
        tempAng.z = 0.0f;
        cam.transform.eulerAngles = tempAng;
    }
コード例 #30
0
    void Interact()
    {
        if (!target)
        {
            return;
        }

        Table table = target.GetComponent <Table>();

        if (table && Input.GetKeyDown(interactionKey))
        {
            if (table.GetItem() && !item && !isInteracting) //Take
            {
                Take(table);
                StartCoroutine(UpdateInteraction());
            }
            if (!table.GetItem() && item && !isInteracting) //Drop
            {
                Drop(table);
                StartCoroutine(UpdateInteraction());
            }
            if (table.GetItem() && item && !isInteracting) //Switch
            {
                Switch(table);
                StartCoroutine(UpdateInteraction());
            }
        }

        if (item)
        {
            itemOverlay.sprite = item.GetSprite();
        }
        else
        {
            itemOverlay.sprite = null;
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            FindObjectOfType <AudioManager>().Play("Pet");
            PauseMenu pause = FindObjectOfType <PauseMenu>();
            if (PauseMenu.GameIsPaused || pause.optionsMenuUI.activeSelf || pause.choiceMenuUI.activeSelf)
            {
                pause.Resume();
            }
            else
            {
                pause.Pause();
            }
        }
    }
コード例 #31
0
    // Use this for initialization
    void Start()
    {
        player = FindObjectOfType <PlayerMove> ();

        levelExit = FindObjectOfType <LevelLoader> ();

        pauseMenu = FindObjectOfType <PauseMenu> ();

                #if UNITY_ANDROID || UNITY_IOS
        gameObject.SetActive(true);
                #else
        gameObject.SetActive(false);
                #endif
    }
コード例 #32
0
    // Start is called before the first frame update
    protected virtual void Start()
    {
        //////////////
        if (_instance != null)
        {        // Singleton Lock
            Destroy(gameObject);
            return;
        }

        _instance = this;
        //////////////

        StopTime();
    }
コード例 #33
0
    // Update is called once per frame
    void Update()
    {
        if (started)
        {
            if (fadeWhiteTimer > 0)
            {
                fadeWhiteTimer -= Time.deltaTime;
                image.color     = new Color(image.color.r, image.color.g, image.color.b, 1 - (fadeWhiteTimer / fadeWhiteTime));
            }
            else
            {
                fadeBlack = true;
            }
        }

        if (fadeBlack)
        {
            if (fadeBlackTimer > 0)
            {
                fadeBlackTimer -= Time.deltaTime;
                image.color     = new Color(fadeBlackTimer / fadeBlackTime, fadeBlackTimer / fadeBlackTime, fadeBlackTimer / fadeBlackTime, 1);
            }
            else
            {
                showText = true;
            }
        }

        if (showText)
        {
            if (fadeTextTimer > 0)
            {
                fadeTextTimer  -= Time.deltaTime;
                text.color      = new Color(text.color.r, text.color.g, text.color.b, 1 - (fadeTextTimer / fadeTextTime));
                otherText.color = new Color(otherText.color.r, otherText.color.g, otherText.color.b, 1 - (fadeTextTimer / fadeTextTime));
            }
            else
            {
                if (returnToMenuTimer > 0)
                {
                    returnToMenuTimer -= Time.deltaTime;
                }
                else
                {
                    PauseMenu pause = GameObject.Find("/In-Game Canvas").GetComponent <PauseMenu>();
                    pause.BackToMainMenu();
                }
            }
        }
    }
コード例 #34
0
ファイル: PauseMenu.cs プロジェクト: Explorganix/KaishaNoKira
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
        GetComponent<Canvas>().enabled = false;
    }
コード例 #35
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Debug.Log("Instance already exists, destroying object!");
            Destroy(this);
        }

        instance.gameObject.SetActive(false);
    }
コード例 #36
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         if (menuStack.Count > 0)
         {
             menuStack.Peek().OnBackPressed();
         }
         else
         {
             PauseMenu.Show();
         }
     }
 }
コード例 #37
0
    public void StartAction()
    {
        playerFaceController.SetTemporaryEmotion(PlayerFaceController.Emotion.Happy, .3f);

        //Set up ModManager
        ModManager.assignFromPool = false;
        ModManager.rightArmOnLoad = rightArm.GetModType;
        ModManager.leftArmOnLoad  = leftArm.GetModType;

        // Acquire LoadMenu and set target.
        string targetSceneName = SceneTracker.CurrentSceneName;
        Menu   menu            = MenuManager.Instance.GetMenuByName(forwardMenuTarget);

        if (forwardMenuTarget != null)
        {
            MenuManager.Instance.DoTransition(menu, Transition.SHOW, new Effect[] { Effect.EXCLUSIVE });
        }
        else
        {
            MenuManager.Instance.ClearMenus();
        }

        if (UseLoadMenu)
        {
            LoadMenu loadMenu = (LoadMenu)menu;
            targetSceneName = loadMenu.TargetSceneName;
            Action onLoadMenuCompleteSceneLoad = () => {
                if (SceneTracker.IsSceneArena(targetSceneName))
                {
                    PauseMenu pauseMenu = (PauseMenu)MenuManager.Instance.GetMenuByName(Strings.MenuStrings.PAUSE);
                    pauseMenu.CanPause = true;
                    EventSystem.Instance.TriggerEvent(Strings.Events.LEVEL_STARTED, SceneTracker.CurrentSceneName, ModManager.leftArmOnLoad.ToString(), ModManager.rightArmOnLoad.ToString());
                }
                if (onCompleteSceneLoad != null)
                {
                    onCompleteSceneLoad();
                }
            };
            loadMenu.SetNavigation(targetSceneName, onLoadMenuCompleteSceneLoad);
        }
        else if (SceneTracker.IsSceneArena(targetSceneName))
        {
            EventSystem.Instance.TriggerEvent(Strings.Events.LEVEL_STARTED, SceneTracker.CurrentSceneName, ModManager.leftArmOnLoad.ToString(), ModManager.rightArmOnLoad.ToString());
        }

        if (onStartAction != null)
        {
            onStartAction();
        }
    }
コード例 #38
0
    // Start is called before the first frame update
    void Start()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(this.gameObject);
            return;
        }

        DontDestroyOnLoad(this.gameObject);
    }
コード例 #39
0
 public override void _Ready()
 {
     _chestGUI                    = GetNode <ChestGUI>("ChestGUI");
     _objectsYSort                = GetNode <YSort>("Objects");
     _player                      = _objectsYSort.GetNode <Player>("Player");
     _pauseMenu                   = GetNode <PauseMenu>("PauseMenu");
     _guildInterface              = GetNode <GuildInterface>("GuildInterface");
     _extendedTileMap             = GetNode <TileMap>("Extended");
     _firstChestPosition          = GetNode <Position2D>("FirstChestPosition").Position;
     _rightBorder                 = GetNode <CollisionShape2D>("Borders/Right");
     _player.birdsSystem.Visible  = false;
     _player.cloudsSystem.Visible = false;
     UpdateGuildFromLevel();
 }
コード例 #40
0
        public static void PauseMenu_Singal(On.Menu.PauseMenu.orig_Singal orig, PauseMenu self, MenuObject sender, string message)
        {
            orig(self, sender, message);
            if (message == "DISCONNECT")
            {
                Network.Disconnect();
                self.Singal(sender, "EXIT");
            }

            if (message == "START_CLIENT")
            {
                MonkArena.Instance.AddClientScript();
            }
        }
コード例 #41
0
ファイル: OptionsMenu.cs プロジェクト: Omaranwa/JumpingJax
    private void OnEnable()
    {
        GetSubcomponents();
        SetCurrentTab(SettingsTabs.controls);
        InitializeTabButtons();
        InitializeBackButton();
        InitializeDefaultButton();

        pauseMenu = GetComponentInParent <PauseMenu>();
        if (pauseMenu == null)
        {
            Debug.LogError("Options menu does not have a parented Pause Menu");
        }
    }
コード例 #42
0
	// Use this for initialization
	void Awake () {
        if(S != null) {
            Debug.Log("Multiple instances of PauseMenu detected.");
        }
        S = this;

        rt = pauseMenuPanel.GetComponent<RectTransform>();
        hasBow = false;
        hasBoomerang = false;

        if(weaponPrefabs.Length != weaponTexts.Length || weaponTexts.Length!= weaponNames.Length) {
            Debug.LogError("Different number of weapon prefabs, names, and text objects assigned to PauseMenu in editor");
        }
	}
コード例 #43
0
    // Use this for initialization
    void Start()
    {
        if (!instance) //simple singleton
        {
            instance = this;
        }
        else
        {
            Destroy(this.gameObject);
        }

        foreach (Image key in KeyIcons) //sets all icons to a base state of off
        {
            key.transform.gameObject.SetActive(false);
        }
        transform.gameObject.SetActive(false); //sets the canvas to inactive
    }
コード例 #44
0
    void Awake()
    {
        #region singleton
        if(instance == null)
        {
            instance = this;
        }
        else if(instance != this)
        {
            Destroy(gameObject);
        }
        #endregion

        #region component initializations
        pause			= GetComponent<PauseMenu>();
        notebook		= gameObject.GetComponentInChildren<NoteBook>();
        movement 		= GetComponent<MovementManager> ();
        interaction		= GetComponent<InteractionManager> ();
        #endregion
    }
コード例 #45
0
ファイル: MapEditorGUI.cs プロジェクト: jessmay/oil-penguins
    // Use this for initialization
    void Start()
    {
        button = new GUIStyle(skin.button);
        button.fontSize = 25;

        box = new GUIStyle(skin.box);
        label = new GUIStyle(skin.label);

        PauseMenu.setSkinTextures(button, box);

        miniMap = GetComponent<MiniMap>();
        pauseMenu = GetComponent<PauseMenu>();

        int GUIStart = Screen.width/2 - 400;
        float TextureArea = 665;
        float spaceBetween = TextureArea/(mapEditor.PlaceableItems.Length+1);
        int textureDisplaySize = 50;

        buttonBounds = new Rect[4];
        for(int currItem = 0; currItem < mapEditor.PlaceableItems.Length; ++currItem) {
            buttonBounds[currItem] = new Rect(GUIStart + spaceBetween * (currItem + 1) - textureDisplaySize/2,  Screen.height - GUISize/2 - textureDisplaySize/2, textureDisplaySize, textureDisplaySize);
        }
    }
コード例 #46
0
 // Use this for initialization
 void Start()
 {
     thePlayer = FindObjectOfType<Player>();
     thePauseMenu = FindObjectOfType<PauseMenu>();
 }
コード例 #47
0
 // Use this for initialization
 void Start () {
     m_Instance = this;
 }
コード例 #48
0
ファイル: GameController.cs プロジェクト: zehro/Projects
    void Awake()
    {
        finale = FindObjectOfType<FinaleController>();

        playerFX = transform.Find("PlayerPedestal/Player/PlayerCamera").GetComponent<PostProcessing>();
        playerFlare = transform.Find("PlayerPedestal/Player/PlayerCamera").GetComponent<FlareLayer>();
        destroyables = FindObjectsOfType<PortalDestroy>();
        stateAudio = transform.Find("GameAudio/StateAudio").GetComponents<AudioSource>();
        pauseMenu = transform.Find("GameUI/PauseMenu").GetComponent<PauseMenu>();

        if (GAME_COMPLETE && FindObjectOfType<LivingRoomController>() != null)
            canPause = false;
    }
コード例 #49
0
        public void Update()
        {
            try
            {
                if (!gameRunning)
                    return;

                if (pauseMenu != null)
                {
                    if (PauseMenu.isOpen && syncing)
                    {
                        if (KMPClientMain.tcpClient != null)
                        {
                            closePauseMenu = true;
                        }
                        else
                        {
                            disconnect("Connection terminated during sync");
                            forceQuit = true;
                        }
                    }
                    if (PauseMenu.isOpen && closePauseMenu)
                    {
                        closePauseMenu = false;
                        PauseMenu.Close();
                    }
                }

                if (FlightDriver.Pause) FlightDriver.SetPause(false);
                if (gameCheatsEnabled == false) {
                    CheatOptions.InfiniteFuel = false;
                    CheatOptions.InfiniteEVAFuel = false;
                    CheatOptions.InfiniteRCS = false;
                    CheatOptions.NoCrashDamage = false;
                    Destroy(FindObjectOfType(typeof(DebugToolbar)));
                }

                //Find an instance of the game's PauseMenu
                if (pauseMenu == null)
                    pauseMenu = (PauseMenu)FindObjectOfType(typeof(PauseMenu));

                //Find an instance of the game's RenderingManager
                if (renderManager == null)
                    renderManager = (RenderingManager)FindObjectOfType(typeof(RenderingManager));

                //Find an instance of the game's PlanetariumCamera
                if (planetariumCam == null)
                    planetariumCam = (PlanetariumCamera)FindObjectOfType(typeof(PlanetariumCamera));

                if (Input.GetKeyDown(KeyCode.F2))
                {
                    isGameHUDHidden = !isGameHUDHidden;
                }

                if (Input.GetKeyDown(KMPGlobalSettings.instance.guiToggleKey) && !isGameHUDHidden && KMPToggleButtonState)
                    KMPInfoDisplay.infoDisplayActive = !KMPInfoDisplay.infoDisplayActive;

                if (Input.GetKeyDown(KMPGlobalSettings.instance.screenshotKey))
                    StartCoroutine(shareScreenshot());

                if (Input.GetKeyDown(KMPGlobalSettings.instance.screenshotToggleKey) && !isGameHUDHidden && KMPToggleButtonState)
                    KMPScreenshotDisplay.windowEnabled = !KMPScreenshotDisplay.windowEnabled;

                if (Input.GetKeyDown(KMPGlobalSettings.instance.chatTalkKey))
                {
                    KMPChatDX.showInput = true;
                    //DISABLE SHIP CONTROL
                    InputLockManager.SetControlLock(ControlTypes.All,"KMP_ChatActive");
                }

                if (Input.GetKeyDown(KeyCode.Escape) && KMPChatDX.showInput)
                {
                    KMPChatDX.showInput = false;
                    //ENABLE SHIP CONTROL
                    InputLockManager.RemoveControlLock("KMP_ChatActive");
                    closePauseMenu = true;
                }

                if (Input.GetKeyDown(KMPGlobalSettings.instance.chatHideKey) && !isGameHUDHidden && KMPToggleButtonState)
                {
                    KMPGlobalSettings.instance.chatDXWindowEnabled = !KMPGlobalSettings.instance.chatDXWindowEnabled;
                    //if (KMPGlobalSettings.instance.chatDXWindowEnabled) KMPChatDX.enqueueChatLine("Press Chat key (" + (KMPGlobalSettings.instance.chatTalkKey == KeyCode.BackQuote ? "~" : KMPGlobalSettings.instance.chatTalkKey.ToString()) + ") to send a message");
                }

                if (Input.anyKeyDown)
                    lastKeyPressTime = UnityEngine.Time.realtimeSinceStartup;

                //Handle key-binding
                if (mappingGUIToggleKey)
                {
                    KeyCode key = KeyCode.F7;
                    if (getAnyKeyDown(ref key))
                    {
                        if (key != KeyCode.Mouse0)
                        {
                            KMPGlobalSettings.instance.guiToggleKey = key;
                            mappingGUIToggleKey = false;
                        }
                    }
                }

                if (mappingScreenshotKey)
                {
                    KeyCode key = KeyCode.F8;
                    if (getAnyKeyDown(ref key))
                    {
                        if (key != KeyCode.Mouse0)
                        {
                            KMPGlobalSettings.instance.screenshotKey = key;
                            mappingScreenshotKey = false;
                        }
                    }
                }

                if (mappingScreenshotToggleKey)
                {
                    KeyCode key = KeyCode.F10;
                    if (getAnyKeyDown(ref key))
                    {
                        if (key != KeyCode.Mouse0)
                        {
                            KMPGlobalSettings.instance.screenshotToggleKey = key;
                            mappingScreenshotToggleKey = false;
                        }
                    }
                }

                if (mappingChatKey)
                {
                    KeyCode key = KeyCode.Y;
                    if (getAnyKeyDown(ref key))
                    {
                        if (key != KeyCode.Mouse0)
                        {
                            KMPGlobalSettings.instance.chatTalkKey = key;
                            mappingChatKey = false;
                        }
                    }
                }

                if (mappingChatDXToggleKey)
                {
                    KeyCode key = KeyCode.F9;
                    if (getAnyKeyDown(ref key))
                    {
                        if (key != KeyCode.Mouse0)
                        {
                            KMPGlobalSettings.instance.chatHideKey = key;
                            mappingChatDXToggleKey = false;
                        }
                    }
                }
            } catch (Exception ex) { Log.Debug("Exception thrown in Update(), catch 2, Exception: {0}", ex.ToString()); Log.Debug ("u err: " + ex.Message + " " + ex.StackTrace); }
        }
コード例 #50
0
ファイル: TouchControls.cs プロジェクト: maxwellnewage/smiley
 // Use this for initialization
 void Start()
 {
     thePlayer = FindObjectOfType<PlayerController> ();
     levelExit = FindObjectOfType<LevelLoader> ();
     thePauseMenu = FindObjectOfType<PauseMenu> ();
 }
コード例 #51
0
	public void Initialize(PauseMenu pauseMenu)
	{
		this.pauseMenu = pauseMenu;
	}
コード例 #52
0
ファイル: PauseControls.cs プロジェクト: Solobolt/RTSClass
 // Use this for initialization
 void Start()
 {
     pauseMenu = GameObject.FindGameObjectWithTag ("UIController").GetComponent<PauseMenu> ();
 }
コード例 #53
0
    void Awake()
    {
        sounds = GetComponent<MedrashSounds>();
        runningEnemy = GameObject.FindGameObjectWithTag("Fugitive");
        pauseMenu = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<PauseMenu>();
        moveDirection = transform.TransformDirection(Vector3.forward);
        mainCharacter = GetComponent<MainCharacter>();
        animation = GetComponent<Animation>();

        if(!animation) Debug.Log("The character you would like to control doesn't have animations. Moving her might look weird.");

        if(!idle1Animation)
        {
            animation = null;
            Debug.Log("No idle 1 animation found. Turning off animations.");
        }
        if(!idle2Animation)
        {
            animation = null;
            Debug.Log("No idle 2 animation found. Turning off animations.");
        }
        if(!idle3Animation)
        {
            animation = null;
            Debug.Log("No idle 3 animation found. Turning off animations.");
        }
        if(!walkAnimation)
        {
            animation = null;
            Debug.Log("No walk animation found. Turning off animations.");
        }
        if(!walkSlowAnimation)
        {
            animation = null;
            Debug.Log("No walk slow animation found. Turning off animations.");
        }
        if(!runAnimation)
        {
            animation = null;
            Debug.Log("No run animation found. Turning off animations.");
        }
        if (!attack1Animation)
        {
            animation = null;
            Debug.Log("No attack animation found. Turning off animations.");
        }
        if (!attack12Animation)
        {
            animation = null;
            Debug.Log("No attack12 animation found. Turning off animations.");
        }
        if (!attack123Animation)
        {
            animation = null;
            Debug.Log("No attack123 animation found. Turning off animations.");
        }
        if (!death1Animation)
        {
            animation = null;
            Debug.Log("No death 1 animation found. Turning off animations.");
        }
        if (!death2Animation)
        {
            animation = null;
            Debug.Log("No death 2 animation found. Turning off animations.");
        }
        if (!receiveAttackAnimation)
        {
            animation = null;
            Debug.Log("No receive attack animation found. Turning off animations.");
        }
        if (!evadeLeftAnimation)
        {
            animation = null;
            Debug.Log("No evade left animation found. Turning off animations.");
        }
        if (!evadeRightAnimation)
        {
            animation = null;
            Debug.Log("No evade right animation found. Turning off animations.");
        }
        if (!evadeBackAnimation)
        {
            animation = null;
            Debug.Log("No evade back animation found. Turning off animations");
        }
        if (!danceAnimation)
        {
            animation = null;
            Debug.Log("No dance animation found. Turning off animations");
        }
        if (!fightStanceAnimation)
        {
            animation = null;
            Debug.Log("No fight stance animation found. Turning off animations.");
        }
        if (!runFastAnimation)
        {
            animation = null;
            Debug.Log("No run fast animation found. Turning off animations.");
        }

        attackDuration = baseAttackDuration/attack1AnimationSpeed;
        delayAttackValue = attackDuration;
        attackCooldownValue = delayAttackValue*1.5f;

        StartCoroutine(FixPositionRelativeToEntities());
        StartCoroutine(ComboVerification());
        StartCoroutine(ChangeIdleActivity());
    }
コード例 #54
0
ファイル: PauseMenu.cs プロジェクト: dvan3/penance
 void Start()
 {
     Instance = this;
     fpsarray = new float[Screen.width];
     Time.timeScale = 1;
     //	    pauseFilter = Camera.main.GetComponent<SepiaToneEffect>();
     PauseGame();
 }
コード例 #55
0
 // Use this for initialization
 void Start()
 {
     thePauseMenu = FindObjectOfType<PauseMenu> ();
 }
コード例 #56
0
ファイル: PauseMenu.cs プロジェクト: JamesZinger/Axon-TOJam9
        public PauseScreen( GUISkin Skin, SpriteRenderer BackgroundRenderer, PauseMenu PauseMenu)
            : base(Skin, BackgroundRenderer, PauseMenu)
        {
            activeButton 		= MenuButton.Resume;

            unselectedButtonMap = new Dictionary<MenuButton, Texture2D>();
            selectedButtonMap 	= new Dictionary<MenuButton, Texture2D>();
            styleMap 			= new Dictionary<MenuButton, GUIStyle> ();
            rectMap 			= new Dictionary<MenuButton, Rect>	   ();

            unselectedButtonMap.Add( MenuButton.Resume		  , Resources.Load<Texture2D>( "Sprites/GUI/PauseScreen/pauseResumeUnselected" 		 ) );
            unselectedButtonMap.Add( MenuButton.Restart		  , Resources.Load<Texture2D>( "Sprites/GUI/PauseScreen/pauseRestartUnselected" 	 ) );
            unselectedButtonMap.Add( MenuButton.Instructions  , Resources.Load<Texture2D>( "Sprites/GUI/PauseScreen/pauseinstructionsUnselected" ) );
            unselectedButtonMap.Add( MenuButton.QuitToMainMenu, Resources.Load<Texture2D>( "Sprites/GUI/PauseScreen/pauseQuitUnselected" 		 ) );

            selectedButtonMap.Add( MenuButton.Resume		, Resources.Load<Texture2D>( "Sprites/GUI/PauseScreen/pauseResumeSelected" 		 ) );
            selectedButtonMap.Add( MenuButton.Restart		, Resources.Load<Texture2D>( "Sprites/GUI/PauseScreen/pauseRestartSelected" 	 ) );
            selectedButtonMap.Add( MenuButton.Instructions	, Resources.Load<Texture2D>( "Sprites/GUI/PauseScreen/pauseinstructionsSelected" ) );
            selectedButtonMap.Add( MenuButton.QuitToMainMenu, Resources.Load<Texture2D>( "Sprites/GUI/PauseScreen/pauseQuitSelected" 		 ) );

            styleMap.Add( MenuButton.Resume		   , Skin.GetStyle("Pause-Resume" 	   ) );
            styleMap.Add( MenuButton.Restart	   , Skin.GetStyle("Pause-Restart"	   ) );
            styleMap.Add( MenuButton.Instructions  , Skin.GetStyle("Pause-Instructions") );
            styleMap.Add( MenuButton.QuitToMainMenu, Skin.GetStyle("Pause-QuitToMenu"  ) );

            rectMap.Add( MenuButton.Resume		  , new Rect( 303, 207, 250, 75 ) );
            rectMap.Add( MenuButton.Restart		  , new Rect( 303, 300, 250, 75 ) );
            rectMap.Add( MenuButton.Instructions  , new Rect( 275, 400, 325, 75 ) );
            rectMap.Add( MenuButton.QuitToMainMenu, new Rect( 240, 500, 400, 75 ) );

            Background = Resources.Load<Sprite>( "Sprites/GUI/Menu/mainMenu-home" );

            styleMap[ activeButton ].normal.background = selectedButtonMap[ activeButton ];
        }
コード例 #57
0
ファイル: PlayGameGUI.cs プロジェクト: jessmay/oil-penguins
    // Use this for initialization
    void Start()
    {
        button = new GUIStyle(skin.button);
        button.fontSize = 25;

        box = new GUIStyle(skin.box);
        label = new GUIStyle(skin.label);

        PauseMenu.setSkinTextures(button, box);

        miniMap = GetComponent<MiniMap>();
        pauseMenu = GetComponent<PauseMenu>();
    }
コード例 #58
0
ファイル: Player.cs プロジェクト: EricJSoler/astron
 void Start()
 {
     if(photonView.isMine)
         pauseMenuInScene = FindObjectOfType<PauseMenu>();
     myXpTimer = new XpTimer();
 }
コード例 #59
0
 private void Awake ()
 {
     m_PauseMenu = GetComponentInChildren <PauseMenu> ();
 }
コード例 #60
0
ファイル: PauseMenu.cs プロジェクト: JamesZinger/Axon-TOJam9
 public ScreenState( GUISkin Skin, SpriteRenderer BackgroundRenderer, PauseMenu PauseMenu )
 {
     this.skin = Skin;
     this.backgroundRenderer = BackgroundRenderer;
     this.pauseMenu = PauseMenu;
     this.background = null;
 }