Наследование: MonoBehaviour
Пример #1
0
 private void Awake()
 {
     if (Instance != null)
     {
         Destroy(this);
         return;
     }
     Instance = this;
     DontDestroyOnLoad(gameObject);
 }
Пример #2
0
 private void Awake()
 {
     if (instance)
     {
         Destroy(gameObject);
         return;
     }
     instance = this;
     //sceneID = SceneManager.GetActiveScene().buildIndex;
 }
 // Update is called once per frame
 void Update()
 {
     foreach (var key in sceneChangerKeys)
     {
         if (Input.GetKeyDown(key))
         {
             SceneChanger.Instance().Change(next);
         }
     }
 }
Пример #4
0
    private void Start()
    {
        gameOptions  = FindObjectOfType <GameOptions>();
        sceneChanger = FindObjectOfType <SceneChanger>();
        optionsMenu.SetActive(false);
        creditsDisplay.SetActive(false);

        menuButtons = GetComponentsInChildren <Button>();
        setMenuButtonsInteractable(false);
    }
 public void OnRestartClicked()
 {
     if (IsListeningToEvents == true)
     {
         // FIXME: Notify the player that they'll lose their unsaved progress.
         // Transition to the current level
         SceneChanger.ReloadCurrentScene();
         Hide();
     }
 }
Пример #6
0
 // リスタート
 public void Restart()
 {
     // 効果音
     soundEffecter.PlayAnytime(Attribute.DON);
     // フェードアウトした後、シーンを再読み込み
     BlackOut.FadeOut(0.5f, 2f, 0.5f,
                      () => {
         SceneChanger.To(Scene.GAMEMAIN);
     });
 }
        private void Start()
        {
            _Button.OnClickAsObservable()
            .Where(_ => _VolumeChangeChecker.DirtyFlag)
            .Subscribe(_ => Debug.Log("確認ダイアログを出そう"));

            _Button.OnClickAsObservable()
            .Where(_ => !_VolumeChangeChecker.DirtyFlag)
            .Subscribe(_ => SceneChanger.SceneChange(SceneType.Title));
        }
Пример #8
0
 void Start()
 {
     if (_instance != null)
     {
         Destroy(gameObject);
         return;
     }
     _instance = this;
     DontDestroyOnLoad(gameObject);
 }
Пример #9
0
        public void OnRestartClicked()
        {
            if (IsListeningToEvents == true)
            {
                RecordNewHighScore();

                // Transition to the current level
                SceneChanger.ReloadCurrentScene();
            }
        }
Пример #10
0
    public override void _Ready()
    {
        Instance = this;

        player     = GetNode <AnimationPlayer>("CanvasLayer/AnimationPlayer");
        roundLabel = GetNode <Label>("CanvasLayer/RoundLabel");

        roundLabel.Show();
        roundLabel.SelfModulate = new Color(1, 1, 1, 0);
    }
Пример #11
0
    /// <summary>
    /// Quits the mini game called when the quit button is pressed.
    /// </summary>
    public void quitGame()
    {
        SceneManager.UnloadSceneAsync(this.gameObject.scene);
        move.setCanMove(true);
        PlayerData.instance.data.Money += score;
        SceneChanger sceneChanger = GameObject.Find("SceneChanger").GetComponent <SceneChanger> ();

        SoundManager.instance.playSFX("transition");
        sceneChanger.loadLevel("WorldMap", new Vector2(-6, 4));
    }
 public void OnReturnToMenuClicked()
 {
     if (IsListeningToEvents == true)
     {
         // FIXME: Notify the player that they'll lose their unsaved progress.
         // Transition to the menu
         SceneChanger.LoadMainMenu();
         Hide();
     }
 }
Пример #13
0
    private void Start()
    {
        ChangeState(eState.PLAYER_FALL);

        playerSkillManager.Init();
        playerStateMachine.Start();

        hitSize      = new Vector2(playerCollider.size.x, 0.1f);
        sceneChanger = SceneChanger.Instance;
    }
Пример #14
0
    public void Save_For_Reload()
    {
        SceneChanger FoodList = MainCameraObjScript.GetComponent <SceneChanger>();

        for (int i = 0; i < FoodList.FoodNames.Count; i++)
        {
            PlayerPrefs.SetString("Price" + i + FoodList.Scene_Identifier, FoodList.FoodPrices[i]); //save the price of the food
            PlayerPrefs.SetString("Food" + i + FoodList.Scene_Identifier, FoodList.FoodNames[i]);
        }
    }
Пример #15
0
 /// <summary>
 /// シングルの遷移ボタンをクリック時
 /// </summary>
 public void OnTapGameModeSingleButton()
 {
     if (!isMaxPossession)
     {
         SceneChanger.ChangeSceneAsync("SingleStageSelect");
     }
     else
     {
         OpenPresentBoxOverDialog();
     }
 }
Пример #16
0
 // Start is called before the first frame update
 void Start()
 {
     wall_pool_size = walls.Length;
     if (wallAmount > 0 && wall_pool_size != 0)
     {
         wall = Instantiate(walls[Random.Range(0, wall_pool_size)], this.GetComponent <Transform>());
     }
     sceneChanger = (SceneChanger)GameObject.Find("SceneManager").GetComponent <SceneChanger>();
     //playerManager = (PlayerManager)GameObject.Find("ZombiePlayer_Spawn_Postion").GetComponent<PlayerManager>();
     //playerLifeAmount = playerManager.GetPlayerLifeAmount();
 }
Пример #17
0
 /// <summary>
 /// ショップの遷移ボタンをクリック時
 /// </summary>
 public void OnTapShopButton()
 {
     if (!isMaxPossession)
     {
         SceneChanger.ChangeSceneAsync("Shop");
     }
     else
     {
         OpenPresentBoxOverDialog();
     }
 }
Пример #18
0
 public void startLevel()
 {
     if (!isLoading)
     {
         if (SceneName != "")
         {
             SceneChanger.loadScene(SceneName);
             isLoading = true;
         }
     }
 }
Пример #19
0
    public override IEnumerator Action()
    {
        var wait = new WaitForSeconds(1f);

        if (!isSetuna && !SceneChanger.Instance().isChanging)
        {
            AudioManager.Instance.PlayEnemySE(AudioName.oni_oaa_preAttack_03.String());
            yield return(wait);
        }
        yield return(enemyAttack.Attack());
    }
Пример #20
0
    public void MoveScene(string sceneName)
    {
        if (CurrentSpriteNum != sprites.Length - 1)
        {
            return;
        }

        SceneChanger sceneChanger = new SceneChanger();

        sceneChanger.LoadScene(sceneName);
    }
Пример #21
0
    private IEnumerator End()
    {
        TextChanger textChanger = textObject.GetComponent <TextChanger>();

        textChanger.ChangeText("Time!");
        yield return(new WaitForSeconds(4f));

        SceneChanger s = GetComponent <SceneChanger>();

        s.ChangeScene();
    }
Пример #22
0
 public void StartFadeIn()
 {
     alfa -= fadeSpeed;
     SetAlpha();
     if (alfa <= 0)
     {
         isFadeIn          = false;
         fadeImage.enabled = false;
         SceneChanger.ToStart();
     }
 }
Пример #23
0
 // Use this for initialization
 void Start()
 {
     lumo           = GameObject.FindGameObjectWithTag("Light").GetComponent <Light>();
     player         = GetComponent <SpriteRenderer>();
     def            = player.material;
     lumoHP         = maxLumoHP;
     source         = GetComponentInChildren <AudioSource>();
     scenechanger   = gameObject.AddComponent <SceneChanger>() as SceneChanger;
     anim           = GetComponent <Animator>();
     Time.timeScale = 1f;
 }
Пример #24
0
    // Update is called once per frame
    void Update()
    {
        _time_limit -= Time.deltaTime;

        _text.text = "TIME" + "\n" + ((int)_time_limit).ToString();

        if (_time_limit <= 0)
        {
            SceneChanger.sceneChange("Result");
        }
    }
 void Start()
 {
     StartCoroutine(LoadGameAsync());   //load game scene async while text displays
     sc           = FindObjectOfType <SceneChanger> ();
     typingSound  = GetComponent <AudioSource> ();
     display      = gameObject.GetComponent <Text> ();
     text         = display.text;
     display.text = "";
     coroutine    = DisplayCharByChar();
     StartCoroutine(coroutine);
 }
Пример #26
0
 private void Awake()
 {
     if (instance != null)
     {
         Debug.Log("More than one Scene Changer!");
         Destroy(gameObject);
         Destroy(this);
     }
     instance = this;
     DontDestroyOnLoad(gameObject);
 }
Пример #27
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
        public void OnStartClicked()
        {
            // Make sure the menu is active
            if (IsListeningToEvents == true)
            {
                // Load the first level automatically
                SceneChanger.LoadNextLevel();

                // Indicate button is clicked
                CurrentDefaultUi = defaultButton;
            }
        }
Пример #29
0
    public static SceneChanger instance = null; // Instance of class

    private void Awake()
    {
        // Creates instance of class
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
        }
    }
Пример #30
0
 private void Start()
 {
     if (instance)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
Пример #31
0
	// Use this for initialization
	void Start () {
        var = GetComponent<ObjectVariables>();

        obj_sceneChanger = GameObject.FindGameObjectWithTag("GLOBAL_sceneChanger");
        sceneChanger = obj_sceneChanger.GetComponent<SceneChanger>();
    }
Пример #32
0
 private void Start()
 {
     obj_sceneChanger = GameObject.FindGameObjectWithTag("GLOBAL_sceneChanger");
     sceneChanger = obj_sceneChanger.GetComponent<SceneChanger>();
 }
Пример #33
0
	// 初期化処理
    void Awake()
    {
        manager = SceneChanger.Manager;
    }