Inheritance: MonoBehaviour
Esempio n. 1
0
 // Update is called once per frame
 void Update()
 {
     if (!PauseManager.isGamePaused)
     {
         PauseManager.Pause();
     }
 }
Esempio n. 2
0
    // Start is called before the first frame update
    void Start()
    {
        SceneFlag         = false;
        GameFrag          = false;
        GameOverFlag      = false;
        StageNameInstance = instance.GetComponent <SceneName>();
        PauseManager      = GameObject.Find("PauseManager").GetComponent <PauseManager>();
        WhiteFadeTrg      = false;
        Result            = GameObject.Find("ResultManager").GetComponent <ResultComponent>();

        BGMManager.Instance.Play(TitleAndSelectBGM);

        //フェード初期処理
        if (Fadeobj_In != null && Fadeobj_Out != null)
        {
            //Fadeobj.GetComponent<Canvas>().enabled = false;
            Fadeobj_Out.GetComponent <Canvas>().enabled = false;
            FadeAni_In = Fadeobj_In.GetComponent <FadeAnim>();
            //FadeAni_Out = Fadeobj_Out.GetComponent<FadeAnim>();
            FadeAni_Out = Fadeobj_Out.GetComponent <BubbleFadeOpe>();
        }
        else
        {
            Debug.Log("Error");
        }
    }
Esempio n. 3
0
 public static void DestroyMe(GameObject _gameObject)
 {
     inst.MyProc.Reset();
     inst = null;
     Debug.Log("Destroy:PauseManager");
     Destroy(_gameObject);
 }
 private void Start()
 {
     SceneManager.sceneLoaded += OnLevelFinishedLoading;
     pm = GameObject.Find("PauseCanvas").GetComponent <PauseManager>();
     ScoreCanvas.SetActive(false);
     RestartCanvas.SetActive(false);
 }
Esempio n. 5
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
 private void Die()
 {
     /* Debug.LogError("DeathNotImplemented");
      * SceneManager.LoadScene(SceneManager.GetActiveScene().name); */
     PauseManager.Pause();
     WinLoseMenu.main.TriggerDeath();
 }
Esempio n. 7
0
    // Use this for initialization
    private void Start()
    {
        print("start");
        buttonnowtime = 0.0f;
        startfont     = GameObject.Find("StartFont").GetComponent <StartFont>();
        menumanager   = GameObject.Find("MenuManager").GetComponent <MenuManager>();
        menuTransform = GameObject.Find("menuscreen").transform;
        pause         = GameObject.Find("PauseManager").GetComponent <PauseManager>();
        fd_out        = GameObject.Find("Panel").GetComponent <FadeImage>();
        timestop      = GameObject.Find("StageManager").transform.Find("ViewTimeMain").gameObject;
        stageMG       = GameObject.Find("StageManager").GetComponent <StageManager>();
        //値をunityの実変数からもらう
        menuPosition = menuTransform.position;
        //色を変更するゲームオブジェクトを入手
        buttoncolor = GameObject.Find("menu_button_game");
        //今の色コンソールに出力
        Debug.Log(buttoncolor.GetComponent <Renderer>().material.color);

        this.audioClip = new CustomAudioClip[(int)AudioList.AUDIO_MAX];
        this.audioClip[(int)AudioList.AUDIO_BUTTON].Clip = Resources.Load("Audio/SE/Button_Yes", typeof(AudioClip)) as AudioClip;
        this.audioClip[(int)AudioList.AUDIO_BUTTON].Vol  = 1.0f;

        this.sourceAudio         = this.gameObject.AddComponent <SourceAudio>();
        this.sourceAudio.m_Audio = this.audioClip;
    }
Esempio n. 8
0
    //public bool detected = false;

    private void Awake()
    {
        GM = GetComponent <GameManager>();
        checkpointsManager = GetComponent <CheckpointsManager>();

        player      = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>();
        inputs      = GameObject.FindGameObjectWithTag("Managers").GetComponent <ImputManager>();
        camera      = GameObject.FindGameObjectWithTag("TPCamera").GetComponent <CamaraAdjustment>();
        playerAnims = player.GetComponentInChildren <PlayerAnimations>();
        HUD         = GetComponent <HudManager>();
        weapon      = player.GetComponentInChildren <WeaponManager>();
        inv         = GameObject.FindGameObjectWithTag("Inventory").GetComponentInChildren <Inventory>();
        Items       = player.GetComponentInChildren <Items>();
        sound       = GetComponent <SoundManager>();
        peace       = player.GetComponentInChildren <HealthPeace>();
        CC          = player.GetComponent <CloseCombat>();
        //Hit = playerAnims.GetComponentInChildren<HitArea>();
        itemDetector = Items.GetComponent <ItemDetector>();
        throwImpact  = player.GetComponentInChildren <ThrowImpact>();
        stealth      = player.GetComponent <StealthSystem>();
        pauseMn      = gameObject.GetComponent <PauseManager>();
        IWM          = player.GetComponentInChildren <ImprovedWeaponManager>();

        Cursor.visible   = false;
        Cursor.lockState = CursorLockMode.Locked;
    }
 void ChangeText()
 {
     if (index < textToShow.Count - 1)
     {
         index++;
         text.text = textToShow[index];
     }
     else
     {
         text.text = "";
         if (end)
         {
             PauseManager p = Object.FindObjectOfType <PauseManager>();
             p.enabled = false;
             Initiate.Fade("EndScene", Color.black, 1.0f);
         }
         if (finish)
         {
             InventoryManager inventory = Object.FindObjectOfType <InventoryManager>();
             inventory.OnEnd();
             Initiate.Fade("StartScene", Color.black, 1.0f);
         }
     }
     call = true;
 }
Esempio n. 10
0
 private void Awake()
 {
     if (_pauseManager == null)
     {
         _pauseManager = FindObjectOfType <PauseManager>();
     }
 }
Esempio n. 11
0
 void Start()
 {
     handbrake      = false;
     rb             = GetComponent <Rigidbody> ();
     pauseManager   = GameObject.Find("GameManager").GetComponent <PauseManager> ();
     noticesManager = GameObject.Find("GameManager").GetComponent <NoticesManager> ();
 }
Esempio n. 12
0
    private void Awake()
    {
        prefabManager            = GetComponent <PrefabManager>();
        menuManager              = GetComponent <MenuManager>();
        sceneLoader              = GetComponent <SceneLoader>();
        charactersCommon         = GetComponent <CharactersCommon>();
        spawnCharacter           = GetComponent <SpawnCharacter>();
        pauseManager             = GetComponent <PauseManager>();
        levelMessageManager      = GetComponent <LevelMessageManager>();
        tutorialMessageManager   = GetComponent <TutorialMessageManager>();
        menuMessageManager       = GetComponent <MenuMessageManager>();
        threatManager            = GetComponent <ThreatManager>();
        timeEventManager         = GetComponent <TimeEventManager>();
        timeManager              = GetComponent <TimeManager>();
        cameraManager            = GetComponent <CameraManager>();
        notebookManager          = GetComponent <NotebookManager>();
        dialogBoxManager         = GetComponent <DialogBoxManager>();
        tutorialDialogBoxManager = GetComponent <TutorialDialogBoxManager>();
        idCardManager            = GetComponent <IdCardManager>();
        gameDataManager          = GetComponent <GameDataManager>();
        threatChartManager       = GetComponent <ThreatChartManager>();
        logManager        = GetComponent <LogManager>();
        userActionManager = GetComponent <UserActionManager>();

        if (SceneManager.GetActiveScene().buildIndex == StaticDb.menuSceneIndex ||
            SceneManager.GetActiveScene().buildIndex == StaticDb.loginSceneIndex)
        {
            return;
        }
        regularPathfinder  = GameObject.Find("PathFinderRegular").GetComponent <Pathfinding>();
        strictedPathfinder = GameObject.Find("PathFinderRestricted").GetComponent <Pathfinding>();
    }
Esempio n. 13
0
 /// <summary>
 /// Opens the menu panel.
 /// </summary>
 public void openMenuPanel()
 {
     menuPanel.SetActive(true);
     menuOpen = true;
     menuButton.SetActive(false);
     PauseManager.Pause();
 }
Esempio n. 14
0
    public void TogglePause()
    {
        try {
            pm = GameObject.Find("UI").GetComponent <PauseManager>();

            if (pm.IsHelpOpen())
            {
                return;
            }

            isPaused = !isPaused;
            pm.SetPauseUI(isPaused);

            if (isPaused)
            {
                Time.timeScale = 0f;
            }
            else
            {
                Time.timeScale = 1f;
            }
        } catch {
            Debug.LogWarning("Couldn't find pause manager");
        }
    }
Esempio n. 15
0
    private void Awake()
    {
        for (int i = 0; i < apearsPos.Length; i++)
        {
            apearsPos[i].parent.transform.gameObject.SetActive(true);
        }

        levelScene += 3;

        player       = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController2>();
        plAttack     = player.gameObject.GetComponent <PlayerAttack>();
        inventory    = GameObject.FindGameObjectWithTag("Inventory").GetComponent <Inventory2>();
        pauseManager = GameObject.FindGameObjectWithTag("PauseManager").GetComponent <PauseManager>();

        //Carga la player Info
        LoadPlayer();

        if (ScenesManager.scenesManager.comeFromDead)
        {
            inventory.actualMoney = inventory.actualMoney / 2;
            ScenesManager.scenesManager.comeFromDead = false;
        }
        //POSICIONA AL PLAYER
        PlayerPosition();
    }
Esempio n. 16
0
 public void AddTime() //If not paused, adds time
 {
     if (PauseManager.Get().GetPause() == false && PauseManager.Get().GetHasLanded() == false && PauseManager.Get().GetHasCrushed() == false)
     {
         time = time + 1 * Time.deltaTime;
     }
 }
Esempio n. 17
0
 void Awake()
 {
     Continuebtn = GetComponent <Button>();
     Continuebtn.onClick.AddListener(Continue);
     menu = GetComponentInParent <Canvas> ();
     p    = GetComponentInParent <PauseManager> ();
 }
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.BackQuote))
        {
            if (input.activeInHierarchy && output.activeInHierarchy)
            {
                PauseManager.UnPauseGame();
                input.SetActive(false);
                output.SetActive(false);
            }
            else
            {
                PauseManager.PauseGame();
                input.SetActive(true);
                output.SetActive(true);
                inField = input.GetComponent <InputField>();
                inField.ActivateInputField();
            }
        }

        if (delay >= 0)
        {
            delay = delay - Time.deltaTime;
        }
        else
        {
            if (deactivate)
            {
                output.SetActive(false);
                deactivate = false;
            }
        }
    }
Esempio n. 19
0
 void Awake()
 {
     isInvincible        = true;
     canShoot            = true;
     scoreManager        = FindObjectOfType <ScoreManager> ();
     formationController = FindObjectOfType <FormationController> ();
     enemyHealthManager  = GetComponent <EnemyHealthManager> ();
     if (scoreManager.score <= 50)
     {
         difficulty = (scoreManager.score / 10);
     }
     else
     {
         difficulty = 5;
     }
     enemySpeed = formationController.formationSpeed + difficulty;
     if (difficulty < 3)
     {
         enemyHealthManager.enemyHealth = 1 + difficulty;
     }
     else
     {
         enemyHealthManager.enemyHealth = 3;
     }
     pauseManager  = FindObjectOfType <PauseManager> ();
     shootCooldown = 0f;
 }
Esempio n. 20
0
    private void StartGameManager()
    {
        try
        {
            ResourcesLoaderManager = transform.GetComponentInChildren <ResourcesLoaderManager>();
            ResourcesLoaderManager.Init();
            EventsManager.Init();

            StatesEvents  = new StatesEvents();
            StatesManager = new StatesManager();

            StatesManager.ChangeCurrentState(new Begin());
            StatesManager.ChangeCurrentState(new Run());
            PlayerEvents       = new PlayerEvents();
            TimerManager       = new TimerManager();
            PauseManager       = new PauseManager();
            DefeatUIManager    = new DefeatUIManager();
            LevelsManager      = new LevelsManager();
            LeaderBoardManager = new LeaderBoardManager();
            //test
            LeaderBoardManager.GetRequestAndInstantiateIntoCanvas();
        }
        catch (Exception e)
        {
            Debug.LogException(e);
        }
    }
Esempio n. 21
0
    void Update()
    {
        LevelManager.Get().GetVVel(rig.velocity.y);
        LevelManager.Get().GetHVel(rig.velocity.x);
        LevelManager.Get().GetAltitude(this.transform.position.y);
        CameraZoom.Get().GetPlayerPos(this.transform.position);
        //Player movement and conditions when to move
        if (PauseManager.Get().GetPause() == true || PauseManager.Get().GetHasLanded() == true || PauseManager.Get().GetHasCrushed() == true || ScreenLevel.Get().GetOnLoadingScreen() == true)
        {
            rig.simulated = false;
        }
        else
        {
            rig.simulated = true;
            if (Input.GetKey(KeyCode.Space))
            {
                rig.AddForce(transform.up * thrust * Time.deltaTime);
                if (Time.timeScale == 1)
                {
                    LevelManager.Get().LoseFuel();
                }
            }

            if (Input.GetKey(KeyCode.LeftArrow))
            {
                transform.Rotate(Vector3.forward * rotationSpeed * Time.deltaTime);
            }
            if (Input.GetKey(KeyCode.RightArrow))
            {
                transform.Rotate(Vector3.back * rotationSpeed * Time.deltaTime);
            }
        }
    }
Esempio n. 22
0
 public override void OnUserClick()
 {
     if (!PauseManager.IsPaused() && !CameraFade.InstanceExists() && CanDestroyOnClick)
     {
         Destroy();
     }
 }
Esempio n. 23
0
 public void Lose() //Lose condition because of fuel
 {
     if (fuel <= 0)
     {
         PauseManager.Get().Crushed();
     }
 }
Esempio n. 24
0
    private IEnumerator ActivateDeathPanel()
    {
        yield return(new WaitForSeconds(GameConstants.DEATH_TIME));

        PauseManager.PauseGame();
        deathPanel.SetActive(true);
    }
Esempio n. 25
0
    // Update is called once per frame
    void Update()
    {
        if (PauseManager.IsPaused())
        {
            return;
        }

        if (DynamicGameManager.IsGameOver())
        {
            return;
        }

        timeLeft -= Time.deltaTime;
        if (timeLeft < currentCD)
        {
            countdown.Invoke();
            currentCD--;
        }
        if (timeLeft < 0)
        {
            timerOff.Invoke();
            if (timeBar != null)
            {
                timeBar.Set(0f);
            }
        }
        else if (timeBar != null)
        {
            timeBar.Set(timeLeft / maxTime);
        }
    }
Esempio n. 26
0
 public void return_to_game()
 {
     CityManager.update_total_people(0);
     PauseManager.pause_game(false);
     GameObject.Find("GameManager").GetComponent <BoxCollider2D>().enabled = true;
     activate_default_handler();
 }
Esempio n. 27
0
    //------------------------------------------------------------------------------------------
    // Start
    //------------------------------------------------------------------------------------------
    private void Start()
    {
        Data.time = 100;

        player           = GameObject.Find(Player.NAME);
        playerController = player.GetComponent <PlayerController>();

        if (Data.stage_number > 0)
        {
            var doors = doorWrapper.GetComponentsInChildren <DoorToStage>();
            foreach (var door in doors)
            {
                if (door.GetStageNumber() == Data.stage_number)
                {
                    player.transform.position = door.transform.position;
                    GameObject.Find(Common.Camera.CONTROLLER).GetComponent <CameraController>().ResetCameraPos(player.transform.position);
                    break;
                }
            }
        }

        GameObject go = GameObject.Find(PauseManager.NAME);

        if (!go)
        {
            Debug.Log("PauseManagerをシーンに追加してください");
        }

        pauseManager = go.GetComponent <PauseManager>();
        // シーン開始時にフェードインする
        FadeManager.FadeIn(0.01f);
        wipeCamera = GameObject.Find(Common.Camera.MAIN_CAMERA).GetComponent <WipeCamera>();
        wipeCamera.StartFadeIn(player.transform.position, 1.0f);
        waitTime = 1.0f;
    }
Esempio n. 28
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         PauseManager.GetInstance().SwitchPauseState();
     }
 }
Esempio n. 29
0
    // always is called regardless of if script is enabled
    void Awake()
    {
        anim            = GetComponent <Animator>();
        playerRigidBody = GetComponent <Rigidbody> ();

        p = menu.GetComponent <PauseManager>();
    }
Esempio n. 30
0
 // Use this for initialization
 void Start()
 {
     instance = this;
     rulePanel.SetActive(true);
     Pause();
     //ShowMessagePanel("You have found <color=Yellow>Elephant</color>!");
 }
Esempio n. 31
0
 // Use this for initialization
 void Start()
 {
     inst = this;
     camc = Cam.gameObject.GetComponent<CameraControls>();
     DebugConsole.RegisterCommand("Pause", Pause);
     CanPause = true;
     //var x = gameObject.GetComponent<WindZone>();
 }
Esempio n. 32
0
 void Start()
 {
     if(GameObject.Find("PauseMenu"))
     {
         PauseM = GameObject.Find("PauseMenu");
         PM = PauseM.GetComponent<PauseManager>();
     }
 }
Esempio n. 33
0
 // Use this for initialization
 void Start()
 {
     PauseM = GameObject.Find("PauseMenu");
     PM = PauseM.GetComponent<PauseManager>();
     CreditsM = GameObject.Find("HUD_Credits");
     CM = CreditsM.GetComponent<CreditsManager>();
     //Debug.Log("Spawned");
 }
Esempio n. 34
0
 void Start()
 {
     wasP = false;
     PauseM = PauseManager.inst;
     PausedTime = 0f;
     LifeTime += Time.time;
     StartTime = Time.time;
     //Debug.Log("Start Time: " + StartTime);
 }
Esempio n. 35
0
 void Start()
 {
     if(Application.loadedLevelName == "Restore Point") tScreen = GameObject.Find ("Title Screen Canvas").GetComponent<TitleScreen> ();
     canvasObject = GameObject.Find ("Canvas");
     inventoryItem = GetComponent<InventoryItem> ();
     player = GameObject.FindWithTag ("Player");
     healthManager = GameObject.Find ("Health Manager").GetComponent<HealthManager> ();
     pauseManager = GameObject.Find ("Pause Manager").GetComponent<PauseManager> ();
 }
Esempio n. 36
0
        // Use this for initialization
        void Awake()
        {
            //TODO load player prefs
            weaponEquipPosition = GameObject.Find("WeaponPosition");
			pauseManager = FindObjectOfType<PauseManager>();
            InitWeapons();
            InitUI();
            EquipPistol();

            StartCoroutine(UpdateUIGauge());
        }
    // Use this for initialization
    void Start()
    {
        m_skeletalDrawer = GetComponent<SkeletalHandController>();

        try {
            m_leapController = new Controller();
        } catch (Exception e) {
            Debug.Log(e);
        }
        m_pauseManager = GameObject.Find("PauseManager").GetComponent<PauseManager>();
    }
Esempio n. 38
0
    void Start()
    {
        canvasObject = GameObject.Find ("Canvas");
        canvasTransform = canvasObject.GetComponent<RectTransform> ();
        iconTransform = GetComponent<RectTransform> ();

        // reset canvas hierarchy so ScreenFade is always on top (masks UI/HUD on fade)
        sFader = GameObject.Find ("Screen Fade").GetComponent<ScreenFade> ();
        sFader.ResetParent ();

        pManager = GameObject.Find ("Pause Manager").GetComponent<PauseManager> ();
    }
Esempio n. 39
0
        void Awake()
        {
			pauseManager = FindObjectOfType<PauseManager>();

            SetupGun();
            SetupUI();
            if (type != WeaponType.Rocketlauncher)
            {
                StartCoroutine(DissipateHeat());
                _audioSource = GetComponent<AudioSource>();
            }

        }
    void Start()
    {
        // init joints
        for (int i = 0; i < m_joints.Length; ++i) {
            m_joints[i] = Instantiate(Resources.Load("Prefabs/JointSphere")) as GameObject;
        }
        // init langes
        for (int i = 0; i < m_langes.Length; ++i) {
            m_langes[i] = Instantiate(Resources.Load("Prefabs/Lange")) as GameObject;
        }

        // init finger tip
        m_fingerTip = Instantiate(Resources.Load("Prefabs/TipSphere")) as GameObject;

        // set trail color
        m_fingerTip.GetComponent<TrailRenderer>().material.color = m_trailColor;

        m_pauseManager = GameObject.Find("PauseManager").GetComponent<PauseManager>();
    }
Esempio n. 41
0
 void InitialValues()
 {
     pmScript = GameObject.Find("PauseManager").GetComponent<PauseManager>();
 }
Esempio n. 42
0
 void Awake()
 {
     instance = this;
 }
Esempio n. 43
0
    private void SetupInterfaces()
    {
        // create new HUD
        GameObject newUI = Instantiate(Resources.Load("RaceUI") as GameObject) as GameObject;
        RaceUI = newUI.GetComponent<HUDManager>();
        RaceUI.r = RaceSettings.SHIPS[0];
        RaceUI.accentColor = RaceSettings.SHIPS[0].settings.REF_HUDCOL;

        // create pause UI
        GameObject pauseUI = Instantiate(Resources.Load("PauseUI") as GameObject) as GameObject;
        PauseUI = pauseUI.GetComponent<PauseManager>();
        pauseUI.SetActive(false);

        // create dead UI
        GameObject deadUI = Instantiate(Resources.Load("DeadUI") as GameObject) as GameObject;
        DeadUI = deadUI.GetComponent<PauseManager>();
        deadUI.SetActive(false);

        // create finished UI
        GameObject finishedUI = Instantiate(Resources.Load("ResultsUI") as GameObject) as GameObject;
        FinishedUI = finishedUI.GetComponent<PauseManager>();
        FinishedUI.r = RaceSettings.SHIPS[0];
        finishedUI.SetActive(false);

        // create options UI
        GameObject optionsUI = Instantiate(Resources.Load("OptionsUI") as GameObject) as GameObject;
        optionsManager = optionsUI;
        optionsUI.SetActive(false);
    }
Esempio n. 44
0
 void OnEnable()
 {
     if (_instance == null)
         _instance = this;
     IsPaused = false;
 }
Esempio n. 45
0
    // Use this for initialization
    void Start()
    {
        zoomedOutPos = transform.position;
        zoomedOutRot = transform.rotation;
        lookAtTarget = true;
        distance = 1000;

        invHUD = GameObject.Find("HUD_Inventory").GetComponent<HUD_Inventory>();
        healthHUD = GameObject.Find("HUD_Healthbar").GetComponent<HUD_Healthbar>();
        hidePause = GameObject.Find("PauseButton").GetComponent<HideHUDElement>();
        hideTime = GameObject.Find("Time Button").GetComponent<HideHUDElement>();
        hideMap = GameObject.Find ("Map Button").GetComponent<HideHUDElement> ();

        pManager = GameObject.Find ("Pause Manager").GetComponent<PauseManager> ();
        hManager = GameObject.Find ("Health Manager").GetComponent<HealthManager> ();

        if(Application.loadedLevelName == "Restore Point"){
            tScreen = GameObject.Find("Title Screen Canvas").GetComponent<TitleScreen>();
            upArea = GameObject.Find("Upgrade Area Trigger").GetComponent<UpgradeArea>();
            if(tScreen.showTitleScreen){
                invHUD.hide();
                healthHUD.hide();
                hidePause.hide();
                hideTime.hide();
                hideMap.hide();
            }
        }
    }
 private void Start()
 {
     DamageCollider2D.enabled = true;
       EffectSprite.enabled = false;
       _PauseManager = _PauseManager ?? GameObject.FindObjectOfType<PauseManager>();
 }
 private void Awake()
 {
     ActionCooldown = 1.0f;
       ActionTime = 1.0f;
       _PauseManager = _PauseManager ?? GameObject.FindObjectOfType<PauseManager>();
 }
Esempio n. 48
0
 private void _RemoveInstance()
 {
     _Instance = null;
 }
Esempio n. 49
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            string path = DirectoryManager.TEXTURES;
            foreach (string f in Directory.GetFiles(path))
            {
                AssetManager.LoadAsset<Texture2D>(f.Replace(path, "").Replace(".png", ""), f.Replace(path, ""), Content);
            }

            AssetManager.LoadAsset<SpriteFont>("Console", "Console", Content);
            AssetManager.LoadAsset<SpriteFont>("default", "default", Content);

            AssetManager.LoadAsset<Effect>("CircleShader", "CircleEffect", Content);
            AssetManager.LoadAsset<Effect>("BS", "GoodButtonEffect", Content);

            PauseManager = new PauseManager();
            console = new RatingTDS.Code.Entities.Console();
        }
Esempio n. 50
0
 private void _SetInstance()
 {
     if (_Instance != null)
         {
             Debug.Log("cannot instantiate");
             Destroy(this.gameObject);
             return;
         }
         _Instance = this;
         DontDestroyOnLoad(this);
 }
 void Awake()
 {
     uiManager = FindObjectOfType<UIManager>();
     worldUI = FindObjectOfType<WorldUIManager>();
     pauseManager = GetComponentInChildren<PauseManager>();
     avatar = GameObject.FindGameObjectWithTag(Tags.Avatar).GetComponent<AvatarBehaviour>();
 }
Esempio n. 52
0
    // Use this for initialization
    void Start()
    {
        alert 			 = GameObject.Find ("Alert System").GetComponent<AlertManager>();
        eventSystem		 = GameObject.Find ("EventSystem").GetComponent<EventSystem> ();
        pHealth 		 = GameObject.Find ("Health Manager").GetComponent<HealthManager>();
        timeScale 		 = GameObject.Find("Time Manager").GetComponent<TimeScaler>();
        pManager		 = GameObject.Find ("Pause Manager").GetComponent<PauseManager> ();
        playerAnimator 	 = GetComponent<Animator>();
        bodyParts 		 = GetComponent<PlayerBodyparts> ().bodyparts;
        agent 			 = GetComponent<NavMeshAgent>();

        customDeltaTime  = Time.deltaTime;

        SetupMouseCursor();

        foreach (GameObject part in bodyParts)part.GetComponent<Renderer>().material.color = Color.green;
        agent.SetDestination(transform.position);
        playerAnimator.updateMode = AnimatorUpdateMode.UnscaledTime;
        Invoke("ToggleCanMove", 0.1f);
    }
Esempio n. 53
0
    // Use this for initialization
    void Start()
    {
        GameOptions.LoadGameSettings();
        GameSettings.CapFPS(GameSettings.GS_FRAMECAP);

        RaceSettings.trackData = trackData;

        trackData.FindSpawnTiles();

        SetRaceSettings();
        IndexSections();
        SetRaceShips();

        // HUD
        GameObject hudUI = Instantiate(Resources.Load("UI/HUD") as GameObject) as GameObject;
        ui = hudUI.GetComponent<RaceUI>();
        //ui.ship = RaceSettings.ships[0];

        // Menu de pausa
        //GameObject pauseUI = Instantiate(Resources.Load("UI/OPTIONS") as GameObject) as GameObject;
        //pause = pauseUI.GetComponent<PauseManager>();
        //pauseUI.SetActive(false);

        // Resultados
        GameObject ResultsUI = Instantiate(Resources.Load("UI/Results") as GameObject) as GameObject;
        results = ResultsUI.GetComponent<PauseManager>();
        ResultsUI.SetActive(false);

        SetManagers();
        AddImageEffects();
    }
Esempio n. 54
0
 // Use this for initialization
 void Start()
 {
     gameObject.tag = Tag;
     guiTexture.texture = G_N;
     ToolTip = GameObject.Find("HUD_ToolTip");
     ToolTip.transform.position = new Vector3(-1, ToolTip.transform.position.y, ToolTip.transform.position.z);
     T_Name = GameObject.Find("ToolTip_Name");
     T_Cost = GameObject.Find("ToolTip_Cost");
     T_Armor = GameObject.Find("ToolTip_Armor");
     T_Damage = GameObject.Find("ToolTip_Dmg");
     PauseM = GameObject.Find("PauseMenu");
     PM = PauseM.GetComponent<PauseManager>();
     CreditsM = GameObject.Find("HUD_Credits");
     CM = CreditsM.GetComponent<CreditsManager>();
     switch (ID)
     {
     case 1:
         KID = KeyCode.Alpha1;
         break;
     case 2:
         KID = KeyCode.Alpha2;
         break;
     case 3:
         KID = KeyCode.Alpha3;
         break;
     case 4:
         KID = KeyCode.Alpha4;
         break;
     default:
         Debug.LogError("Default reached");
         KID = KeyCode.Alpha1;
         break;
     }
 }