Ejemplo n.º 1
0
        protected void InitCameraFollow(ICharacterFacade character_facade)
        {
            this.UpdateAsObservable()
            .Subscribe(_ => {
                Vector3 point       = camera_core.WorldToViewportPoint(character_facade.Position);
                Vector3 delta       = character_facade.Position - camera_core.ViewportToWorldPoint(new Vector3(settings.character_offset.x, settings.character_offset.y, point.z));
                Vector3 destination = transform.position + delta;

                if (destination.x < camera_level_bounds.x)
                {
                    destination.x = camera_level_bounds.x;
                }
                else if (destination.x > camera_level_bounds.width)
                {
                    destination.x = camera_level_bounds.width;
                }

                if (destination.y < camera_level_bounds.y)
                {
                    destination.y = camera_level_bounds.y;
                }

                transform.position = Vector3.SmoothDamp(transform.position, destination, ref velocity, settings.follow_damping);
            })
            .AddTo(this);
        }
Ejemplo n.º 2
0
 public CharacterCreationHandler(ICharacterFacade facade)
 {
     _facade = facade;
 }
Ejemplo n.º 3
0
 public CharacterUpdateHandler(ICharacterFacade facade)
 {
     _facade = facade;
 }
Ejemplo n.º 4
0
 public CharactersQueryHandler(ICharacterFacade facade)
 {
     _facade = facade;
 }
Ejemplo n.º 5
0
 public CharacterDeletionHandler(ICharacterFacade characterFacade)
 {
     _facade = characterFacade;
 }
Ejemplo n.º 6
0
 public void AddPlayerCharacter(ICharacterFacade character)
 {
     player_character.Value = character;
 }