Example #1
0
    // Use this for initialization
    void Start()
    {
        //rigidBody = this.GetComponent<Rigidbody2D>();
        speed  = 0.5f;
        offset = 0.1f;
        GetTowers();

        soundManager = SoundLocator.GetSoundManager();
        //Debug.Log(towers.Count);
        transform.position = new Vector3(transform.position.x, transform.position.y + offset, transform.position.z);
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        soundManager = SoundLocator.GetSoundManager();

        ChangeCurrenTower(towerBase);
        towerBase = GameObject.Find("MainTower").GetComponent <TowerBase>();
        towerBase.TextActivator(towerBase.children);
        if (SceneManager.GetActiveScene().name == "_Tutorial")
        {
            tutorialManager = GameObject.Find("TutorialManager").GetComponent <TutorialManager>();
        }
    }
Example #3
0
    public void StartExplosion()
    {
        explosion.SetActive(true);
        SoundLocator.GetSoundManager().PlayMainExplosion();
        //soundManager.PlayMainExplosion();
        //SoundManager.Instance.PlayMainExplosion();
        GameObject tower = gameObject.transform.Find("TowerBase").gameObject;

        tower.SetActive(false);

        gameObject.GetComponent <PlayerInput>().enabled = false;

        StartCoroutine("LoadLevel");
    }
Example #4
0
    void Start()
    {
        activeSounds = new ArrayList();

        //Singleton initialization
        //s_Instance = this;

        //Service Locator
        SoundLocator.Provide(this);

        //List of all sounds
        _towerCrumble  = (AudioClip)Resources.Load("Sounds/TowerCrumble");
        _towerShoot    = (AudioClip)Resources.Load("Sounds/TowerShoot");
        _bombExplode   = (AudioClip)Resources.Load("Sounds/BombExplode");
        _sandTrack     = (AudioClip)Resources.Load("Sounds/SandTrack");
        _mainExplosion = (AudioClip)Resources.Load("Sounds/MainExplosion");
        _freeze        = (AudioClip)Resources.Load("Sounds/Freeze");



        freeze        = gameObject.AddComponent <AudioSource>();
        freeze.clip   = _freeze;
        freeze.volume = 0.25f;


        mainExplosion        = gameObject.AddComponent <AudioSource>();
        mainExplosion.clip   = _mainExplosion;
        mainExplosion.volume = 0.8f;


        bombExplode        = gameObject.AddComponent <AudioSource>();
        bombExplode.clip   = _bombExplode;
        bombExplode.volume = 0.2f;

        towerShoot      = gameObject.AddComponent <AudioSource>();
        towerShoot.clip = _towerShoot;

        towerShoot.volume = 0.5f;

        soundTrack        = gameObject.AddComponent <AudioSource>();
        soundTrack.clip   = _sandTrack;
        soundTrack.volume = 1f;
        soundTrack.loop   = true;

        PlayMusic();
    }
Example #5
0
    // Use this for initialization
    protected virtual void Start()
    {
        //GetComponent<SpriteRenderer>().color = Color.green;
        mainTower    = GameObject.Find("MainTower").GetComponent <TowerBase>();
        soundManager = SoundLocator.GetSoundManager();

        RandomizeActivationKeys();
        explosionRange = maxExplosionRange;

        animations = gameObject.GetComponentInChildren <Animation>();
        ashes      = animations.gameObject.transform.GetChild(1).gameObject;

        //animations = GameObject.Find("TowerV1").GetComponent<Animation>();

        if (!isActive)
        {
            animations.Play("Destroyed");
        }
        TextActivator(mainTower.children);
        BuildConnections();
    }
Example #6
0
        public BunnyHopGame()
        {
            config   = new Config();
            database = new InMemoryDatabase();
            ConfigLocator.Provide(config);
            ContentLocator.Provide(Content);
            InMemoryDatabaseLocator.Provide(database);

            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth  = ConfigLocator.Config.VirtualWidth * ConfigLocator.Config.Scale;
            graphics.PreferredBackBufferHeight = ConfigLocator.Config.VirtualHeight * ConfigLocator.Config.Scale;
            graphics.PreferMultiSampling       = false;
            graphics.ApplyChanges();
            GraphicsLocator.Provide(graphics);

            var viewportAdapter = new BoxingViewportAdapter(Window,
                                                            GraphicsDevice,
                                                            ConfigLocator.Config.VirtualWidth,
                                                            ConfigLocator.Config.VirtualHeight);

            camera = new Camera2D(viewportAdapter);
            CameraLocator.Provide(camera);

            soundEffects = new List <SoundEffect>();
            SoundLocator.Provide(soundEffects);

            Content.RootDirectory = "Content";
            stateStack            = new Stack <State>();
            stateStack.Push(new SplashState());

            //https://docs.microsoft.com/pt-br/dotnet/api/system.globalization.cultureinfo.currentculture?view=netcore-3.1
            //CultureInfo culture = new CultureInfo("ko-KR", false); // us-EN ko-KR ja-JP
            //Thread.CurrentThread.CurrentCulture = culture;
            //Thread.CurrentThread.CurrentUICulture = culture;
            //Resources.Culture = CultureInfo.CurrentCulture;
            //Debug.Print(CultureInfo.CurrentCulture.Name);
            //Debug.Print(CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
            //Debug.Print(Resources.Culture.Name);
        }
 public void Activation(TowerBase tower)
 {
     //SoundManager.Instance.PlayFreeze();
     SoundLocator.GetSoundManager().PlayFreeze();
     tower.Explosion(explosion);
 }
Example #8
0
 private void Awake()
 {
     soundManager = SoundLocator.GetSoundManager();
 }