Beispiel #1
0
 public void UnStop()
 {
     this.GetComponent <Rigidbody2D>().velocity = v_before_stop;
     this.status.movement_speed = initialmovementspeed;
     SoundControl.PlaySFX(GlobalData.SFX_Paths[status.type == 0 ? 3 : 5], false, true, true);
     //TODO stop behaviour cycle too
 }
Beispiel #2
0
    public void BackToPlayMenu()
    {
        SoundControl.PlaySFX(GlobalData.SFX_Paths[0], false, true, true);

        GameObject.Find("MainMenu").transform.Find("PlayMenu").gameObject.SetActive(true);
        this.gameObject.SetActive(false);
    }
Beispiel #3
0
 private unsafe void TransitionOut()
 {
     SoundControl.FadeOutBattleBGMToOverworldBGM();
     _fadeTransition = new FadeToColorTransition(500, 0);
     Game.Instance.SetCallback(CB_FadeOutBattle);
     Game.Instance.SetRCallback(RCB_Fading);
 }
Beispiel #4
0
    void Start()
    {
        this.unito_motion = this.transform.GetComponentInChildren<Animation>();		//motion.
        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();

        this.effect_control = GameObject.Find("GameRoot").gameObject.GetComponent<VanishEffectControl>();
        this.count_repair_eff = REPAIR_EFF_TIMING;
        this.count_repair_se = REPAIR_SE_TIMING;
        next_step = STEP.IDLE;

        // --------------------------------------------.
        // 가끔 머리에 꽃을!.
        int rnd = Random.Range(0, 9);
        if(rnd > 5){
            GameObject go = GameObject.Instantiate(this.hana_prefab) as GameObject;
            go.transform.parent = unitoAtama;
            go.transform.position = unitoAtama.position;
            go.transform.localScale = Vector3.one;
        }

        // --------------------------------------------.
        // 2014.06.16.
        // 서서히 완성판 구현도 막바지에 이르렀다.
        // 원고 수정도 끝나고 표지도 정해졌다.
        // 발매일이 가까워지면서 조금은 두근두근 거리는 시간을 보내는 중.
        // 이 책을 사주셔서 정말 기쁘고 뭔가 하나라도 얻는 게 있으면 좋겠다.
        // --------------------------------------------.
    }
Beispiel #5
0
    public static void SetSFXVolume()
    {
        SoundControl.SetSoundVolume(sfx? 1 : 0);
        string saveddata = JSONMaker.MakeSaveFile();

        PlayerPrefs.SetString("PlayerSavedData", saveddata);
    }
Beispiel #6
0
    // Progtive is the one at a time sequential cracker
    // Use this for initialization
    void Start()
    {
        Hardware        = GameObject.Find("Hardware");
        Prompts         = GameObject.Find("Prompts");
        SysSoftware     = GameObject.Find("System");
        HackingSoftware = GameObject.Find("Hacking");
        AppSoftware     = GameObject.Find("Applications");

        ep     = Prompts.GetComponent <ErrorProm>();
        com    = SysSoftware.GetComponent <Computer>();
        trace  = HackingSoftware.GetComponent <Tracer>();
        cmd    = SysSoftware.GetComponent <CLI>();
        defalt = SysSoftware.GetComponent <Defalt>();
        ib     = AppSoftware.GetComponent <InternetBrowser>();
        ws     = AppSoftware.GetComponent <WebSec>();
        cpu    = Hardware.GetComponent <CPU>();
        sc     = SysSoftware.GetComponent <SoundControl>();

        windowRect = new Rect(100, 100, 300, 200);

        CloseButton   = new Rect(windowRect.width - 23, 2, 21, 21);
        ExecuteButton = new Rect(45, 100, 60, 24);

        windowID = 99;
    }
Beispiel #7
0
 private void Start()
 {
     if (soundControl == null)
     {
         soundControl = FindObjectOfType <SoundControl>();
     }
 }
    void Awake()
    {
        if( instance != null && instance != this )
        {
            Destroy( this.gameObject );
            return;
        }
        else
        {
            instance = this;
        }

        DontDestroyOnLoad( this.gameObject );

        AudioSource[] aSources = GetComponents<AudioSource> ();

        sounds = aSources[0];
        loopingBGM = aSources[1];

        loopingBGM.loop = true;

        // Subscribe to events
        MenuButtonScript.onMouseOver += PlayOnHover;
        MenuButtonScript.onMouseClick += PlayOnClick;
        PlayerScript.OnPlayerShooting += PlayPlayerFire;
        Enemy1AI.OnEnemyFire += PlayEnemyFire;
        Enemy2AI.OnEnemyFire += PlayEnemyFire;
        Enemy3AI.OnEnemyFire += PlayEnemyFire;

        PlayMenuBGM ();
    }
Beispiel #9
0
    public void MainShowLeaderBoard()
    {
        this.gameObject.transform.Find("HomeMenu").gameObject.transform.Find("InternetMessage").gameObject.SetActive(false);
        //Show Leaderboard
        SoundControl.PlaySFX(GlobalData.SFX_Paths[0], false, true, true);
        GameObject.Find("MainMenu").transform.Find("LeaderBoardMenu").gameObject.SetActive(true);
        GameObject.Find("MainMenu").transform.Find("OptionsMenu").gameObject.SetActive(false);
        GameObject.Find("MainMenu").transform.Find("QuizMenu").gameObject.SetActive(false);
        GameObject.Find("MainMenu").transform.Find("HomeMenu").Find("btn_PlayButton").gameObject.SetActive(false);
        Transform mbb = GameObject.Find("MainMenu").transform.Find("HomeMenu").Find("MainBottomBar");

        for (int i = 0; i < 4; i++)
        {
            if (i == 0)
            {
                mbb.GetChild(i).GetComponent <Button>().image.color = btn_selected_color;
                Debug.Log(i);
            }
            else
            {
                mbb.GetChild(i).GetComponent <Image>().color = btn_unselected_color;
            }
        }
        GameObject.Find("MainMenu").transform.Find("PlayMenu").gameObject.SetActive(false);
        GameObject.Find("MainMenu").transform.Find("LevelsMenu").gameObject.SetActive(false);


        //	this.transform.FindChild("OptionsMenu").gameObject.transform.FindChild("OptionsLabel").GetComponent<Text>().text="Settings";
        GameObject.Find("MainMenu").transform.Find("OptionsMenu").gameObject.transform.Find("OptionsMainScreenObjects").gameObject.SetActive(true);
        GameObject.Find("MainMenu").transform.Find("OptionsMenu").gameObject.transform.Find("Credits").gameObject.SetActive(false);
    }
Beispiel #10
0
    private void Init()
    {
        //PlayerPrefs.DeleteAll();
        //JoaoResetData
        CSVReader.LoadLanguageCSV();
        //JoaoResetData
        if (!PlayerPrefs.GetString("PlayerSavedData").Equals(""))
        {
            //dbg += "from save";
            Debug.Log(PlayerPrefs.GetString("PlayerSavedData"));


            SaveLoadData.LoadPlayerData();
            if (GlobalData.SAVEDQUIZQUESTIONS.Count > 0)
            {
                //	dbg+="has loaded quiz questions from save";
                SaveLoadData.SavePlayerData();
            }
            else
            {
                //	dbg+="not loaded quiz questions from save";
                LoadQuiz(-1);
            }
        }
        else
        {
            //dbg += "loading_quiz\n";
            Debug.Log("loadquiz");
            LoadQuiz(-1);
        }
        SoundControl.PlayMusic(GlobalData.Music_Paths[0], true);
        this.transform.Find("OptionsMenu").GetComponent <OptionsMenu>().updateMusicSFXImages();
    }
Beispiel #11
0
 public void PlayLevelSFX()
 {
     SoundControl.PlaySFX(GlobalData.SFX_Paths[1], false, true, true);
     timerCount = timer - Time.deltaTime;
     print(timerCount);
     APIs.GetComponent <DeltaDNAManager>().DeltaDNA_PostEvent("time_spent", true);
 }
Beispiel #12
0
    public void HideResetGUI()
    {
        SoundControl.PlaySFX(GlobalData.SFX_Paths[0], false, true, true);

        this.gameObject.transform.Find("ResetGUI").gameObject.SetActive(false);
        this.gameObject.transform.Find("OptionsMainScreenObjects").gameObject.SetActive(true);
    }
Beispiel #13
0
    public void NextGame()
    {
        SoundControl.PlaySFX(GlobalData.SFX_Paths[0], false, true, true);

        Destroy_InGameObjects();
        Disable_All_InGame_GUIs();


        if (GlobalData.current_level < 10)
        {
            MainMenu.transform.Find("LevelsMenu").GetComponent <LevelsMenu>().StartLevel(GlobalData.current_level + 1);
        }
        else
        {
            end_anim_tr = GameObject.Find("Canvas").transform.Find("InGame").gameObject.transform.Find("EndAnim");
            end_anim_tr.gameObject.SetActive(true);

            GameObject.Find("InGame").gameObject.transform.Find("EndAnim").gameObject.transform.Find("Screen01").gameObject.transform.Find("Player").gameObject.GetComponent <Animator>().SetInteger("player", PlayerData.picked_playerid);
            doingendanim = true;
            end_anim_tr.GetComponent <Button>().onClick.RemoveAllListeners();
            end_anim_tr.GetComponent <Button>().onClick.AddListener(() => {
                end_anim_tr.gameObject.SetActive(false);
                doingendanim = false;
                GameObject.Find("Canvas").transform.Find("InGame").gameObject.transform.Find("EndAnim").gameObject.SetActive(false);
                //Win();
                MainMenu.transform.Find("LevelsMenu").GetComponent <LevelsMenu>().StartLevel(GlobalData.current_level + 1);

                //Todo if is last game.....
            });
            end_anim = end_anim_tr.GetComponent <Animator>();
        }
    }
    //Joao2409



    public void ShowLevelMenu(int difficulty)
    {
        if (PlayerData.playername == "" || InputNameBG.transform.Find("InputName").GetComponent <InputField>().text == "")
        {
            return;
        }

        SoundControl.PlaySFX(GlobalData.SFX_Paths[0], false, true, true);

        if (GlobalData.DifficultiesUnlocked[difficulty])
        {
            GlobalData.current_difficulty = difficulty;

            GameObject.Find("MainMenu").transform.Find("LevelsMenu").gameObject.transform.GetComponent <LevelsMenu>().Update_LockedLevels(difficulty);

            if (difficulty == 0)
            {
                GameObject.Find("MainMenu").transform.Find("LevelsMenu").Find("BG").GetComponent <Image>().sprite = Resources.Load <Sprite>("OptionsGUI/level_select_easy_bg");
            }
            else if (difficulty == 1)
            {
                GameObject.Find("MainMenu").transform.Find("LevelsMenu").Find("BG").GetComponent <Image>().sprite = Resources.Load <Sprite>("OptionsGUI/level_select_normal_bg");
            }
            else if (difficulty == 2)
            {
                GameObject.Find("MainMenu").transform.Find("LevelsMenu").Find("BG").GetComponent <Image>().sprite = Resources.Load <Sprite>("OptionsGUI/level_select_hard_bg");
            }



            GameObject.Find("MainMenu").transform.Find("LevelsMenu").gameObject.SetActive(true);
            this.gameObject.SetActive(false);
        }
    }
Beispiel #15
0
    // Use this for initialization
    void Start()
    {
        Prompt = GameObject.Find("Prompts");
        System = GameObject.Find("System");

        ComAddress   = "S:/Settings";
        windowRect.x = Customize.cust.windowx[windowID];
        windowRect.y = Customize.cust.windowy[windowID];

        ep     = Prompt.GetComponent <ErrorProm>();
        def    = System.GetComponent <Defalt>();
        com    = System.GetComponent <Computer>();
        os     = System.GetComponent <OS>();
        desk   = System.GetComponent <Desktop>();
        ct     = System.GetComponent <CustomTheme>();
        mouse  = System.GetComponent <Mouse>();
        appman = System.GetComponent <AppMan>();
        ss     = System.GetComponent <ScreenSaver>();
        sc     = System.GetComponent <SoundControl>();

        TempName = "";
        TempPass = "";
        UpdateRezList();
        AddTime();
        SetPos();

        Scale = Customize.cust.UIScale;

        windowRect.x = Screen.width - windowRect.width - 1;
        windowRect.y = 50;
    }
Beispiel #16
0
    void LateUpdate()
    {
        // Good breath - Well done text fade in and out
        if (goodBreath && !fadeIn && gameObject.GetComponent <CanvasGroup>().alpha == 0)
        {
            fadeIn      = true;
            playedSound = false;
        }
        else
        {
            if (!enteredDelay)
            {
                if (fadeIn)
                {
                    if (!playedSound)
                    {
                        SoundControl.playWellDoneSound();
                        playedSound = true;
                    }
                    gameObject.GetComponent <CanvasGroup>().alpha += 0.025f;
                }
                else
                {
                    gameObject.GetComponent <CanvasGroup>().alpha -= 0.025f;
                }

                if (gameObject.GetComponent <CanvasGroup>().alpha == 1)
                {
                    StartCoroutine(Delay(3));
                }
            }
        }
    }
Beispiel #17
0
    // Progtive is the one at a time sequential cracker
    // Use this for initialization
    void Start()
    {
        Hardware        = GameObject.Find("Hardware");
        Prompts         = GameObject.Find("Prompts");
        SysSoftware     = GameObject.Find("System");
        HackingSoftware = GameObject.Find("Hacking");
        AppSoftware     = GameObject.Find("Applications");

        ep            = Prompts.GetComponent <ErrorProm>();
        com           = SysSoftware.GetComponent <Computer>();
        trace         = HackingSoftware.GetComponent <Tracer>();
        cmd           = SysSoftware.GetComponent <CLICommands>();
        defalt        = SysSoftware.GetComponent <Defalt>();
        ib            = AppSoftware.GetComponent <InternetBrowser>();
        ws            = AppSoftware.GetComponent <WebSec>();
        cpu           = Hardware.GetComponent <CPU>();
        sc            = SysSoftware.GetComponent <SoundControl>();
        windowRect.x  = Customize.cust.windowx[windowID];
        windowRect.y  = Customize.cust.windowy[windowID];
        native_height = Customize.cust.native_height;
        native_width  = Customize.cust.native_width;

        DictionaryVersion = 1;


        windowRect.height = 130;
    }
Beispiel #18
0
    void Start()
    {
        this.unito_motion = this.transform.GetComponentInChildren<Animation>();		//motion.
        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();

        this.effect_control = GameObject.Find("GameRoot").gameObject.GetComponent<VanishEffectControl>();
        this.count_repair_eff = REPAIR_EFF_TIMING;
        this.count_repair_se = REPAIR_SE_TIMING;
        next_step = STEP.IDLE;

        // --------------------------------------------.
        // たまーに頭の上に花が咲く!.
        int rnd = Random.Range(0, 9);
        if(rnd > 5){
            GameObject go = GameObject.Instantiate(this.hana_prefab) as GameObject;
            go.transform.parent = unitoAtama;
            go.transform.position = unitoAtama.position;
            go.transform.localScale = Vector3.one;
        }

        // --------------------------------------------.
        // 2014.06.16.
        // そろそろ完成版の実装も終わりに近づいてきた.
        // 原稿の修正も終わり,カバーも決まり.
        // 発売日が近づいてくる中,ちょっとどきどきしながら時を過ごしています.
        // この本を買ってもらえた事は本当に嬉しく,何か1つでも得るものがあると幸いです.
        // --------------------------------------------.
    }
Beispiel #19
0
    void LateUpdate()
    {
        // Bad breath - Try again text fade in and out
        if (badBreathCloud && !fadeIn && gameObject.GetComponent <CanvasGroup>().alpha == 0)
        {
            fadeIn      = true;
            playedSound = false;
        }
        else
        {
            if (!enteredDelay)
            {
                if (fadeIn)
                {
                    if (!playedSound)
                    {
                        SoundControl.playTryAgainSound();
                        playedSound = true;
                    }
                    gameObject.GetComponent <CanvasGroup>().alpha += 0.025f;
                }
                else
                {
                    gameObject.GetComponent <CanvasGroup>().alpha -= 0.025f;
                }

                if (gameObject.GetComponent <CanvasGroup>().alpha == 1)
                {
                    StartCoroutine(Delay(3));
                }
            }
        }
    }
        private void PlayCryCommand()
        {
            PBESpecies species = ReadVarOrEnum <PBESpecies>();
            PBEForm    form    = ReadVarOrEnum <PBEForm>();

            SoundControl.PlayCry(species, form, onStopped: OnCryFinished);
        }
Beispiel #21
0
    void Start()
    {
        this.unito_motion  = this.transform.GetComponentInChildren <Animation>();               //motion.
        this.sound_control = GameObject.Find("SoundRoot").GetComponent <SoundControl>();

        this.effect_control   = GameObject.Find("GameRoot").gameObject.GetComponent <VanishEffectControl>();
        this.count_repair_eff = REPAIR_EFF_TIMING;
        this.count_repair_se  = REPAIR_SE_TIMING;
        next_step             = STEP.IDLE;



        // --------------------------------------------.
        // 가끔 머리에 꽃을!.
        int rnd = Random.Range(0, 9);

        if (rnd > 5)
        {
            GameObject go = GameObject.Instantiate(this.hana_prefab) as GameObject;
            go.transform.parent     = unitoAtama;
            go.transform.position   = unitoAtama.position;
            go.transform.localScale = Vector3.one;
        }


        // --------------------------------------------.
        // 2014.06.16.
        // 서서히 완성판 구현도 막바지에 이르렀다.
        // 원고 수정도 끝나고 표지도 정해졌다.
        // 발매일이 가까워지면서 조금은 두근두근 거리는 시간을 보내는 중.
        // 이 책을 사주셔서 정말 기쁘고 뭔가 하나라도 얻는 게 있으면 좋겠다.
        // --------------------------------------------.
    }
Beispiel #22
0
    public void UpdateLevel(HouseItem houseItem)
    {
        if (houseLevel == houseItem.IdLevel)
        {
            if (VerificaInventario(houseItem.Combination))
            {
                for (int i = 0; i < levels.Count; i++)
                {
                    if (houseLevel == i)
                    {
                        level0.SetActive(false);
                        levels[i].SetActive(true);
                        if (i > 0)
                        {
                            levels[i - 1].SetActive(false);
                        }

                        houseLevel++;
                        RemoveItems(houseItem.Combination);

                        if ("House(Clone)".Equals(housePanel.transform.Find("HousePanel").Find("HouseList").transform.GetChild(i).name))
                        {
                            Image img = housePanel.transform.Find("HousePanel").Find("HouseList").transform.GetChild(i).gameObject.transform.Find("Icon").gameObject.GetComponent <Image>();
                            img.color = Color.green;
                            questNpc.CompletTaskQuest(completQuest);

                            SoundControl.GetInstance().ExecuteEffect(TypeSound.Create);
                        }
                        break;
                    }
                }
            }
        }
    }
Beispiel #23
0
    // Use this for initialization
    void Start()
    {
        Hardware = GameObject.Find("Hardware");

        cpu    = Hardware.GetComponent <CPU>();
        ram    = Hardware.GetComponent <RAM>();
        psu    = Hardware.GetComponent <PSU>();
        com    = GetComponent <Computer>();
        sc     = GetComponent <SoundControl>();
        appman = GetComponent <AppMan>();

        CloseButton    = new Rect(441, 1, 21, 21);
        MiniButton     = new Rect(419, 1, 21, 21);
        SettingsButton = new Rect(397, 1, 21, 21);

        PosCheck();

        ContextwindowRect.width = 100;

        if (CompactMode == true)
        {
            minimize = true;
            Minimize();
            showSpecs = true;
        }
    }
Beispiel #24
0
    public void StartLevel(int level_n)
    {
        SoundControl.PlaySFX(GlobalData.SFX_Paths[1], false, true, true);

        Debug.Log(level_n);
        if (level_n <= 10)
        {
            GlobalData.current_level = level_n;
        }
        else
        {
            GlobalData.current_difficulty++;
            GlobalData.current_level = 1;
        }


        if (GlobalData.current_difficulty == 3)
        {
            GlobalData.current_difficulty = 2;
            GlobalData.current_level      = 10;
        }

        Debug.Log(PlayerData.lastunlockeddificulty + " difficulty compare " + GlobalData.current_difficulty);
        Debug.Log(PlayerData.lastunlockedlevel + " level compare " + GlobalData.current_level);
        if (PlayerData.lastunlockeddificulty < GlobalData.current_difficulty)
        {
            PlayerData.lastunlockeddificulty = GlobalData.current_difficulty;
            PlayerData.lastunlockedlevel     = GlobalData.current_level;
        }
        else if (PlayerData.lastunlockeddificulty == GlobalData.current_difficulty)
        {
            if (PlayerData.lastunlockedlevel < GlobalData.current_level)
            {
                PlayerData.lastunlockedlevel = GlobalData.current_level;
            }
        }
        if (GlobalData.current_level == 1 && GlobalData.current_difficulty == 0)
        {
            GlobalData.current_tutorial = -1;
        }
        else
        {
            GlobalData.current_tutorial = -2;
        }
        SaveLoadData.SavePlayerData();

        Debug.Log("PlayerData Unlocked level " + PlayerData.lastunlockedlevel);
        Debug.Log("level " + (GlobalData.current_level - 1) + " difficulty " + (GlobalData.current_difficulty));
        if (GlobalData.LevelsUnlocked[GlobalData.current_difficulty][GlobalData.current_level - 1])
        {
            GameObject quiz = (GameObject)Instantiate(Resources.Load("Prefabs/Quiz"));
            quiz.transform.parent = this.transform.parent;

            quiz.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, Screen.width);
            quiz.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, Screen.height);
            quiz.transform.position = new Vector3(Screen.width / 2, Screen.height / 2, 0);
            quiz.GetComponent <QuizControl>().LoadQuiz(3);
        }
    }
Beispiel #25
0
        public static void DoEnteredMapThings(Map map)
        {
#if DEBUG
            Console.WriteLine("Player is now on {0}", map.Name);
#endif
            SoundControl.SetOverworldBGM(map.MapDetails.Music);
            UpdateGiratinaForms();
        }
Beispiel #26
0
 // Use this for initialization
 void Start()
 {
     _player = GameObject.Find("Player").GetComponent <Player>();
     //       _scrollBackground = GameObject.Find("Background").GetComponent<ScrollBackground>();
     //   _uiManager = GameObject.Find("Canvas").GetComponent<UIManager>();
     //   _coin = GameObject.Find("Coin").GetComponent<Coin>();
     _soundControl = GameObject.Find("Sound").GetComponent <SoundControl>();
 }
 void Start()
 {
     rb        = GetComponent <Rigidbody>();
     startDrag = rb.drag;
     bodySurfaceLandControl = GetComponent <BodySurfaceLandControl>();
     anim         = GetComponent <PlayerAnimationControl>();
     soundControl = SoundControl.Instance;
 }
Beispiel #28
0
 public void ChangeText()
 {
     if (speakNpc)
     {
         gameObject.transform.GetChild(0).GetComponent <Text>().text = task.Info;
         SoundControl.GetInstance().ExecuteEffect(TypeSound.Create);
     }
 }
Beispiel #29
0
    public void Close_QuestionAnswer()
    {
        SoundControl.PlaySFX(GlobalData.SFX_Paths[0], false, true, true);

        this.transform.Find("btn_back").gameObject.SetActive(true);
        QuestionAnswerWindow.SetActive(false);
        QuestionContent.SetActive(true);
    }
Beispiel #30
0
 public void Stop()
 {
     v_before_stop = this.GetComponent <Rigidbody2D>().velocity;
     this.GetComponent <Rigidbody2D>().velocity = Vector2.zero;
     Debug.Log("Stopping " + status.type);
     SoundControl.StopSound(GlobalData.SFX_Paths[status.type == 0 ? 3 : 5]);
     //TODO stop behaviour cycle too
 }
Beispiel #31
0
    public void InitLevel()
    {
        tutorialenemy = false;

        string dif = "";

        if (GlobalData.current_difficulty == 0)
        {
            dif = "Fácil";
        }
        else if (GlobalData.current_difficulty == 1)
        {
            dif = "Médio";
        }
        else
        {
            dif = "Difícil";
        }

        //var lvlDifi = GameObject.Find ("InGame").transform.Find ("TD").transform.Find ("LevelText").gameObject.GetComponent<Text> ().text;

        GameObject.Find("InGame").transform.Find("TD").transform.Find("LevelText").gameObject.GetComponent <Text>().text = string.Format("Nível {0} - {1} ", GlobalData.current_level, dif);

        //lvlDifi = string.Format("Nível {0}  -    Dificuldade {1} ",GlobalData.current_level,dif);

        //GameObject.Find("InGame").transform.Find("TD").transform.Find("LevelText").gameObject.GetComponent<Text>().text="Nível "+GlobalData.current_level;


        Time.timeScale = 1;


        GlobalData.LoadLevelMaps(GlobalData.current_difficulty, GlobalData.current_level);
        LoadMap();
        CSVLoadEnemyWaves();
        EnemyWaves();
        Camera.main.GetComponent <CameraControl>().Init(GlobalData.map.GetLength(0),
                                                        GlobalData.difficulty_ymap_size[GlobalData.current_difficulty],
                                                        main_tower_pos);
        PlayerData.level_state = 0;
        UI_InGame = GameObject.Find("Canvas").transform.Find("InGame").gameObject;
        UI_InGame.transform.Find("TD").gameObject.SetActive(true);
        UI_InGame.transform.Find("TD").Find("energy_bar").GetComponent <TDEnergyBar>().Init();

        UI_Tutorial = UI_InGame.transform.Find("Tutorial").gameObject;
        UI_Tutorial.transform.Find("TutorialObjects").transform.Find("Baloon").gameObject.SetActive(true);
        UI_Tutorial.transform.Find("Arrows").GetChild(0).gameObject.SetActive(true);
        UI_Tutorial.SetActive(false);
        ingame_tutorial_refs.Clear();
        GlobalData.tutorial_state      = 0;
        GlobalData.enemyatacktower_tut = false;
        baloontutstatestate            = -1;

        StartCoroutine(ActionAfterTimer.Set(7, delegate {
            Debug.Log("changing");
            SoundControl.PlayMusic(GlobalData.Music_Paths[2], true);
            can_start_enemy_waves = true;
        }));
    }
Beispiel #32
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "Coin")
     {
         Destroy(collision.gameObject);
         SoundControl.playCoinSound();
         CoinControl.currentCoinCount += 1;
     }
 }
Beispiel #33
0
    // ================================================================ //
    // MonoBehaviour에서 상속.
    void Start()
    {
        this.player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerControl>();

        this.score_control = this.gameObject.GetComponent<ScoreControl>();
        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();

        this.next_step = STEP.PLAY;
    }
Beispiel #34
0
    public void RestartGame()
    {
        SoundControl.PlaySFX(GlobalData.SFX_Paths[0], false, true, true);

        Destroy_InGameObjects();
        Disable_All_InGame_GUIs();
        PlayerData.current_score = 0;
        MainMenu.transform.Find("LevelsMenu").GetComponent <LevelsMenu>().StartLevel(GlobalData.current_level);
    }
Beispiel #35
0
	public static SoundControl getInstance()
	{
		if (!Instance)
		{
			GameObject container;
			container = new GameObject();
			container.name = "SoundControl";
			Instance = container.AddComponent(typeof(SoundControl)) as SoundControl;
		}
		return Instance;
	}
Beispiel #36
0
    // ================================================================ //
    // MonoBehaviour からの継承.
    void Start()
    {
        this.score.score = 100;
        this.score.coins = 0;

        this.score_disp = GameObject.FindGameObjectWithTag("Score Disp").GetComponent<ScoreDisp>();
        this.high_score = GlobalParam.getInstance().getHighScore();

        this.score.coins = this.high_score.coins;

        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();
    }
Beispiel #37
0
	// Use this for initialization
	void Start () {
		gameControl 		 = GameObject.Find("GameControl").GetComponent("GameControl") as GameControl;
		sound				 = GameObject.Find("Sound").GetComponent("SoundControl") as SoundControl;
		anime				 = gameObject.GetComponent<AnimeCharacter>();
		_collider			 = (BoxCollider2D)GetComponent(typeof(BoxCollider2D));
		sizeCollider		 = _collider.size;
		_smoke.emit			 = false;

		jumpMission = PlayerPrefs.GetInt("LV_Mission_Jump");
		dashMission = PlayerPrefs.GetInt("LV_Mission_Dash");
		if(jumpMission < 1)
			jumpNum = PlayerPrefs.GetInt("Jump_Count");
		if(dashMission < 1)
			dashNum = PlayerPrefs.GetInt("Dash_Count");
	}
    void OnMouseDown()
    {
        Debug.Log ("Mouse Detected");

        if (sound == null)
        {
            sound = Camera.main.GetComponent<SoundControl>();
        }
        Debug.Log ("Mouse Detected");
        switch(type) {
        case ButtonTypes.Play: sound.Play(); break;
        case ButtonTypes.Pause: sound.Pause(); break;
        case ButtonTypes.Stop:
            Debug.Log("Stop Detected");
            sound.Stop();
            break;
        case ButtonTypes.Mute: sound.ToggleMute(); break;
        }
    }
 //End of Region
 //Region Unity methods
 void start()
 {
     sound = Camera.main.GetComponent<SoundControl>();
 }
Beispiel #40
0
    void Awake()
    {
        instance = this;

        source = GetComponent<AudioSource>();
    }
Beispiel #41
0
    // ================================================================ //
    // MonoBehaviour からの継承.
    void Start()
    {
        this.kuchi_paku_datas = new List<KuchiPakuData>();

        this.loadKuchiPakuData(this.kuchi_paku_text);

        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();
        this.main_camera   = GameObject.Find("Main Camera").GetComponent<CameraControl>();
        this.player        = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerControl>();

        this.clouds = new List<Cloud>();

        for(int i = 0;i < 4;i++) {

            GameObject		go;

            if(i%2 == 0) {

                go = GameObject.Instantiate(this.kumo01Prefab) as GameObject;

            } else {

                go = GameObject.Instantiate(this.kumo02Prefab) as GameObject;
            }

            Cloud			cloud = new Cloud();

            this.clouds.Add(cloud);

            cloud.cloud = go;

            // 多重スクロールっぽくみせるために、奥に行くほどスピードを遅くする.
            cloud.speed = 0.5f*Mathf.Pow(0.7f, i);

            cloud.cloud.transform.parent        = this.main_camera.transform;
            cloud.cloud.transform.localPosition = new Vector3(CLIP_RANGE*(i*1.0f + 0.0f), 1.0f + i*2.0f, DEPTH + i*1.0f);

            float		s = Mathf.Lerp(1.0f, 0.5f, i/(3.0f - 1.0f));

            Vector3		scale = cloud.cloud.transform.localScale;

            scale.x *= s;
            scale.y *= s;

            cloud.cloud.transform.localScale = scale;
        }
    }
 void Awake()
 {
     soundControlInstance = GetComponent<SoundControl>();
 }
Beispiel #43
0
    // ================================================================ //
    // MonoBehaviour에서의 상속.
    void Start()
    {
        this.score_disp = GameObject.FindGameObjectWithTag("Score Disp").GetComponent<ScoreDisp>();
        this.high_score = GlobalParam.getInstance().getHighScore();
        this.last_socre = GlobalParam.getInstance().getLastScore();
        this.next_step = STEP.RESULT;

        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();
    }
Beispiel #44
0
    // ================================================================ //
    // MonoBehaviour에서 상속.
    void Start()
    {
        this.next_step = STEP.LOAD_SAVE_DATA;

        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();
    }
Beispiel #45
0
    // ================================================================ //
    // MonoBehaviour에서 상속.
    void Awake()
    {
        this.main_camera   = GameObject.FindGameObjectWithTag("MainCamera");
        this.score_counter = this.gameObject.GetComponent<ScoreCounter>();

        this.arrow = GameObject.Instantiate(this.arrowPrefab) as GameObject;

        this.hideArrow();

        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();

        this.effect_control = this.gameObject.GetComponent<VanishEffectControl>();
        this.leave_block_root = this.gameObject.GetComponent<LeaveBlockRoot>();
    }
Beispiel #46
0
    void Start()
    {
        this.step      = STEP.NONE;
        this.next_step = STEP.MOVE;
        this.item_root    = GameObject.Find("GameRoot").GetComponent<ItemRoot>();

        this.event_root   = GameObject.Find("GameRoot").GetComponent<EventRoot>();
        this.rocket_model = GameObject.Find("rocket").transform.FindChild("rocket_model").gameObject;

        this.game_status  = GameObject.Find("GameRoot").GetComponent<GameStatus>();		// status
        this.animation = this.transform.GetComponentInChildren<Animation>();		//motion
        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();	// sound.

        this.effect_control = GameObject.Find("GameRoot").GetComponent<VanishEffectControl>();
    }
Beispiel #47
0
 // ================================================================ //
 // MonoBehaviour에서 상속.
 void Start()
 {
     this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();
 }
Beispiel #48
0
    // ================================================================ //
    // MonoBehaviour からの継承.
    void Start()
    {
        this.next_step = STEP.WAIT_CLICK;

        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();
    }
Beispiel #49
0
    void Start()
    {
        this.guistyle.fontSize = 32;
        this.animation = GameObject.Find("rocket").transform.FindChild("rocket_model").gameObject.GetComponentInChildren<Animation>();		//motion

        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();

        this.fire_object = GameObject.Find("Fire").gameObject;
    }
Beispiel #50
0
    // ================================================================ //
    // MonoBehaviour からの継承.
    void Start()
    {
        this.block_root = this.gameObject.GetComponent<BlockRoot>();
        this.block_root.create();
        this.block_root.initialSetUp();

        this.score_counter = this.gameObject.GetComponent<ScoreCounter>();

        this.next_step = STEP.PLAY;

        this.score_disp = GameObject.FindGameObjectWithTag("Score Disp").GetComponent<ScoreDisp>();

        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();

        this.rocket_motion = GameObject.Find("rocket_model").gameObject.GetComponentInChildren<Animation>();		//motion
    }
Beispiel #51
0
    // ================================================================ //
    // MonoBehaviour에서 상속.
    void Start()
    {
        this.next_step     = STEP.RUN;
        this.current_speed = SPEED_MIN;

        this.score_control = ScoreControl.getInstance();
        this.coin_creator  = CoinCreator.getInstance();

        this.anim_player = this.transform.GetComponentInChildren<Animation>();		//motion.

        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();
    }
Beispiel #52
0
    // ================================================================ //
    // MonoBehaviour からの継承.
    void Start()
    {
        this.last.ignite      = 0;
        this.last.block       = 0;
        this.last.score       = 0;
        this.last.total_socre = 0;
        this.last.islands     = 0;
        this.last.island_size = 0;

        this.best = this.last;

        this.score_disp = GameObject.FindGameObjectWithTag("Score Disp").GetComponent<ScoreDisp>();
        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();
        this.unito_control = GameObject.FindGameObjectWithTag("Player").GetComponent<unitoControl>();

        this.rocket_motion = GameObject.Find("rocket_model").gameObject.GetComponentInChildren<Animation>();		//motion
    }
Beispiel #53
0
    void Start()
    {
        this.game_status = this.gameObject.GetComponent<GameStatus>();
        this.player_control = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerControl>();
        this.item_root = this.gameObject.GetComponent<ItemRoot>();
        this.player_control.enabled	= false;
        this.item_root.enabled		= false;
        this.game_status.enabled	= false;

        this.score_disp = this.gameObject.GetComponent<ScoreDisp>();

        this.step = STEP.NONE;
        this.next_step = STEP.TITLE;

        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();	// sound.

        this.animation = GameObject.Find("rocket").transform.FindChild("rocket_model").gameObject.GetComponentInChildren<Animation>();		//motion
        this.guistyle.fontSize = 64;

        this.title_rect = new Rect(0, -Screen.height*0.2f, title_texture.width, title_texture.height);
        this.start_rect = new Rect(Screen.width/2-start_texture.width/2, Screen.height*0.8f -start_texture.height/2,start_texture.width,start_texture.height);
        this.result_rect = new Rect(Screen.width/2-result_texture.width/2, Screen.height/2 -result_texture.height/2, result_texture.width, result_texture.height);
        this.next_rect = new Rect(Screen.width/2-next_texture.width/2, Screen.height*0.9f -next_texture.height/2,next_texture.width,next_texture.height);
    }