Пример #1
0
    public void nextLeveLButtonClicked()
    {
        //    if (Application.internetReachability != NetworkReachability.NotReachable)
        //    {
        //       if (showPhotoAd == 1)
        //        {
        //            showPhotoAd = 5;
        //            InterstitialAdScene sm2 = GameObject.FindObjectOfType(typeof(InterstitialAdScene)) as InterstitialAdScene;
        //            sm2.ShowInterstitial();
        //        }

        //    }
        soundManager sm = GameObject.FindObjectOfType(typeof(soundManager)) as soundManager;

        sm.tapSound();
        player.powerup      = false;
        frameManager.newLvl = true;
        colorManager.newClr = true;
        gameStart           = false;
        checkForHighScore();
        int level = PlayerPrefs.GetInt("gameLevel");


        level += 1;

        //Social.ReportScore((long)level, "CgkIzLHrtZAOEAIQAA", (bool success) => { });
        PlayerPrefs.SetInt("gameLevel", level);
        SceneManager.LoadScene("SampleScene");
    }
Пример #2
0
 void Awake()
 {
     if (soundManager.instance == null)
     {
         soundManager.instance = this;
     }
 }
Пример #3
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Пример #4
0
    private void Start()
    {
        gameManagerScript  = GetComponent <gameManager>();
        soundManagerScript = GetComponent <soundManager>();

        if (PlayerPrefs.GetInt("gameLoop") == 0)
        {
            whereIam = "startMenu";
        }
        else
        {
            whereIam = "InGame";
        }

        if (isSoundMuted == true)
        {
            AudioListener AL = mainCamera.GetComponent <AudioListener>();
            AL.enabled = false;
            audioButtons[1].SetActive(true);
            audioButtons[0].SetActive(false);
        }
        else
        {
            AudioListener AL = mainCamera.GetComponent <AudioListener>();
            AL.enabled = true;
            audioButtons[0].SetActive(true);
            audioButtons[1].SetActive(false);
        }
    }
Пример #5
0
 public static soundManager instance;   //자기자신을 변수로 담습니다.
 void Awake()                           //Start보다도 먼저, 객체가 생성될때 호출됩니다
 {
     if (soundManager.instance == null) //incetance가 비어있는지 검사합니다.
     {
         soundManager.instance = this;  //자기자신을 담습니다.
     }
 }
Пример #6
0
 public virtual void Start()
 {
     currentHp = startHp;
     anim      = GetComponent <Animator>();
     sren      = GetComponent <SpriteRenderer>();
     soundM    = FindObjectOfType <soundManager>();
 }
Пример #7
0
 void Start()
 {
     //maybe initialise the current trig there with a sphere cast
     m_soundMng = GameObject.Find("GameManager").GetComponent<soundManager>();
     m_playerOrientation = GameObject.Find("CenterEyeAnchor").transform;
     m_visor = GameObject.Find("Visor").transform;
     m_playerRigidbody = GetComponent<Rigidbody>();
 }
Пример #8
0
    // Use this for initialization
    void Awake()
    {
        if (SOUND_MAN == null)
            SOUND_MAN = this;

        else if (SOUND_MAN != this)
            Destroy(gameObject);
    }
    // Update is called once per frame
    void Update()
    {
        if (powerActivated == false)
        {
            if (manager.screenPressed)
            {
                powerUPValue      += Time.deltaTime / 7;
                powerUp.fillAmount = powerUPValue;
                if (powerUPValue >= 0.5)
                {
                    powerUp.color  = Color.green;
                    powerActivated = true;
                    player.powerup = true;
                    // manager m = GameObject.FindObjectOfType(typeof(manager)) as manager;
                    //m.playerFullHealth();
                    soundManager sm = GameObject.FindObjectOfType(typeof(soundManager)) as soundManager;
                    sm.powerUpFn();
                    CameraShaker.Instance.ShakeOnce(1f, 2f, 1f, .1f);
                    // CameraShaker.Instance.ShakeOnce()
                }
            }
            else
            {
                if (powerUPValue > 0)
                {
                    powerUPValue      -= Time.deltaTime / 7;
                    powerUp.fillAmount = powerUPValue;
                }
            }
        }
        else
        {
            if (powerUPValue > 0)
            {
                powerUPValue      -= Time.deltaTime / 12;
                powerUp.fillAmount = powerUPValue;
                if (powerUPValue <= 0.2)
                {
                    alert.SetActive(true);
                }
                if (powerUPValue <= 0)
                {
                    Time.timeScale = 1f;
                    alert.SetActive(false);
                    powerUp.color  = Color.white;
                    powerActivated = false;

                    player.powerup             = false;
                    player.powerActivatedCheck = false;
                    lazer l = GameObject.FindObjectOfType(typeof(lazer)) as lazer;
                    if (l != null)
                    {
                        l.destroyME();
                    }
                }
            }
        }
    }
Пример #10
0
 void Awake()
 {
     for (int i = 0; i < numberOfSources; i++)
     {
         audioSrcs.Add(gameObject.AddComponent <AudioSource>());
     }
     instance = this;
     changeVolume(.5f);
 }
Пример #11
0
 public void Awake()
 {
     if (soundsSingleton == null)
     {
         soundsSingleton = this;
         return;
     }
     Destroy(this);
 }
Пример #12
0
 // Use this for initialization
 void Start()
 {
     theRigidBody = GetComponent <Rigidbody2D>();
     sr           = GetComponent <SpriteRenderer>();
     lsr          = legsSprite.GetComponent <SpriteRenderer>();
     pAim         = GameObject.FindObjectOfType(typeof(playerAim)) as playerAim;
     smScript     = SoundManager.GetComponent <soundManager>();
     pShoot       = GameObject.FindObjectOfType(typeof(playerShoot)) as playerShoot;
 }
Пример #13
0
    void Start()
    {
        //score management
        scorer      = GameObject.Find("ScoreManager");
        scoreScript = scorer.GetComponent <scoreCounter>();

        //sound management
        soundManager = GameObject.Find("Sound Manager");
        soundScript  = soundManager.GetComponent <soundManager>();
    }
Пример #14
0
    private void Awake()
    {
        if (Instance != null)
        {
            Destroy(gameObject);
            return;
        }

        Instance = this;
        DontDestroyOnLoad(gameObject);
    }
Пример #15
0
 // Use this for initialization
 void Start()
 {
     theRigidBody          = GetComponent <Rigidbody2D>();
     pAim                  = GameObject.FindObjectOfType(typeof(playerAim)) as playerAim;
     animationController   = ShotRenderer.GetComponent <Animator>();
     hitbox                = ShotRenderer.GetComponent <PolygonCollider2D>();
     scoreText             = GameObject.Find("scorep" + playerNumber).GetComponent <Text>();
     smScript              = SoundManager.GetComponent <soundManager>();
     pMove                 = this.gameObject.GetComponent <playerMove>();
     victoryCanvas.enabled = true;
 }
Пример #16
0
 void Awake()
 {
     if (soundManager.instance == null)
     {
         soundManager.instance = this;
     }
     else if (soundManager.instance != this)
     {
         Destroy(gameObject);
     }
 }
Пример #17
0
 // Use this for initialization
 void Awake()
 {
     if (instance = null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Пример #18
0
 void MakeSingleton()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
Пример #19
0
    public void levelUpMethod()
    {
        level     += 1;
        requiredXP = ((level * 250) * ((float)level / 10)) + 600;

        lvlUpText.SetActive(false);
        lvlUpText.SetActive(true);

        soundManager soundManagerScript = GetComponent <soundManager>();

        soundManagerScript.lvlUpSound();
    }
Пример #20
0
 public void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
Пример #21
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         DestroyImmediate(this);
     }
 }
Пример #22
0
 // Use this for initialization
 void Awake()
 {
     if (soundBoy == null)
     {
         // DontDestroyOnLoad(gameObject);
         soundBoy = this;
     }
     else if (soundBoy != this)
     {
         Destroy(gameObject);
     }
 }
Пример #23
0
    // Use this for initialization
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(this);
        }

        soundEffects = GetComponent <AudioSource> ();
    }
 private void Awake()
 {
     if (insatnce == null)
     {
         insatnce = this;
     }
     else
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
     enableMusic();
 }
Пример #25
0
    private float intervalShootingBomb;      // counter to decrement shootingBombInterval


    // Use this for initialization
    void Awake()
    {
        sound                = FindObjectOfType <soundManager>();  // initialise the soundManager that play only sounds without input ( hit , collect, etc )
        audio                = GetComponent <AudioSource>();       // initialise the audioSourceComponent
        rb2d                 = GetComponent <Rigidbody2D>();       // initialise the variable rb2d
        intervalShooting     = shootingInterval;                   // initialise the private variable
        intervalShootingBomb = shootingBombInterval;               // initialise the private variable
        hull                 = maxHull;                            // initialise the max life of the ship
        shield               = 1;                                  // initialise the max shield value
        accelerationSpeed    = movementSpeed * accelerationFactor; // initialise the acceleration speed by timing the movement speed by accelerationFactor
        normalSpeed          = movementSpeed;                      // initialise the normal speed on the movement speed
        boostFuel            = maxBosstFuel;                       // initialise the boostfuel on the maximum fuel value
        nbrBomb              = nbrBombMax;                         // initialise the number of bombs on the maximum bomb value
    }
Пример #26
0
    public void startGameButton()
    {
        soundManager soundManagerScript = GetComponent <soundManager>();

        if (IsGameStarted == false)
        {
            if (PlayerPrefs.GetInt("gameLoop") == 0)
            {
                soundManagerScript.playClickSound();
            }
            PlayerPrefs.SetInt("gameLoop", 1);
            startGame();
            IsGameStarted = true;
        }
    }
Пример #27
0
 void Awake()
 {
     if (soundInstance == null)
     {
         //if not, set instance to this
         soundInstance = this;
         //If instance already exists and it's not this:
     }
     else if (soundInstance != this)
     {
         //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
         Destroy(gameObject);
     }
     //Sets this to not be destroyed when reloading scene
     DontDestroyOnLoad(gameObject);
 }
Пример #28
0
 // Use this for initialization
 void Awake()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(transform.gameObject);
     }
     else
     {
         Instance          = this;
         sound_AudioSource = GameObject.Find("musicChannel").GetComponent <AudioSource>();
         voice_AudioSource = GameObject.Find("voiceChannel").GetComponent <AudioSource>();
         music_AudioSource = GameObject.Find("soundChannel").GetComponent <AudioSource>();
         onLoad();
         onEnableTextToSpeech();
     }
 }
Пример #29
0
 void Awake()
 {
     if (_instance == null)
     {
         //If I am the first instance, make me the Singleton
         _instance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         //If a Singleton already exists and you find
         //another reference in scene, destroy it!
         if (this != _instance)
         {
             Destroy(this.gameObject);
         }
     }
 }
Пример #30
0
 public void pointerDown()
 {
     screenPressed = true;
     if (gameStart == false)
     {
         TapToPlay.SetActive(false);
         gameStart = true;
         an.Play("PROmeterHolder");
         an2.Play("planeBtnGo");
         an3.Play("PowerUpCome");
         soundManager sm = GameObject.FindObjectOfType(typeof(soundManager)) as soundManager;
         sm.tapSound();
         player.firstTime = false;
         lazerFollow sm2 = GameObject.FindObjectOfType(typeof(lazerFollow)) as lazerFollow;
         sm2.increaseSpeed();
         musicIcon.SetActive(false);
     }
 }
Пример #31
0
    // Use this for initialization



    void Start()
    {
        SM      = GameObject.Find("BoxSoundManager").GetComponent <soundManager>();
        restart = GameObject.Find("덤덤이").GetComponent <Restart>();
        HpBar   = GameObject.Find("HPBar").GetComponent <SimpleHealthBar> ();
        _Motor  = Player.GetComponent <PlatformerMotor2D>();
        BGMPlayer.GetComponent <AudioSource>().volume = 1;
        if (SceneManager.GetActiveScene().name == "ScriptLab")
        {
            //StartCoroutine(Death());
        }
        if (SceneManager.GetActiveScene().name == "Stage1")
        {
            Rain();
        }


        HpBar.UpdateBar(HP, 100);
    }
Пример #32
0
    public GameObject[] sounds;                 //array of sound effects

    // Sound manager singleton pattern
    void Awake()
    {
        //Check if instance already exists
        if (instance == null)
        {
            //if not, set instance to this
            instance = this;
        }

        //If instance already exists and it's not this:
        else if (instance != this)
        {
            //Then destroy this
            Destroy(gameObject);
        }

        //Sets this to not be destroyed when reloading scene
        DontDestroyOnLoad(gameObject);
    }
Пример #33
0
 // Use this for initialization
 void Awake()
 {
     if (Instance != null && Instance != this)
         Destroy(transform.gameObject);
     else
     {
         Instance = this;
         sound_AudioSource = GameObject.Find("musicChannel").GetComponent<AudioSource>();
         voice_AudioSource = GameObject.Find("voiceChannel").GetComponent<AudioSource>();
         music_AudioSource = GameObject.Find("soundChannel").GetComponent<AudioSource>();
         onLoad();
         onEnableTextToSpeech();
     }
 }
Пример #34
0
 void Update()
 {
     if (m_instance == null)
         m_instance = this;
 }
Пример #35
0
 void Start()
 {
     audioComponent = GetComponent<AudioSource>();
     m_instance = this;
 }
Пример #36
0
 //prefab
 void Awake()
 {
     //ensures that there is only one of soundManager
     if (instance == null) {
         instance = this;
     } else {
         Destroy (gameObject);
     }
 }
Пример #37
0
 void Start()
 {
     soundMng = GameObject.Find("GameManager").GetComponent<soundManager>();
 }