Beispiel #1
0
        protected override void OnAwake()
        {
            mvComponent = GetLogicalComponent <PlayerMovementComponent>();
            ForceManagerSystem forceManager = SingletonPool.Get <ForceManagerSystem>();

            forceManager.AddManagerForce(gameObject.GetInstanceID(), GetComponent <Rigidbody2D>(), gameObject);
        }
Beispiel #2
0
        public void ChangeSlide(string nameSlider)
        {
            AudioManager audioManager = SingletonPool.Get <AudioManager>();
            AudioEnum    audioEnum    = EnumExtend.ParseEnum <AudioEnum>(nameSlider);

            audioManager.SetVolume(audioEnum, sliders[audioEnum].value, true);
        }
Beispiel #3
0
 private static void LogBuild(object obj)
 {
     if (GameObject.FindObjectOfType <DebugBuildManager>() == null)
     {
         CreateDebugBuild();
     }
     SingletonPool.Get <DebugBuildManager>().Log(obj);
 }
Beispiel #4
0
        public override void SetAction()
        {
            ForceManagerSystem forceManager = SingletonPool.Get <ForceManagerSystem>();

            transform.rotation = QuaternionExtend.CalculateRotation2D(Take <Vector2>("direction"));
            forceManager.EnableForce(gameObject.GetInstanceID());
            forceManager.AddForce(gameObject.GetInstanceID(), "movement", Take <Vector2>("direction") * speed);
        }
Beispiel #5
0
        private void OnDisable()
        {
            ForceManagerSystem forceManager = SingletonPool.Get <ForceManagerSystem>();

            if (forceManager)
            {
                forceManager.DisableForce(gameObject.GetInstanceID());
            }
        }
Beispiel #6
0
        private void SetMusicSlider()
        {
            AudioManager audioManager = SingletonPool.Get <AudioManager>();
            Transform    parent       = transform.Find("OptionsPanel/");

            sliders = new Dictionary <AudioEnum, Slider>
            {
                { AudioEnum.Music, parent.Find("SliderMusic").GetComponent <Slider>() },
                { AudioEnum.SoundEffects, parent.Find("SliderEffects").GetComponent <Slider>() }
            };

            sliders[AudioEnum.Music].value        = audioManager.GetVolume(AudioEnum.Music);
            sliders[AudioEnum.SoundEffects].value = audioManager.GetVolume(AudioEnum.SoundEffects);
        }
Beispiel #7
0
 public void SetMovement(Vector2 valueInput)
 {
     CalculateDirection(valueInput);
     SingletonPool.Get <ForceManagerSystem>().AddForce(ID, "movement", valueInput * speed);
 }
Beispiel #8
0
 protected static GameManager GetIstance()
 {
     return(SingletonPool.Get <GameManager>());
 }
 private static InputReaderManager GetIstance()
 {
     return(SingletonPool.Get <InputReaderManager>());
 }
Beispiel #10
0
        public override void SetAwake()
        {
            ForceManagerSystem forceManager = SingletonPool.Get <ForceManagerSystem>();

            forceManager.AddManagerForce(gameObject.GetInstanceID(), GetComponent <Rigidbody2D>());
        }