// Start is called before the first frame update
    void Start()
    {
        audioManagement = GameObject.Find("AudioSystem").GetComponent <AudioManagement>();

        isScrolling = true;
        gameState   = E_GameState.Play;
    }
Exemple #2
0
    private void Awake()
    {
        audioManagement = GameObject.FindWithTag("Managerment").GetComponent <AudioManagement>();

        animationFire  = GetComponent <Animator>();
        animationLight = GetComponentInChildren <Animation>();
    }
    // Use this for initialization
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);

        //Tells each sound what variables should be editable for that sound
        foreach (Sounds s in sounds)
        {
            s.source      = gameObject.AddComponent <AudioSource>();
            s.source.clip = s.clip;

            s.source.volume = s.volume;
            s.source.pitch  = s.pitch;
            s.source.loop   = s.loop;
        }
    }
Exemple #4
0
 // Use the singleton pattern to manage playing audio for powerups.
 // This allows us to keep track of whether audio is playing, and stop the existing audio if it is
 public static PowerupSoundManager getInstance()
 {
     if (instance == null)
     {
         instance = new PowerupSoundManager();
         aSource  = GameObject.Find("AudioManagement").GetComponent <AudioManagement>();
     }
     return(instance);
 }
 private void Awake()
 {
     // Singleton
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
     }
 }
Exemple #6
0
    //The following function has been integrated from
    //https://unity3d.com/learn/tutorials/projects/2d-roguelike-tutorial/audio-and-sound-manager
    void Awake()
    {
        //Check if there is already an instance of SoundManager
        if (instance == null)
        {
            //if not, set it to this.
            instance = this;
        }
        //If instance already exists:
        else if (instance != this)
        {
            //Destroy this, this enforces our singleton pattern so there can only be one instance of SoundManager.
            Destroy(gameObject);
        }

        //Set SoundManager to DontDestroyOnLoad so that it won't be destroyed when reloading our scene.
        DontDestroyOnLoad(gameObject);
    }
        private void ResetFromMediaCore(Control ctrl)
        {
            VideoHostControlHandle = IntPtr.Zero;
            var mediaInstance = GetMedia().MediaInstance;

            if (ctrl != null)
            {
                ctrl.GetType().GetMethod("RecreateHandle", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(ctrl, null);
            }
            _myMediaPlayerInstance.Pointer = IntPtr.Zero;
            _myMediaPlayerInstance         = Manager.CreateMediaPlayerFromMedia(mediaInstance);
            RegisterEvents();
            if (ctrl != null)
            {
                VideoHostControlHandle = ctrl.Handle;
                Chapters  = new ChapterManagement(Manager, _myMediaPlayerInstance);
                SubTitles = new SubTitlesManagement(Manager, _myMediaPlayerInstance);
                Video     = new VideoManagement(Manager, _myMediaPlayerInstance);
                Audio     = new AudioManagement(Manager, _myMediaPlayerInstance);
            }
        }
        internal VlcMediaPlayer(VlcManager manager)
        {
            Manager = manager;
            // SUR: Configure VLC options at startup
            Manager.CreateNewInstance(new string[]
            {
#if DEBUG_TODO
                "--extraintf=logger",
                "--verbose=2",
#else
                "--quiet",
#endif
                //"--play-and-pause",   // NOTE: SUR: Pauses at end of video
            });

            _myMediaPlayerInstance = manager.CreateMediaPlayer();
            RegisterEvents();
            Chapters  = new ChapterManagement(manager, _myMediaPlayerInstance);
            SubTitles = new SubTitlesManagement(manager, _myMediaPlayerInstance);
            Video     = new VideoManagement(manager, _myMediaPlayerInstance);
            Audio     = new AudioManagement(manager, _myMediaPlayerInstance);
        }
Exemple #9
0
    public void Awake()
    {
        if (ins == null)
        {
            ins = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);
        foreach (Sound s in music)
        {
            s.source      = gameObject.AddComponent <AudioSource>();
            s.source.clip = s.clip;

            s.source.volume = s.volume;
            s.source.pitch  = s.pitch;

            s.source.loop = s.loop;
        }
    }
 private void Awake()
 {
     Instance = Instance;
 }
Exemple #11
0
 // Use this for initialization
 void Start()
 {
     soundManager = GameObject.FindGameObjectWithTag("AudioManagement").GetComponent <AudioManagement>();
 }
 // Start is called before the first frame update
 void Start()
 {
     canvasRTrans = canvas.GetComponent <RectTransform>();
     amScript     = audioManager.GetComponent <AudioManagement>();
     startPos     = new Vector3(Random.Range(0f, randomRangeMax), 0f, 0f);
 }
 public virtual void Start()
 {
     uiController   = GameObject.FindGameObjectWithTag("UIManager").GetComponent <UIController>();
     profileManager = GameObject.FindGameObjectWithTag("ProfileManager").GetComponent <ProfileManager>();
     aSource        = GameObject.Find("AudioManagement").GetComponent <AudioManagement>();
 }
Exemple #14
0
 // Use this for initialization.
 void Start()
 {
     aSource = GameObject.Find("AudioManagement").GetComponent <AudioManagement>();
     rb2d    = GetComponent <Rigidbody2D>();
     health  = MAX_HEALTH;
 }