示例#1
0
        private void Post_OnCollision(object sender, PhysicsBodyComponent e)
        {
            ServerMPPlayer player = e.GameObject as ServerMPPlayer;

            if (player != null)
            {
                CommandPost post = ((PhysicsBodyComponent)sender).GameObject as CommandPost;
                if (post.Team == player.Team)
                {
                    player.Refresh();

                    if (player.HasIntel)
                    {
                        CaptureIntel(player, player.Intel);
                    }
                }
            }
            else if (e.GameObject is Intel intel)
            {
                if (intel.Holder == null)
                {
                    CommandPost post = ((PhysicsBodyComponent)sender).GameObject as CommandPost;
                    if (post.Team != intel.Team)
                    {
                        CaptureIntel(intel.LastHolder as ServerMPPlayer, intel);
                    }
                }
            }
        }
示例#2
0
        private void Post_OnCollision(object sender, PhysicsBodyComponent e)
        {
            ServerMPPlayer player = e.GameObject as ServerMPPlayer;

            if (player != null)
            {
                CommandPost post = ((PhysicsBodyComponent)sender).GameObject as CommandPost;
                if (post.Team == player.Team)
                {
                    player.Refresh();
                }
            }
        }