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

            forceManager.AddManagerForce(gameObject.GetInstanceID(), GetComponent <Rigidbody2D>(), gameObject);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
 private static void LogBuild(object obj)
 {
     if (GameObject.FindObjectOfType <DebugBuildManager>() == null)
     {
         CreateDebugBuild();
     }
     SingletonPool.Get <DebugBuildManager>().Log(obj);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
        private void OnDisable()
        {
            ForceManagerSystem forceManager = SingletonPool.Get <ForceManagerSystem>();

            if (forceManager)
            {
                forceManager.DisableForce(gameObject.GetInstanceID());
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 7
0
 public void SetMovement(Vector2 valueInput)
 {
     CalculateDirection(valueInput);
     SingletonPool.Get <ForceManagerSystem>().AddForce(ID, "movement", valueInput * speed);
 }
Ejemplo n.º 8
0
 protected static GameManager GetIstance()
 {
     return(SingletonPool.Get <GameManager>());
 }
Ejemplo n.º 9
0
 private static InputReaderManager GetIstance()
 {
     return(SingletonPool.Get <InputReaderManager>());
 }
Ejemplo n.º 10
0
        public override void SetAwake()
        {
            ForceManagerSystem forceManager = SingletonPool.Get <ForceManagerSystem>();

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