Inheritance: MonoBehaviour
示例#1
0
 private void Awake()
 {
     switchScene                = SwitchScene.Instance;
     projectController          = ProjectController.Instance;
     endGameDialoguesController = EndGameDialoguesController.Instance;
     _dialogues = new List <string>();
 }
示例#2
0
 private void Awake()
 {
     _stachContainer = StachContainer.Instance;
     _switchScene    = SwitchScene.Instance;
     ActiveNotification(false);
     ActiveNextButton(true);
 }
示例#3
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        if (!GameManager.GetInstance())
        {
            SwitchScene switchScene = this.gameObject.AddComponent <SwitchScene> ();
            switchScene.loadScene("Start");
        }
        else
        {
            difficultyLevel = GameManager.GetInstance().GetLevel("MemoryMatch");
            typeOfMonster   = GameManager.GetMonsterType();
            CreateMonster();
            monsterObject.PlaySpawn();
            RetrieveFoodsFromManager();

            if (GameManager.GetInstance().LagoonReview)
            {
                StartReview();
            }
            else
            {
                PregameSetup();
            }
        }
    }
示例#4
0
 public void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         SwitchScene.ResetScene();
     }
 }
示例#5
0
        public static bool Execution()
        {
            if (Process.attackCount <= 0)
            {
                Outputs.Log("不需要战斗");
                return(false);
            }
            if (Process.watiFix)
            {
                Outputs.Log("等待空船坞修理中");
                return(false);
            }
            if (skipAttact)
            {
                Outputs.Log("跳过战斗开始等待");
                skipAttact = false;
                return(false);
            }
            try
            {
                SwitchScene.HomeToAttackChoice();
                SwitchScene.AttackChoiceToSeaAreaChoice();
                ChoiceSeaArea();
                ChoicePoint();
                ChoiceTeam();
                CheckTeam();
                Battle();
                Process.SetAttackCount(Process.attackCount - 1);
            }
            catch (AttackException)
            {
            }

            return(true);
        }
示例#6
0
    public void LoadMeun()
    {
        SwitchScene ss = new SwitchScene();

        ss.switchscene("MainMeun");
        Time.timeScale = 1f;
    }
示例#7
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        if (!GameManager.GetInstance())
        {
            SwitchScene switchScene = this.gameObject.AddComponent <SwitchScene> ();
            switchScene.loadScene("Start");
        }
        else
        {
            difficultyLevel = GameManager.GetInstance().GetLevel("Brainbow");
            scoreGoals      = new Dictionary <int, int> ()
            {
                { 1, 8 },
                { 2, 12 },
                { 3, 20 },
                { 4, 20 },
                { 5, 20 }
            };
        }
    }
示例#8
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))//this is the back button on Android
     {
         SwitchScene switchScene = new SwitchScene();
         switchScene.LoadScene(SceneNameToLoad, Color.blue);
     }
 }
示例#9
0
    public override void OnInspectorGUI()
    {
        switchScene = target as SwitchScene;

        switchScene.Update(ref switchScene.quit, "Quit");

        switchScene.mask = EditorGUILayout.MaskField("Scene", switchScene.mask, SwitchScene.SceneArray);
    }
示例#10
0
 private void Awake()
 {
     switchScene                       = SwitchScene.Instance;
     classActivityController           = ClassActivityController.Instance;
     projectController                 = ProjectController.Instance;
     characterStatusController         = CharacterStatusController.Instance;
     timeManager                       = TimeManager.Instance;
     foundNotificationControllerObject = GameObject.FindGameObjectWithTag("NotificationController");
     notificationController            = foundNotificationControllerObject.GetComponentInChildren <NotificationController>();
 }
示例#11
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        if (!GameManager.GetInstance())
        {
            SwitchScene switchScene = this.gameObject.AddComponent <SwitchScene> ();
            switchScene.loadScene("Start");
        }
        else
        {
            level = GameManager.GetInstance().GetLevel("BrainMaze") - 1;
            if (level > 2)
            {
                level = 2;
            }

            if (SoundManager.GetInstance())
            {
                SoundManager.GetInstance().ChangeBackgroundMusic(backgroundMusic);
                SoundManager.GetInstance().StopPlayingVoiceOver();
            }

            backButton.SetActive(true);
            stickerPopupCanvas.gameObject.SetActive(false);
            gameOverCanvas.SetActive(false);
            subtitlePanel.SetActive(false);
            tutorialHand.SetActive(false);
            ChangeSlider(0f);
            timeLeft = timeLimit;
            if (timerText == null)
            {
                Debug.LogError("No Timer Found!");
            }
            timerText.text = Mathf.Round(timeLeft).ToString();

            if (GameManager.GetInstance().LagoonTutorial [(int)Constants.BrainstormLagoonLevels.BRAINMAZE])
            {
                tutorialCoroutine = StartCoroutine(RunTutorial());
            }
            else
            {
                SetupMaze(level);
            }

            typeOfMonster = GameManager.GetMonsterType();
        }
    }
示例#12
0
 protected void Start()
 {
     Reset();
     if (GameManager.Instance != null)
     {
         gameManager = GameManager.Instance;
     }
     GameManager.Instance.OnGameStateChanged.AddListener(HandleGameStateChanged);
     switchScene  = SwitchScene.Instance;
     hasDisplayed = false;
 }
示例#13
0
 private void Awake()
 {
     _gameManager        = GameManager.Instance;
     _playerAction       = PlayerAction.Instance;
     _playerTransport    = PlayerTransport.Instance;
     _switchScene        = SwitchScene.Instance;
     _placesController   = PlacesController.Instance;
     _treasureController = TreasureController.Instance;
     _gameManager.OnGameStateChanged.AddListener(OnGameStateChangedHandler);
     ActiveTrasureAnimation(false);
 }
示例#14
0
 private void Awake()
 {
     m_switchScene                           = GetComponent <SwitchScene>();
     m_gameSparksManager                     = GameObject.Find("GameSparks").GetComponent <GameSparksManager>();
     MatchFoundMessage.Listener             += OnMatchFound;
     MatchNotFoundMessage.Listener          += OnMatchNotFound;
     m_gameSparksManager.OnPlayerReady      += OnMatchReady;
     m_gameSparksManager.OnPacketReceived   += PacketReceived;
     m_gameSparksManager.OnPlayerConnect    += PlayerConnected;
     m_gameSparksManager.OnPlayerDisconnect += PlayerDisconnect;
     FindMatch();
 }
示例#15
0
    private void Awake()
    {
        _templateController = ItemTemplateController.Instance;
        _treasureController = TreasureController.Instance;
        _playerAction       = PlayerAction.Instance;
        _switchScene        = SwitchScene.Instance;
        _itemsReceive       = new Stack <ItemPickUp>();
        _currentSpawnItems  = new List <SpawnItem>();

        ActiveReceiveCanvas(false);
        _itemTemp = _itemPrefab;
    }
 private void Awake()
 {
     // If SwitchScene is already added, use it, if not add one and use the typeOfGame variable to desired load scene
     if (GetComponent <SwitchScene>())
     {
         scene = GetComponent <SwitchScene> ();
     }
     else
     {
         scene = gameObject.AddComponent <SwitchScene> ();
         scene.sceneToLoadName = typeOfGame.ToString();
     }
 }
示例#17
0
    private void Awake()
    {
        _dialougeManager        = DialougeManager.Instance;
        _switchScene            = SwitchScene.Instance;
        _ideasController        = IdeasController.Instance;
        dialogues               = new List <Dialogue>();
        _notificationController = NotificationController.Instance;
        _gameManager            = GameManager.Instance;

        if (!ReferenceEquals(_gameManager, null))
        {
            _gameManager.OnGameStateChanged.AddListener(OnGameStateChangedHandler);
        }
    }
示例#18
0
    private IEnumerator OnTriggerEnter2D(Collider2D collision)
    {
        Player winner = collision.gameObject.GetComponent <Player>();

        if (!this.triggered && winner != null)
        {
            this.triggered = false;

            PlayerManager playerManager = PlayerManager.Instance;
            PointSystem   player        = PointSystem.Instance;
            int           loser         = winner.playerNumber == 1 ? 2 : 1;
            Finish        finish        = Finish.Instance;
            HUD.Hide();
            finish.ShowFinish(PlayerManager.Instance.GetPlayerName(winner.playerNumber) + " won!");

            Player player1 = playerManager.GetPlayer(1);
            Player player2 = playerManager.GetPlayer(2);
            player1.movementEnabled = player1.abilityEnabled = false;
            player2.movementEnabled = player2.abilityEnabled = false;
            yield return(new WaitForSeconds(2f));

            finish.HideFinish();

            LevelIntro intro = this.intros[1];
            this.StartCoroutine(intro.PlayIntro(
                                    new Dictionary <string, Transform>
            {
                { "player-winner", playerManager.GetPlayer(winner.playerNumber).transform },
                { "player-loser", playerManager.GetPlayer(loser).transform },
                { "heart", this.transform }
            },
                                    new Dictionary <string, string>
            {
                { "player-winner", playerManager.GetPlayerName(winner.playerNumber) },
                { "player-loser", playerManager.GetPlayerName(loser) },
                { "heart", "Heart" }
            }
                                    ));

            yield return(new WaitForSeconds(intro.Time));

            CameraMovement.Instance.TrackPlayers(1.5f);
            yield return(new WaitForSeconds(2f));

            SwitchScene switchScene = SwitchScene.Instance;

            switchScene.ShuffleLevel();
            SceneManager.LoadSceneAsync(switchScene.GetLevel());
        }
    }
示例#19
0
        public static bool Execution()
        {
            int d = 10;

            Wating.Home();
            while (d > 0)
            {
                Outputs.Log((d * 30).ToString() + "秒后刷新");
                Utils.Delay(30000);
                d--;
            }
            SwitchScene.HomeToSupply();
            SwitchScene.SupplyToHome();
            return(true);
        }
示例#20
0
 public void OnTriggerStay2D(Collider2D collision)
 {
     if (collision.CompareTag("Trap") && !move)
     {
         SwitchScene.ResetScene();
     }
     if (collision.CompareTag("End") && !move)
     {
         Camera.main.GetComponent <CameraController>().players.Remove(transform);
         Camera.main.GetComponent <EndLevel>().count++;
         collision.GetComponent <SpriteRenderer>().color = Color.white;
         collision.tag = "Untagged";
         Destroy(gameObject);
     }
 }
示例#21
0
    protected void Start()
    {
        _playerAction    = PlayerAction.Instance;
        _timeManager     = TimeManager.Instance;
        courseController = CoursesController.Instance;
        _gameManager     = GameManager.Instance;
        _switchScene     = SwitchScene.Instance;


        courseDisplayed = CourseDisplayed.AllCourse;
        _gameManager.OnGameStateChanged.AddListener(HandleGameStateChanged);

        all_course.SetActive(false);
        my_course.SetActive(false);
        ActivedNotificationCanvas(false);
        ActivedAllCourse();
    }
示例#22
0
    void Awake()
    {
        rb      = GetComponent <Rigidbody>();
        capsule = GetComponent <CapsuleCollider>();
        mouseLook.Init(transform, cam.transform);
        currentHealth = maxHealth;

        healthBar        = GameObject.Find("Health Bar").GetComponent <Slider>();
        maxHealthBar     = GameObject.Find("Max Health Bar").GetComponent <Slider>();
        movementSpeedBar = GameObject.Find("Movement Speed Bar").GetComponent <Slider>();

        healthBar.value        = currentHealth;
        maxHealthBar.value     = maxHealth;
        movementSpeedBar.value = forwardSpeed;

        sceneSwitcher = GetComponent <SwitchScene>();
    }
示例#23
0
    private void Awake()
    {
        _courseManager             = CourseManager.Instance;
        _timeManager               = TimeManager.Instance;
        _playerAction              = PlayerAction.Instance;
        _hardSkillsController      = HardSkillsController.Instance;
        _characterStatusController = CharacterStatusController.Instance;
        _coursesController         = CoursesController.Instance;
        _switchScene               = SwitchScene.Instance;

        _timeManager.OnTimeSkip.AddListener(OnTimeSkipCompleteHandler);

        dicBonus    = new Dictionary <string, int>();
        countMinute = 0;
        times       = 0;
        SetButtonActive(false);
    }
    void Start()
    {
        sceneLoader = GetComponent <SwitchScene> ();
        GameManager.Instance.LoadGame();

        monsterSpawn.gameObject.SetActive(false);
        if (GameManager.Instance.GetIsMonsterSelected())
        {
            monsterSpawn.gameObject.SetActive(true);
            CreateMonsterOnMap();
        }

        if (playIntro && !GameManager.Instance.isIntroShown)
        {
            GameManager.Instance.isIntroShown = true;
            DisableButtons();
            StartCoroutine(PlayIntro());
        }
    }
示例#25
0
        public static bool Execution()
        {
            if (!Process.expeditionTeam[0] && !Process.expeditionTeam[1] && !Process.expeditionTeam[2])
            {
                Outputs.Log("不需要远征");
                return(false);
            }

            SwitchScene.HomeToAttackChoice();
            SwitchScene.AttackChoiceToExpeditionChoice();
            for (int i = 0; i < Process.expeditionTeam.Length; i++)
            {
                if (Process.expeditionTeam[i])
                {
                    try
                    {
                        Utils.Delay(500);
                        if (Process.expedition[i] == 0)
                        {
                            Process.expeditionTeam[i] = false;
                        }
                        else
                        {
                            Outputs.Log((i + 2).ToString() + "队准备远征");
                            expedition = Process.expedition[i];
                            ChoiceSeaArea();
                            ChoiceExpedition(i + 2);
                            ChoiceTeam(i + 2);
                            CheckTeam(i + 2);
                        }
                    }
                    catch (ExpeditionException)
                    {
                        continue;
                    }
                }
            }

            SwitchScene.ExpeditionChoiceToHome();
            return(true);
        }
示例#26
0
        public static bool Execution()
        {
            bool All = true;

            if (!Process.supplyTeam[0] && !Process.supplyTeam[1] && !Process.supplyTeam[2] && !Process.supplyTeam[3])
            {
                Outputs.Log("不需要补给");
                return(false);
            }

            SwitchScene.HomeToSupply();
            for (int i = 0; i < Process.supplyTeam.Length; i++)
            {
                if (Process.supplyTeam[i])
                {
                    try
                    {
                        SupplyTeam(i + 1);
                    }
                    catch (SupplyException)
                    {
                        All = false;
                        continue;
                    }
                }
            }
            if (All)
            {
                Outputs.Log("全部补给完毕");
            }
            else
            {
                Outputs.Log("补给未全部完成,即将重新补给");
            }

            SwitchScene.SupplyToHome();

            return(true);
        }
示例#27
0
    // Update is called once per frame
    void Update()
    {
        timeLeft -= Time.deltaTime;

        if (Input.GetKey(KeyCode.W))
        {
            transform.position = new Vector3(transform.position.x, transform.position.y + speed * Time.deltaTime, transform.position.z);
        }

        if (Input.GetKey(KeyCode.S))
        {
            transform.position = new Vector3(transform.position.x, transform.position.y + -speed * Time.deltaTime, transform.position.z);
        }

        if (Input.GetKey(KeyCode.A))
        {
            transform.position = new Vector3(transform.position.x + -speed * Time.deltaTime, transform.position.y, transform.position.z);
        }

        if (Input.GetKey(KeyCode.D))
        {
            transform.position = new Vector3(transform.position.x + speed * Time.deltaTime, transform.position.y, transform.position.z);
        }

        if (Input.GetKey(KeyCode.O))
        {
            points++;
        }

        if (Mathf.Round(timeLeft) == 0)
        {
            GameObject  camera = GameObject.Find("Main Camera");
            SwitchScene s      = camera.GetComponent <SwitchScene> ();
            HackManager.Instance().setSuccesfull(false);
            s.openScene("TextComposerScene");
        }

        updateScoreboard();
    }
示例#28
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        if (!GameManager.GetInstance())
        {
            SwitchScene switchScene = this.gameObject.AddComponent <SwitchScene> ();
            switchScene.loadScene("Start");
        }

        if (SoundManager.GetInstance())
        {
            SoundManager.GetInstance().ChangeBackgroundMusic(SoundManager.GetInstance().gameBackgroundMusic);
        }
    }
示例#29
0
    void OnCollisionEnter2D(Collision2D coll)
    {
        /*if (coll.gameObject.name == "Trail") {
         *      GameObject camera = GameObject.Find ("Main Camera");
         *      SwitchScene s = camera.GetComponent<SwitchScene> ();
         *      HackManager.Instance ().setSuccesfull (false);
         *      s.openScene ("TextComposerScene");
         * }*/

        if (coll.gameObject.name == "Skull")
        {
            points++;
            coll.gameObject.transform.position = new Vector3(Random.Range(-7.8f, 7.8f), Random.Range(-2.9f, 5f), coll.gameObject.transform.position.z);

            if (points >= pointsNeeded)
            {
                GameObject  camera = GameObject.Find("Main Camera");
                SwitchScene s      = camera.GetComponent <SwitchScene> ();
                HackManager.Instance().setSuccesfull(true);
                s.openScene("TextComposerScene");
            }
        }
    }
示例#30
0
    private void Update()
    {
        if (count == 2)
        {
            switch (next)
            {
            case NextLevel.SameLevel:
                SwitchScene.index++;
                SwitchScene.ResetScene();
                break;

            case NextLevel.AnotherLevel:
                SwitchScene.level = level;
                SwitchScene.index = index;
                SwitchScene.ResetScene();
                break;

            case NextLevel.AnotherScene:
                SwitchScene.LoadScene(indexScene);
                break;
            }
        }
    }