private static bool SetContainerType()
        {
            MyCharacter character = MySession.LocalCharacter;

            if (character == null)
            {
                return(false);
            }

            Matrix headMatrix             = character.GetHeadMatrix(true);
            List <MyPhysics.HitInfo> hits = new List <MyPhysics.HitInfo>();

            Sandbox.Engine.Physics.MyPhysics.CastRay(headMatrix.Translation, headMatrix.Translation + headMatrix.Forward * 100.0f, hits);

            if (hits.Count() == 0)
            {
                return(false);
            }

            var hit = hits.FirstOrDefault();

            if (hit.HkHitInfo.Body == null)
            {
                return(false);
            }
            IMyEntity entity = hit.HkHitInfo.GetHitEntity();

            if (!(entity is MyCargoContainer))
            {
                return(false);
            }

            var dialog = new MyGuiScreenDialogContainerType(entity as MyCargoContainer);

            MyGuiSandbox.AddScreen(dialog);
            return(true);
        }
        private static bool SetContainerType()
        {
            MyCharacter character = MySession.Static.LocalCharacter;
            if (character == null) return false;

            Matrix headMatrix = character.GetHeadMatrix(true);
            List<MyPhysics.HitInfo> hits = new List<MyPhysics.HitInfo>();
            Sandbox.Engine.Physics.MyPhysics.CastRay(headMatrix.Translation, headMatrix.Translation + headMatrix.Forward * 100.0f, hits);

            if (hits.Count == 0) return false;

            var hit = hits.FirstOrDefault();
            if (hit.HkHitInfo.Body == null) return false;
            IMyEntity entity = hit.HkHitInfo.GetHitEntity();

            if (!(entity is MyCargoContainer)) return false;

            var dialog = new MyGuiScreenDialogContainerType(entity as MyCargoContainer);

            MyGuiSandbox.AddScreen(dialog);
            return true;
        }