Inheritance: MonoBehaviour
	void Awake ()
	{
		audioManager = GameObject.Find ("AudioManager").GetComponent <AudioManager>();

		screenCrash = GameObject.Find ("ScreenCrash").transform;
		mainCamera = GameObject.Find ("Main Camera").transform;
	}
Example #2
0
    void Start()
    {
        navigator = Navigator.instance;
        sfx = AudioManager.instance;

        sfx.Play("Audio/Bgm/Music/Alone", 0.5f, 1f, true);
    }
Example #3
0
 void Start()
 {
     am = GameObject.FindGameObjectWithTag("AudioManager").GetComponent<AudioManager>();
     transform.Translate (-Vector3.up * 2);
     startPos = transform.position;
     playerTrans = GameObject.FindGameObjectWithTag("Player").transform;
 }
Example #4
0
    public virtual void Init(Grid grid, int x, int y, float scale = 1, Sprite asset = null)
    {
        sfx = AudioManager.instance;

        container = transform.Find("Sprites");
        outline = transform.Find("Sprites/Outline").GetComponent<SpriteRenderer>();
        img = transform.Find("Sprites/Sprite").GetComponent<SpriteRenderer>();
        shadow = transform.Find("Sprites/Shadow").GetComponent<SpriteRenderer>();
        shadow.gameObject.SetActive(false);

        label = transform.Find("Label").GetComponent<TextMesh>();
        label.GetComponent<Renderer>().sortingLayerName = "Ui";
        label.gameObject.SetActive(Debug.isDebugBuild);

        this.grid = grid;
        this.x = x;
        this.y = y;
        this.asset = asset;

        this.walkable = true;

        transform.localPosition = new Vector3(x, y, 0);

        SetAsset(asset);
        SetImages(scale, Vector3.zero, 0);
        SetSortingOrder(0);

        visible = false;
        explored = false;
    }
Example #5
0
    void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
            return;
        }

        instance = this;

        thisObj = gameObject;
        thisT = transform;

        DontDestroyOnLoad(thisObj);

        audioSourceList = new List<AudioSource>();
        for (int i = 0; i < 10; i++)
        {
            GameObject obj = new GameObject();
            obj.name = "AudioSource" + (i + 1);

            AudioSource src = obj.AddComponent<AudioSource>();
            src.playOnAwake = false;
            src.loop = false;

            obj.transform.parent = thisT;
            obj.transform.localPosition = Vector3.zero;

            audioSourceList.Add(src);
        }

        AudioListener.volume = sfxVolume;
    }
Example #6
0
    void FindScripts()
    {
        // Find Controller GameObject
        GameObject controller =  Camera.main.gameObject;

        // Attach scripts that are attached to controller object
        sc_CameraController = controller.GetComponent<CameraController>();
        sc_GameController   = controller.GetComponent<GameController>();
        sc_LevelManager     = controller.GetComponent<LevelManager>();
        sc_RowManager       = controller.GetComponent<RowManager>();

        // Find Scripts not attached to controller object
        sc_AudioManager     = GameObject.Find("audio_manager").GetComponent<AudioManager>();

        if (LevelName == "Intro") return;

        sc_FadeToScene      = GameObject.FindGameObjectWithTag("Fade").GetComponent<FadeToScene>();
        sc_HighScoreManager = GameObject.FindGameObjectWithTag("Scores").GetComponent<HighScoreManager>();

        if (CheckObjectExist("score_tracker"))
            sc_ScoreTracker     = GameObject.Find("score_tracker").GetComponent<ScoreTracker>();

        if (CheckObjectExist("glow_ball"))
            sc_BallController   = GameObject.Find("glow_ball").GetComponent<BallController>();

        if (CheckObjectExist("boundaries"))
            sc_BoundaryManager   = GameObject.Find("boundaries").GetComponent<BoundaryManager>();
    }
Example #7
0
    // Metodos Awake, Start, Update....

    // Use this for spawn this instance
    void Awake()
    {
        if (Instance == null)
            Instance = this;
        else
            Destroy(gameObject);
    }
Example #8
0
    void Awake()
    {
        var objects = FindObjectsOfType<AudioManager>();
        if (objects.Length > 1) { Destroy(gameObject); }
        else { DontDestroyOnLoad(gameObject); }

        Instance = FindObjectOfType<AudioManager>();
        if (Instance == null) {
          Debug.LogError("null instance");

          var manager = new GameObject();
          var setting = new GameObject().AddComponent<AudioSetting>();
          var audio = new GameObject();
          setting.transform.parent = manager.transform;
          audio.transform.parent = manager.transform;

          Instance = manager.AddComponent<AudioManager>();
        }

        bgm_ = null;
        se_ = new List<AudioSource>();
        bgm_clips_ = new List<AudioClip>();
        se_clips_ = new List<AudioSource>();

        Debug.Log("AudioManager.Awake() fin");
    }
Example #9
0
        public GameStateManager(GraphicsDeviceManager man,ContentManager cman,MineWorldClient gam)
        {
            Audiomanager = new AudioManager();
            Config = new ConfigFile("data/settings.ini");
            _inputhelper = new InputHelper();
            Game = gam;
            Conmanager = cman;
            Graphics = man;
            Device = Graphics.GraphicsDevice;
            SpriteBatch = new SpriteBatch(Device);
            _screens = new BaseState[]
                           {
                               new TitleState(this, GameState.TitleState),
                               new MainMenuState(this, GameState.MainMenuState),
                               new LoadingState(this, GameState.LoadingState),
                               new MainGameState(this, GameState.MainGameState),
                               new SettingsState(this, GameState.SettingsState),
                               _serverbrowsingstate = new ServerBrowsingState(this, GameState.ServerBrowsingState),
                               _errorstate = new ErrorState(this, GameState.ErrorState)
                           };
            //curScreen = titlestate;
            Pbag = new PropertyBag(gam,this);

            //Set initial state in the manager itself
            SwitchState(GameState.TitleState);
        }
	// Use this for initialization
	void Start ()
	{
		if (am == null) {
			am = GameObject.FindGameObjectWithTag ("AudioManager").GetComponent<AudioManager> ();
			Debug.Log ("Found AudioManager");
		}
	}
    void Awake() {

        if (instance != null) { Destroy(gameObject); }
        else {

            instance = this;
            DontDestroyOnLoad(gameObject);

            library = GetComponent<SoundLibrary>();

            musicSources = new AudioSource[2];
            for (int i = 0; i < 2; i++)
            {
                GameObject newMusicSource = new GameObject("Music source " + (i + 1));
                musicSources[i] = newMusicSource.AddComponent<AudioSource>();
                newMusicSource.transform.parent = transform;
                musicSources[i].loop = true;
            }
            GameObject newSfx2Dsource = new GameObject("2D sfx source");
            sfx2DSource = newSfx2Dsource.AddComponent<AudioSource>();
            newSfx2Dsource.transform.parent = transform;

            audioListener = FindObjectOfType<AudioListener>().transform;
            if (FindObjectOfType<Camera>() != null)
            {
                cameraT = FindObjectOfType<Camera>().transform;
            }

            masterVolumePercent = PlayerPrefs.GetFloat("master vol", 1);
            sfxVolumePercent = PlayerPrefs.GetFloat("sfx vol", 1);
            musicVolumePercent = PlayerPrefs.GetFloat("music vol", 1);
        }
    }
 void Awake()
 {
     if(instace == null)
     {
         instace = this;
     }
 }
Example #13
0
    public static AudioSource PlayClip(AudioClip clip, float volume = 1, float pitch = 1)
    {
        if (clip == null)
            return null;
        if (_instance == null)
            _instance = FindObjectOfType<AudioManager>();

        AudioSource audioSource = null;
        foreach (var source in _instance._soundClipPool)
        {
            if (!source.isPlaying)
            {
                audioSource = source;
                break;
            }
        }
        if (audioSource == null)
        {
            audioSource = _instance.gameObject.AddComponent<AudioSource>();
            _instance._soundClipPool.Add(audioSource);
        }

        audioSource.clip = clip;
        audioSource.volume = volume;
        audioSource.pitch = pitch;
        audioSource.loop = false;
        audioSource.enabled = true;

        audioSource.Play();

        return audioSource;
    }
Example #14
0
	protected void Awake()
	{
		currency = Dependency.Get<Currency>();
		audioManager = Dependency.Get<AudioManager>();

		storeUI.enabled = false;
	}
Example #15
0
	void Awake(){
		if (instance == null){
			instance = this;
			this.StartSafeCoroutine(LoopWind());
			this.StartSafeCoroutine(WaitThenPlayCrows());
		}
	}
Example #16
0
 void Awake()
 {
     sfx = AudioManager.instance;
     navigator = Navigator.instance;
     sfx.Play("Audio/Bgm/Scenes/GameOver", 0, 1f, true);
     sfx.Fade("Audio/Bgm/Scenes/GameOver", 0.25f, 0.5f);
 }
Example #17
0
 void Start()
 {
     _gameManager = GameManager.Instance;
     _objectManager = _gameManager.getObjectManager();
     _audioManager = _gameManager.getAudioManager();
     Random.seed = (int)System.DateTime.Now.Ticks;
 }
Example #18
0
    // Use this for initialization
    void Start()
    {
        manager = gameObject.GetComponent<AudioManager>();
        gameManager = GameObject.Find("TrainManager").GetComponent<TrainManager>();
        hand = gameObject.GetComponentInChildren<TutorialHand>();
        tutorialCow = GameObject.Find("TutorialCow");

        tutorialCow.SetActive(false);

        if(GameObject.Find("SelectedTrain") != null)
        {
            SelectedTrain selectedTrain = GameObject.Find("SelectedTrain").GetComponent<SelectedTrain>();

            if (selectedTrain.showTutorial)
            {
                //Debug.Log("SHOWING TUTORIAL");
                StartCoroutine("runTutorial");
            }
            else
            {
                //Debug.Log("NOT SHOWING TUTORIAL");
                gameManager.startTrain();
                Destroy(this.gameObject);
            }
        }
        else
        {
            //Debug.Log("NOT SHOWING TUTORIAL - selected train not found");
            gameManager.startTrain();
            Destroy(this.gameObject);
        }
    }
Example #19
0
    void Awake()
    {
        if (Instance == null) Instance = this;
        else
        {
            if (this != Instance)
                Destroy(this.gameObject);
        }

        pickup = RuntimeManager.CreateInstance("event:/Sounds/Players/Pickup_sound");
        drop = RuntimeManager.CreateInstance("event:/Sounds/Players/Drop_sound");


        diePlayers[0] = RuntimeManager.CreateInstance("event:/Sounds/Players/Player1_Die");
        diePlayers[1] = RuntimeManager.CreateInstance("event:/Sounds/Players/Player2_Die");
        diePlayers[2] = RuntimeManager.CreateInstance("event:/Sounds/Players/Player3_Die");
        diePlayers[3] = RuntimeManager.CreateInstance("event:/Sounds/Players/Player4_Die");

        
        pickupPlayers[0] = RuntimeManager.CreateInstance("event:/Sounds/Players/Player1_Pickup");
        pickupPlayers[1] = RuntimeManager.CreateInstance("event:/Sounds/Players/Player2_Pickup");
        pickupPlayers[2] = RuntimeManager.CreateInstance("event:/Sounds/Players/Player3_Pickup");
        pickupPlayers[3] = RuntimeManager.CreateInstance("event:/Sounds/Players/Player4_Pickup");

        playerready[0] = RuntimeManager.CreateInstance("event:/Sounds/Animals/Announcer/Player 1");
        playerready[1] = RuntimeManager.CreateInstance("event:/Sounds/Animals/Announcer/Player 2");
        playerready[2] = RuntimeManager.CreateInstance("event:/Sounds/Animals/Announcer/Player 3");
        playerready[3] = RuntimeManager.CreateInstance("event:/Sounds/Animals/Announcer/Player 4");


        //diePlayers[3].start();
    }
Example #20
0
	void Awake ()
	{
		// Setting up the references.
		anim = GetComponent<Animator>();
		proximity = GetComponent<Proximity> ();
		audioManager = GameObject.FindGameObjectWithTag ("Sound").GetComponent<AudioManager> ();
	}
 public static AudioManager GetInstance()
 {
     if (instance == null) {
         instance = new AudioManager();
     }
     return instance;
 }
Example #22
0
    // Use this for initialization
    void Awake()
    {
        instance = this;
        source = GetComponent<AudioSource>();

        DontDestroyOnLoad(gameObject);
    }
Example #23
0
	/// <summary>
	/// Initialize the singleton.
	/// </summary>
	void Awake()
	{
		if (use != null) {
			Destroy(use.gameObject);
		}
		use = this;
	}
Example #24
0
	private void Awake()
	{
		Audio = GetComponent<AudioManager>();
		GameStateIntro.Audio.playThemeIntro();

		DontDestroyOnLoad(this);
	}
Example #25
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SoundEffect"/> class.
        /// </summary>
        /// <param name="audioManager">The associated audio manager instance.</param>
        /// <param name="name">The name of the current instance.</param>
        /// <param name="waveFormat">The format of the current instance.</param>
        /// <param name="buffer">The buffer containing audio data.</param>
        /// <param name="decodedPacketsInfo">The information regaring decoded packets.</param>
        internal SoundEffect(AudioManager audioManager, string name, WaveFormat waveFormat, DataStream buffer, uint[] decodedPacketsInfo)
        {
            AudioManager = audioManager;
            Name = name;
            Format = waveFormat;
            AudioBuffer = new AudioBuffer
            {
                Stream = buffer,
                AudioBytes = (int)buffer.Length,
                Flags = BufferFlags.EndOfStream,
            };
            LoopedAudioBuffer = new AudioBuffer
            {
                Stream = buffer,
                AudioBytes = (int)buffer.Length,
                Flags = BufferFlags.EndOfStream,
                LoopCount = AudioBuffer.LoopInfinite,
            };

            DecodedPacketsInfo = decodedPacketsInfo;

            Duration = Format.SampleRate > 0 ? TimeSpan.FromMilliseconds(GetSamplesDuration() * 1000 / Format.SampleRate) : TimeSpan.Zero;

            children = new List<WeakReference>();
            VoicePool = AudioManager.InstancePool.GetVoicePool(Format);
        }
Example #26
0
 void Start()
 {
     audioManager = AudioManager.Instance;
     if (autoPlayMusic) {
         audioManager.PlayMenuMusic();
     }
 }
Example #27
0
        public override bool TagApplies(UnityEngine.GameObject gameObject, AudioManager.ListenerInfo info)
        {
            SettingsManager.Options ModOptions = gameObject.GetComponent<SettingsManager>().ModOptions;
            int finalHappiness = (int)Singleton<DistrictManager>.instance.m_districts.m_buffer[0].m_finalHappiness;

            return (finalHappiness < ModOptions.MoodDependentMusic_MoodThreshold);
        }
    // Use this for initialization
    void Start()
    {
        if(am == null) am = GameObject.Find("AudioManager").GetComponent<AudioManager>();
        if(lc == null) lc = GameObject.Find("LevelController").GetComponent<LevelController>();

        StartCoroutine(ResetStage());
    }
Example #29
0
    void Awake()
    {
        if(instance != null)
            Destroy(gameObject);

        instance = this;
    }
Example #30
0
 void Start()
 {
     audioManager = AudioManager.instance;
     if (audioManager == null)
     {
         Debug.LogError("FREAK OUT! No AudioManager found in the scene.");
     }
 }
Example #31
0
 protected override void ExecuteSpecialB()
 {
     AudioManager.PlayClipByName("Shot2");
     PolarityReverser.Spawn(transform.position + MathLib.FromPolar(Player.Radius + PolarityReverser.Radius, Player.TurretAngle).ToVector3(),
                            Player.TurretAngle, Player.shotSpeed);
 }
Example #32
0
        public BeatmapManager(Storage storage, IDatabaseContextFactory contextFactory, RulesetStore rulesets, IAPIProvider api, [NotNull] AudioManager audioManager, GameHost host = null,
                              WorkingBeatmap defaultBeatmap = null, bool performOnlineLookups = false)
            : base(storage, contextFactory, api, new BeatmapStore(contextFactory), host)
        {
            this.rulesets     = rulesets;
            this.audioManager = audioManager;

            DefaultBeatmap = defaultBeatmap;

            beatmaps = (BeatmapStore)ModelStore;
            beatmaps.BeatmapHidden   += b => beatmapHidden.Value = new WeakReference <BeatmapInfo>(b);
            beatmaps.BeatmapRestored += b => beatmapRestored.Value = new WeakReference <BeatmapInfo>(b);
            beatmaps.ItemRemoved     += removeWorkingCache;
            beatmaps.ItemUpdated     += removeWorkingCache;

            if (performOnlineLookups)
            {
                onlineLookupQueue = new BeatmapOnlineLookupQueue(api, storage);
            }

            textureStore = new LargeTextureStore(host?.CreateTextureLoaderStore(Files.Store));
            trackStore   = audioManager.GetTrackStore(Files.Store);
        }
Example #33
0
    void Start()
    {
        audioManager = GameObject.Find("AudioManager").GetComponent <AudioManager> ();

        //audioManager.StopAllSounds ();
    }
Example #34
0
    public void OnCloseHighscore()
    {
        AudioManager.PlaySfx(AudioEffects.UIButton);

        PnlHighscore.Shown = false;
    }
 // Use this for initialization
 void Start()
 {
     AudioManager.SetGameObjectTag("MainCamera");
 }
Example #36
0
    void Update()
    {
        if (Input.GetKeyDown(left) && playerSelected == false)
        {
            index++;
            AudioManager.PlayMusic("Woosh");
            //if (player2Selection.index == index && player2Selection.player2Selected == true)
            //{
            //	index++;
            //}
            upOrDown = "Up";
        }

        if (Input.GetKeyDown(right) && playerSelected == false)
        {
            index--;
            AudioManager.PlayMusic("Woosh");
            //if (player2Selection.index == index && player2Selection.player2Selected == true)
            //{
            //	index--;
            //}
            upOrDown = "Down";
        }

        if (player2Selection.index == index && player2Selection.player2Selected == true)
        {
            if (upOrDown == "Up")
            {
                index++;
            }
            else
            {
                index--;
            }
        }

        if (index < 0)
        {
            index = maxIndex;

            if (player2Selection.index == index && player2Selection.player2Selected == true)
            {
                if (upOrDown == "Up")
                {
                    index++;
                }
                else
                {
                    index--;
                }
            }
        }

        if (index > maxIndex)
        {
            index = 0;

            if (player2Selection.index == index && player2Selection.player2Selected == true)
            {
                if (upOrDown == "Up")
                {
                    index++;
                }
                else
                {
                    index--;
                }
            }
        }

        if (index == characterIndex)
        {
            EventSystem.current.SetSelectedGameObject(this.gameObject);

            buttonImage.SetActive(true);
        }

        else
        {
            buttonImage.SetActive(false);
        }

        if (Input.GetKeyDown(selectionKey) || Input.GetKeyDown(selectionKey2))
        {
            playerSelected = true;
            buttonImage.GetComponent <Image>().color = Selected;
            //if (player2Selection.index == index)
            //{
            //	player2Selection.index++;
            //}
        }

        if (index == 0 && playerSelected == true)
        {
            character1String = "Ikkx";
            CharacterSelector.player1Character = character1String;
        }

        else if (index == 1 && playerSelected == true)
        {
            character1String = "Angelov";
            CharacterSelector.player1Character = character1String;
        }

        else if (index == 2 && playerSelected == true)
        {
            character1String = "Pixel";
            CharacterSelector.player1Character = character1String;
        }

        else if (index == 3 && playerSelected == true)
        {
            character1String = "Ragnar";
            CharacterSelector.player1Character = character1String;
        }
    }
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AudioManager obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Example #38
0
            private void load(OsuColour colours, AudioManager audio)
            {
                colourNormal = colours.Yellow;
                colourHover  = colours.YellowDark;

                sampleConfirm = audio.Sample.Get(@"SongSelect/confirm-selection");

                Children = new Drawable[]
                {
                    background = new Box
                    {
                        Alpha            = 0.2f,
                        Colour           = Color4.Black,
                        RelativeSizeAxes = Axes.Both,
                    },
                    aspect = new AspectContainer
                    {
                        Anchor           = Anchor.Centre,
                        Origin           = Anchor.Centre,
                        RelativeSizeAxes = Axes.Y,
                        Height           = 0.6f,
                        Masking          = true,
                        CornerRadius     = 15,
                        Children         = new Drawable[]
                        {
                            box = new Box
                            {
                                RelativeSizeAxes = Axes.Both,
                                Colour           = colourNormal,
                            },
                            flow = new FillFlowContainer
                            {
                                Anchor = Anchor.TopCentre,
                                RelativePositionAxes = Axes.Y,
                                Y            = 0.4f,
                                AutoSizeAxes = Axes.Both,
                                Origin       = Anchor.Centre,
                                Direction    = FillDirection.Horizontal,
                                Children     = new[]
                                {
                                    new SpriteIcon {
                                        Size = new Vector2(15), Shadow = true, Icon = FontAwesome.fa_chevron_right
                                    },
                                    new SpriteIcon {
                                        Size = new Vector2(15), Shadow = true, Icon = FontAwesome.fa_chevron_right
                                    },
                                    new SpriteIcon {
                                        Size = new Vector2(15), Shadow = true, Icon = FontAwesome.fa_chevron_right
                                    },
                                }
                            },
                            new OsuSpriteText
                            {
                                Anchor = Anchor.TopCentre,
                                RelativePositionAxes = Axes.Y,
                                Y        = 0.7f,
                                TextSize = 12,
                                Font     = @"Exo2.0-Bold",
                                Origin   = Anchor.Centre,
                                Text     = @"SKIP",
                            },
                        }
                    }
                };
            }
Example #39
0
 private void Start()
 {
     audio = AudioManager.instance;
     view  = PhotonView.Get(this);
 }
Example #40
0
 private void load(GameHost host, AudioManager audio)
 {
     Dependencies.Cache(rulesets = new RealmRulesetStore(Realm));
     Dependencies.Cache(beatmaps = new BeatmapManager(LocalStorage, Realm, rulesets, null, audio, Resources, host, Beatmap.Default));
     Dependencies.Cache(Realm);
 }
 // Use this for initialization
 void Start()
 {
     audioManager = GetComponent <AudioManager>();
     audioManager.Play(soundName);
 }
 private void load(AudioManager audio, IBindable <WorkingBeatmap> beatmap)
 {
     track      = beatmap.Value.Track;
     failSample = audio.Samples.Get(@"Gameplay/failsound");
 }
Example #43
0
        private void load(AudioManager audio, OsuConfigManager config, OsuGame osu)
        {
            dimLevel           = config.GetBindable <double>(OsuSetting.DimLevel);
            mouseWheelDisabled = config.GetBindable <bool>(OsuSetting.MouseDisableWheel);

            sampleRestart = audio.Sample.Get(@"Gameplay/restart");

            Ruleset rulesetInstance;

            WorkingBeatmap working = Beatmap.Value;
            Beatmap        beatmap;

            try
            {
                beatmap = working.Beatmap;

                if (beatmap == null)
                {
                    throw new InvalidOperationException("Beatmap was not loaded");
                }

                ruleset         = osu?.Ruleset.Value ?? beatmap.BeatmapInfo.Ruleset;
                rulesetInstance = ruleset.CreateInstance();

                try
                {
                    RulesetContainer = rulesetInstance.CreateRulesetContainerWith(working, ruleset.ID == beatmap.BeatmapInfo.Ruleset.ID);
                }
                catch (BeatmapInvalidForRulesetException)
                {
                    // we may fail to create a RulesetContainer if the beatmap cannot be loaded with the user's preferred ruleset
                    // let's try again forcing the beatmap's ruleset.
                    ruleset          = beatmap.BeatmapInfo.Ruleset;
                    rulesetInstance  = ruleset.CreateInstance();
                    RulesetContainer = rulesetInstance.CreateRulesetContainerWith(Beatmap, true);
                }

                if (!RulesetContainer.Objects.Any())
                {
                    throw new InvalidOperationException("Beatmap contains no hit objects!");
                }
            }
            catch (Exception e)
            {
                Logger.Log($"Could not load this beatmap sucessfully ({e})!", LoggingTarget.Runtime, LogLevel.Error);

                //couldn't load, hard abort!
                Exit();
                return;
            }

            adjustableSourceClock = (IAdjustableClock)working.Track ?? new StopwatchClock();
            decoupledClock        = new DecoupleableInterpolatingFramedClock {
                IsCoupled = false
            };

            var firstObjectTime = RulesetContainer.Objects.First().StartTime;

            decoupledClock.Seek(Math.Min(0, firstObjectTime - Math.Max(beatmap.ControlPointInfo.TimingPointAt(firstObjectTime).BeatLength * 4, beatmap.BeatmapInfo.AudioLeadIn)));
            decoupledClock.ProcessFrame();

            offsetClock = new FramedOffsetClock(decoupledClock);

            userAudioOffset = config.GetBindable <double>(OsuSetting.AudioOffset);
            userAudioOffset.ValueChanged += v => offsetClock.Offset = v;
            userAudioOffset.TriggerChange();

            Schedule(() =>
            {
                adjustableSourceClock.Reset();

                foreach (var mod in working.Mods.Value.OfType <IApplicableToClock>())
                {
                    mod.ApplyToClock(adjustableSourceClock);
                }

                decoupledClock.ChangeSource(adjustableSourceClock);
            });

            Children = new Drawable[]
            {
                pauseContainer = new PauseContainer
                {
                    AudioClock    = decoupledClock,
                    FramedClock   = offsetClock,
                    OnRetry       = Restart,
                    OnQuit        = Exit,
                    CheckCanPause = () => ValidForResume && !HasFailed && !RulesetContainer.HasReplayLoaded,
                    Retries       = RestartCount,
                    OnPause       = () => {
                        hudOverlay.KeyCounter.IsCounting = pauseContainer.IsPaused;
                    },
                    OnResume = () => {
                        hudOverlay.KeyCounter.IsCounting = true;
                    },
                    Children = new Drawable[]
                    {
                        new SkipButton(firstObjectTime)
                        {
                            AudioClock = decoupledClock
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.Both,
                            Clock            = offsetClock,
                            Children         = new Drawable[]
                            {
                                RulesetContainer,
                            }
                        },
                        hudOverlay = new HUDOverlay
                        {
                            Anchor = Anchor.Centre,
                            Origin = Anchor.Centre
                        },
                    }
                },
                failOverlay = new FailOverlay
                {
                    OnRetry = Restart,
                    OnQuit  = Exit,
                },
                new HotkeyRetryOverlay
                {
                    Action = () => {
                        //we want to hide the hitrenderer immediately (looks better).
                        //we may be able to remove this once the mouse cursor trail is improved.
                        RulesetContainer?.Hide();
                        Restart();
                    },
                }
            };

            scoreProcessor = RulesetContainer.CreateScoreProcessor();

            hudOverlay.KeyCounter.AddRange(rulesetInstance.CreateGameplayKeys());
            hudOverlay.BindProcessor(scoreProcessor);
            hudOverlay.BindRulesetContainer(RulesetContainer);

            hudOverlay.Progress.Objects      = RulesetContainer.Objects;
            hudOverlay.Progress.AudioClock   = decoupledClock;
            hudOverlay.Progress.AllowSeeking = RulesetContainer.HasReplayLoaded;
            hudOverlay.Progress.OnSeek       = pos => decoupledClock.Seek(pos);

            hudOverlay.ModDisplay.Current.BindTo(working.Mods);

            //bind RulesetContainer to ScoreProcessor and ourselves (for a pass situation)
            RulesetContainer.OnAllJudged += onCompletion;

            //bind ScoreProcessor to ourselves (for a fail situation)
            scoreProcessor.Failed += onFail;
        }
 private void Start()
 {
     AudioManager.EnrollSFXSource(GetComponent <AudioSource>());
 }
Example #45
0
 protected override void ExecuteSpecialX()
 {
     AudioManager.PlayClipByName("Shot2");
     ExtraDamageMarker.Spawn(transform.position + MathLib.FromPolar(Player.Radius + ExtraDamageMarker.Radius, Player.TurretAngle).ToVector3(),
                             Player.TurretAngle, Player.shotSpeed, this);
 }
 private void Awake()
 {
     Instance = this;
 }
 private void Awake()
 {
     Instance      = this;
     m_AudioSource = GetComponent <AudioSource>();
 }
Example #48
0
        private void load(SessionStatics sessionStatics, AudioManager audio)
        {
            muteWarningShownOnce    = sessionStatics.GetBindable <bool>(Static.MutedAudioNotificationShownOnce);
            batteryWarningShownOnce = sessionStatics.GetBindable <bool>(Static.LowBatteryNotificationShownOnce);

            const float padding = 25;

            InternalChildren = new Drawable[]
            {
                (content = new LogoTrackingContainer
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    RelativeSizeAxes = Axes.Both,
                }).WithChildren(new Drawable[]
                {
                    MetadataInfo = new BeatmapMetadataDisplay(Beatmap.Value, Mods, content.LogoFacade)
                    {
                        Alpha  = 0,
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                    },
                    new OsuScrollContainer
                    {
                        Anchor           = Anchor.TopRight,
                        Origin           = Anchor.TopRight,
                        RelativeSizeAxes = Axes.Y,
                        Width            = SettingsToolboxGroup.CONTAINER_WIDTH + padding * 2,
                        Padding          = new MarginPadding {
                            Vertical = padding
                        },
                        Masking = false,
                        Child   = PlayerSettings = new FillFlowContainer <PlayerSettingsGroup>
                        {
                            AutoSizeAxes = Axes.Both,
                            Direction    = FillDirection.Vertical,
                            Spacing      = new Vector2(0, 20),
                            Padding      = new MarginPadding {
                                Horizontal = padding
                            },
                            Children = new PlayerSettingsGroup[]
                            {
                                VisualSettings = new VisualSettings(),
                                AudioSettings  = new AudioSettings(),
                                new InputSettings()
                            }
                        },
                    },
                    idleTracker = new IdleTracker(750),
                }),
                lowPassFilter  = new AudioFilter(audio.TrackMixer),
                highPassFilter = new AudioFilter(audio.TrackMixer, BQFType.HighPass)
            };

            if (Beatmap.Value.BeatmapInfo.EpilepsyWarning)
            {
                AddInternal(epilepsyWarning = new EpilepsyWarning
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                });
            }
        }
Example #49
0
 void Start()
 {
     sfx.isOn   = AudioManager.GetInstance().sfxEnable;
     music.isOn = AudioManager.GetInstance().musicEnable;
 }
 public void CloseUI()
 {
     AudioManager.PlayClipByID("clip_back");
     window.SetActive(false);
 }
Example #51
0
    public void OnSettingsCancel()
    {
        AudioManager.PlaySfx(AudioEffects.UIButton);

        PnlSettings.Shown = false;
    }
 private void Start()
 {
     AM  = GetComponent <AudioManager>();
     txt = GameObject.Find("Musics Names").GetComponent <TextMeshProUGUI>();
     CM  = FindObjectOfType <CombatManager>();
 }
 public TestWorkingBeatmap(BeatmapInfo skinBeatmapInfo, IResourceStore <byte[]> resourceStore, IBeatmap beatmap, Storyboard storyboard, IFrameBasedClock referenceClock, AudioManager audio,
                           double length = 60000)
     : base(beatmap, storyboard, referenceClock, audio, length)
 {
     this.skinBeatmapInfo = skinBeatmapInfo;
     this.resourceStore   = resourceStore;
 }
Example #54
0
 // Start is called before the first frame update
 void Start()
 {
     instance = this;
     audios   = GetComponent <AudioSource>();
 }
Example #55
0
 private void Start()
 {
     audioManager = FindObjectOfType <AudioManager>();
     gfm          = FindObjectOfType <GameFeelManager>();
 }
Example #56
0
 public override void OnPickupItem(InventorySlotBehaviour inventorySlotBehaviour)
 {
     _playerShootBehaviour.ProjectileScale += IncreaseValue;
     inventorySlotBehaviour.PlayAnimation("InventorySlotBounceLoop");
     AudioManager.Play(PickupItemAudioCip, AudioCategory.Effect);
 }
Example #57
0
    //public string spawnSoundName;

    // Use this for initialization
    void Start()
    {
        weaponModules     = new List <WeaponModule>();
        sr                = GetComponent <SpriteRenderer> ();
        inventory         = GameObject.Find("PlayerInventory").GetComponent <PlayerInventory> ();
        maxWeapons        = 2;
        maxAbilities      = 1;
        playerNormalSpeed = 4.0f;
        speed             = playerNormalSpeed;
        health            = 5f;
        lives             = 3f;
        shield            = 0f;
        Invoke("LateStart", 0.01f);
        invulnTimer               = 0;
        invulnDelay               = 1;
        canMove                   = true;
        canShoot                  = true;
        swinging                  = false;
        usingAbility              = false;
        abilityMeter              = 100.0f;
        abilityRechargeTimer      = 0.0f;
        abilityRechargeDelay      = 3.0f;
        abilityRechargeMultiplier = 1f;
        frenzied                  = false;
        screenWipe                = (GameObject)(Resources.Load("ScreenWipe"));
        speedModified             = false;
        playerDamageMultiplier    = 1.0f;
        playerSpeedMultiplier     = 1.0f;
        boundsX1                  = -6.6f;
        boundsY1                  = -4.4f;
        boundsX2                  = 6.6f;
        boundsY2                  = 4.4f;
        frozenCounter             = 0;
        frozen        = false;
        continuesUsed = 0;

        damageTimer = 30;

        timePlaying = 0;

        lastStand         = 1;
        compositeWeaponry = 1.0f;

        GameObject.Find("Sword").GetComponent <SpriteRenderer>().enabled = false;
        //GameObject.Find("Shadows").GetComponent<SpriteRenderer>().enabled = false;

        healPs         = GameObject.Find("HealEffect").GetComponent <ParticleSystem>();
        healEm         = healPs.emission;
        healEm.enabled = false;

        tpStartPs = GameObject.Find("ShadowsStart").GetComponent <ParticleSystem>();
        tpStartEm = tpStartPs.emission;
        //tpStartEm.enabled = false;

        tpEndPs = GameObject.Find("ShadowsEnd").GetComponent <ParticleSystem>();
        tpEndEm = tpEndPs.emission;
        //tpEndEm.enabled = false;

        regenPs         = GameObject.Find("RegeneratorEffect").GetComponent <ParticleSystem>();
        regenEm         = regenPs.emission;
        regenEm.enabled = false;

        //caching //copy me to any script that triggers a sound
        audioManager = AudioManager.instance;
        if (audioManager == null)
        {
            Debug.LogError("No audio manager found in scene, whoops");
        }

        if (!Global.bossMedley && !Global.tutorial)
        {
            timeText.enabled = false;
        }
    }
Example #58
0
        private void load(Storage storage, GameHost host, FrameworkConfigManager frameworkConfig, FontStore fonts, Game game, AudioManager audio)
        {
            interactive = host.Window != null;
            config      = new TestBrowserConfig(storage);

            exit = host.Exit;

            audio.AddAdjustment(AdjustableProperty.Frequency, audioRateAdjust);

            var resources = game.Resources;

            //Roboto
            game.AddFont(resources, @"Fonts/Roboto/Roboto-Regular");
            game.AddFont(resources, @"Fonts/Roboto/Roboto-Bold");

            //RobotoCondensed
            game.AddFont(resources, @"Fonts/RobotoCondensed/RobotoCondensed-Regular");
            game.AddFont(resources, @"Fonts/RobotoCondensed/RobotoCondensed-Bold");

            showLogOverlay = frameworkConfig.GetBindable <bool>(FrameworkSetting.ShowLogOverlay);

            var rateAdjustClock = new StopwatchClock(true);
            var framedClock     = new FramedClock(rateAdjustClock);

            Children = new Drawable[]
            {
                mainContainer = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding {
                        Left = test_list_width
                    },
                    Children = new Drawable[]
                    {
                        new SafeAreaContainer
                        {
                            SafeAreaOverrideEdges = Edges.Right | Edges.Bottom,
                            RelativeSizeAxes      = Axes.Both,
                            Child = testContentContainer = new Container
                            {
                                Clock            = framedClock,
                                RelativeSizeAxes = Axes.Both,
                                Padding          = new MarginPadding {
                                    Top = 50
                                },
                                Child = compilingNotice = new Container
                                {
                                    Alpha        = 0,
                                    Anchor       = Anchor.Centre,
                                    Origin       = Anchor.Centre,
                                    Masking      = true,
                                    Depth        = float.MinValue,
                                    CornerRadius = 5,
                                    AutoSizeAxes = Axes.Both,
                                    Children     = new Drawable[]
                                    {
                                        new Box
                                        {
                                            RelativeSizeAxes = Axes.Both,
                                            Colour           = Color4.Black,
                                        },
                                        new SpriteText
                                        {
                                            Font = new FontUsage(size: 30),
                                            Text = @"Compiling new version..."
                                        }
                                    },
                                }
                            }
                        },
                        toolbar = new TestBrowserToolbar
                        {
                            RelativeSizeAxes = Axes.X,
                            Height           = 50,
                        },
                    }
                },
                leftContainer = new Container
                {
                    RelativeSizeAxes = Axes.Y,
                    Size             = new Vector2(test_list_width, 1),
                    Masking          = true,
                    Children         = new Drawable[]
                    {
                        new SafeAreaContainer
                        {
                            SafeAreaOverrideEdges = Edges.Left | Edges.Top | Edges.Bottom,
                            RelativeSizeAxes      = Axes.Both,
                            Child = new Box
                            {
                                Colour           = FrameworkColour.GreenDark,
                                RelativeSizeAxes = Axes.Both
                            }
                        },
                        new FillFlowContainer
                        {
                            Direction        = FillDirection.Vertical,
                            RelativeSizeAxes = Axes.Both,
                            Children         = new Drawable[]
                            {
                                searchTextBox = new TestBrowserTextBox
                                {
                                    Height           = 25,
                                    RelativeSizeAxes = Axes.X,
                                    PlaceholderText  = "type to search",
                                    Depth            = -1,
                                },
                                new BasicScrollContainer
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Masking          = false,
                                    Child            = leftFlowContainer = new SearchContainer <TestGroupButton>
                                    {
                                        Padding = new MarginPadding {
                                            Top = 3, Bottom = 20
                                        },
                                        Direction        = FillDirection.Vertical,
                                        AutoSizeAxes     = Axes.Y,
                                        RelativeSizeAxes = Axes.X,
                                    }
                                }
                            }
                        }
                    }
                },
            };

            searchTextBox.OnCommit += delegate
            {
                var firstTest = leftFlowContainer.Where(b => b.IsPresent).SelectMany(b => b.FilterableChildren).OfType <TestSubButton>()
                                .FirstOrDefault(b => b.MatchingFilter)?.TestType;
                if (firstTest != null)
                {
                    LoadTest(firstTest);
                }
            };

            searchTextBox.Current.ValueChanged += e => leftFlowContainer.SearchTerm = e.NewValue;

            if (RuntimeInfo.IsDesktop)
            {
                backgroundCompiler = new DynamicClassCompiler <TestScene>();
                backgroundCompiler.CompilationStarted  += compileStarted;
                backgroundCompiler.CompilationFinished += compileFinished;
                backgroundCompiler.CompilationFailed   += compileFailed;

                try
                {
                    backgroundCompiler.Start();
                }
                catch
                {
                    //it's okay for this to fail for now.
                }
            }

            foreach (Assembly asm in assemblies)
            {
                toolbar.AddAssembly(asm.GetName().Name, asm);
            }

            Assembly.BindValueChanged(updateList);
            RunAllSteps.BindValueChanged(v => runTests(null));
            PlaybackRate.BindValueChanged(e =>
            {
                rateAdjustClock.Rate  = e.NewValue;
                audioRateAdjust.Value = e.NewValue;
            }, true);
        }
Example #59
0
 void Awake()
 {
     S = this;
 }
Example #60
0
    /*
     * public void OnMouseStay()
     * {
     * }*/
    public void OnMouseUpAsButton()
    {
        if (child != null)
        {
            //child.GetComponent<SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
            this.GetComponent <SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, 0.0f);
            if (this.transform.name.Contains("BuildingFlag"))
            {
                GameManager.ClearUpgradeUI();
                GameManager.ClearDismantleUI();
                BuildManager.Select(this.transform);
            }
            else if (this.name.Contains("Pause"))
            {
                AudioManager.PlayButton();
                othChild = this.transform.Find("mouseDown").gameObject;
                othChild.GetComponent <SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
                //othChild = this.transform.Find("general").gameObject;
                //othChild.GetComponent<SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, 0.0f);
                child.GetComponent <SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, 0.0f);
                Time.timeScale = (float)((int)(Time.timeScale + 1.0f) % 2);
            }
            else if (this.name.Contains("Select"))
            {
                AudioManager.PlayButton();
                //othChild = this.transform.Find("mouseDown").gameObject;
                //othChild.GetComponent<SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, 1.0f);

                //child.GetComponent<SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, 0.0f);

                GameManager.ShowInterfaceSet();
                Time.timeScale = 0.0f;
            }
            else if (this.name.Contains("UpgradeUI"))
            {
                GameManager.ClearBaseBuildings();
                BuildManager.SelectUpgradeUI();
            }
            else if (this.name.Contains("Dismantle"))
            {
                BuildManager.SelectDismantleUI();
            }
            else if (this.name.Contains("Replay"))
            {
                AudioManager.PlayButton();
                string name = "Yotta_Level" + GameManager.gameManager.currentLevel.ToString();
                AudioManager.PlayButton();
                Application.LoadLevel(name);
            }
            else if (this.name.Contains("Next"))
            {
                //for now, the level is limited to 2;
                AudioManager.PlayButton();
                int nextlevel = GameManager.gameManager.currentLevel + 1;
                if (nextlevel > 2)
                {
                    nextlevel = 2;
                }
                string name = "Yotta_Level" + nextlevel.ToString();
                Application.LoadLevel(name);
            }
            else if (this.name.Contains("Back"))
            {
                AudioManager.PlayButton();
                //this.transform.parent.gameObject.SetActive(false);
                //Vector3 pos = this.transform.parent.position;
                //this.transform.parent.position= new Vector3(pos.x, pos.y, -2);
                GameManager.ClearInterfaceSet();
                Time.timeScale = 1.0f;
            }
            else if (this.name.Contains("LevSel"))
            {
                AudioManager.StopSound(AudioManager.audioManager.backSound);
                Application.LoadLevel("Yotta_LevelSelect");
            }
            else if (this.name.Contains("TeamMem"))
            {
                othChild.GetComponent <SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
                child.GetComponent <SpriteRenderer>().color    = new Color(1.0f, 1.0f, 1.0f, 0.0f);
                this.GetComponent <SpriteRenderer>().color     = new Color(1.0f, 1.0f, 1.0f, 0.0f);
                AudioManager.PlayButton();
                Vector3 pos = new Vector3(0, 0, 0);
                Instantiate(teamMem, pos, Quaternion.identity);
                GameObject.Find("TeamMem").GetComponent <BoxCollider2D>().enabled   = false;
                GameObject.Find("StartGame").GetComponent <BoxCollider2D>().enabled = false;
            }
            else if (this.name.Contains("Start"))
            {
                othChild.GetComponent <SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
                child.GetComponent <SpriteRenderer>().color    = new Color(1.0f, 1.0f, 1.0f, 0.0f);
                this.GetComponent <SpriteRenderer>().color     = new Color(1.0f, 1.0f, 1.0f, 0.0f);
                AudioManager.PlayButton();
                AudioManager.StopSound(AudioManager.audioManager.backSound);
                Application.LoadLevel("Yotta_Start_mov");
            }
            else if (this.name.Contains("Exit"))
            {
                othChild.GetComponent <SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
                child.GetComponent <SpriteRenderer>().color    = new Color(1.0f, 1.0f, 1.0f, 0.0f);
                this.GetComponent <SpriteRenderer>().color     = new Color(1.0f, 1.0f, 1.0f, 0.0f);
                Application.Quit();
            }
            else if (this.name.Contains("ReturntoMain"))
            {
                othChild.GetComponent <SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
                child.GetComponent <SpriteRenderer>().color    = new Color(1.0f, 1.0f, 1.0f, 0.0f);
                this.GetComponent <SpriteRenderer>().color     = new Color(1.0f, 1.0f, 1.0f, 0.0f);
                AudioManager.PlayButton();
                AudioManager.StopSound(AudioManager.audioManager.backSound);
                Application.LoadLevel("Yotta_Start0");
            }
            else if (this.name.Contains("Button_next"))
            {
                AudioManager.PlayButton();
                GameObject.Find("TeamMem").GetComponent <BoxCollider2D>().enabled   = true;
                GameObject.Find("StartGame").GetComponent <BoxCollider2D>().enabled = true;
                GameObject.Destroy(this.transform.parent.gameObject);
            }
        }
        else if (this.name.Contains("Music"))
        {
            AudioManager.PlayButton();
            othChild = this.transform.Find("mouseClick").gameObject;
            int flag = (int)GlobalVariables.soundOn;
            //Color color;//the change with color param can be done later
            if (othChild != null)
            {
                flag = (int)this.GetComponent <SpriteRenderer>().color.a;
                this.GetComponent <SpriteRenderer>().color     = new Color(1.0f, 1.0f, 1.0f, (float)((flag + 1) % 2));
                othChild.GetComponent <SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, flag * 1.0f);
                GameObject otherObj;
                GameObject otherObjChild;
                otherObj = this.transform.parent.Find("SetOff").gameObject;
                otherObj.GetComponent <SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, (float)((flag + 1) % 2));
                otherObjChild = otherObj.transform.Find("mouseClick").gameObject;
                if (otherObjChild != null)
                {
                    otherObjChild.GetComponent <SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, flag * 1.0f);
                }
            }
            GlobalVariables.soundOn = (flag + 1) % 2;
        }
        else if (this.name.Contains("Off"))
        {
            AudioManager.PlayButton();
            othChild = this.transform.Find("mouseClick").gameObject;
            int flag = 0;

            //Color color;//the change with color param can be done later
            if (othChild != null)
            {
                flag = (int)this.GetComponent <SpriteRenderer>().color.r;
                this.GetComponent <SpriteRenderer>().color     = new Color(1.0f, 1.0f, 1.0f, (flag + 1) % 2 * 1.0f);
                othChild.GetComponent <SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, flag * 1.0f);
                GameObject otherObj;
                GameObject otherObjChild;
                otherObj = this.transform.parent.Find("SetMusic").gameObject;
                otherObj.GetComponent <SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, (flag + 1) % 2 * 1.0f);
                otherObjChild = otherObj.transform.Find("mouseClick").gameObject;
                if (otherObjChild != null)
                {
                    otherObjChild.GetComponent <SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, flag * 1.0f);
                }
            }
            GlobalVariables.soundOn = (flag + 1) % 2;
        }
        else if (this.name.Contains("icon"))
        {
            this.GetComponent <SpriteRenderer>().color = Color.green;
            Transform  can  = this.transform.FindChild("Canvas");
            GameObject tex  = can.FindChild("Text").gameObject;
            Text       text = tex.transform.GetComponent <Text>();
            text.color = Color.green;
            GameManager.ClearBaseBuildings();
            BuildManager.Select(this.gameObject);
        }
        else if (this.name.Contains("B0"))       //building
        {
            UnitTower tower = this.GetComponent <UnitTower>();
            BuildManager.Select(tower);
        }
        else if (this.name.Contains("Esse"))
        {
            AudioManager.PlaySound(AudioManager.audioManager.essenCollectSound, false);
            ScoreControl.EssenceIncrease(increaseAmount);
            Destroy(this.transform.parent.gameObject);
            PoolManager.Unspawn(this.transform.parent.gameObject);
        }
    }