Exemple #1
0
        private void BroadcastPlayerBodyConnection(string message, Body body)
        {
            var playerBodyConnection = new PlayerBodyConnection(this, body);

            BroadcastMessage(message, playerBodyConnection);
            body.BroadcastMessage(message, playerBodyConnection);
        }
Exemple #2
0
        public virtual void OnDetachPlayer(PlayerBodyConnection connection)
        {
            player = null;
            var rb = GetComponent <Rigidbody2D>();

            if (rb != null)
            {
                rb.velocity = Vector2.zero;
            }
        }
Exemple #3
0
 public void OnDetachPlayer(PlayerBodyConnection connection)
 {
     m_virtualInput = null;
 }
Exemple #4
0
 public void OnAttachPlayer(PlayerBodyConnection connection)
 {
     m_virtualInput = (connection.body != null) ? connection.body.GetComponent <VirtualInput>() : null;
     m_movement     = (connection.body != null) ? connection.body.GetComponent <Movement>() : null;
 }
Exemple #5
0
 public virtual void OnAttachPlayer(PlayerBodyConnection connection)
 {
     player = connection.player;
 }
Exemple #6
0
 public virtual void OnAttachPlayer(PlayerBodyConnection connection)
 {
     m_playerInput = connection.player.GetComponent <PlayerInput>();
 }