コード例 #1
0
        //**************************************************************************************
        private void OnLoad(object sender, EventArgs e)
        {
            EngineBox.Items.Add(new ListItem(6, "MySQL"));

            NameBox.Text              = server.Name;
            HostBox.Text              = server.Host;
            UserBox.Text              = server.Username;
            PassBox.Text              = server.Password;
            IsFavorite.Checked        = server.IsFavorite;
            PortBox.Text              = server.Port.ToString();
            tabColorBox.SelectedColor = Color.FromArgb(server.TabColor);
            NotesBox.Text             = server.Notes;
            EngineBox.SelectID((int)server.Type);

            if (server.Port == 3306 || server.Port == 0)
            {
                DefaultPort.Checked = true;
                PortBox.Enabled     = false;
                PortBox.Text        = "3306";
            }
            else
            {
                DefaultPort.Checked = false;
                PortBox.Enabled     = true;
            }

            switch (server.Type)
            {
            case ServerType.MYSQL:
                Text = "MySQL Settings";
                break;
            }
        }
コード例 #2
0
 void UpdateBox()
 {
     if (_engineInstance == null)
     {
         return;
     }
     if (TriggerShape == TriggerShape_e.Box)
     {
         EngineBox.SetBoxDimensions(_shapeType, _vBoxSize.X * ScaleX * 0.5f, _vBoxSize.Y * ScaleY * 0.5f, _vBoxSize.Z * ScaleZ * 0.5f);
     }
     else
     {
         float r = SphereRadius * UniformScaling;
         EngineBox.SetBoxDimensions(_shapeType, r, r, r);
     }
     TriggerRepaint2D(false);
 }
コード例 #3
0
        public override void OnSceneEvent(SceneEventArgs e)
        {
            base.OnSceneEvent(e);
            if (!Active || !ExportShape || EngineBox == null)
            {
                return;
            }

            if (e.action == SceneEventArgs.Action.BeforeExport || e.action == SceneEventArgs.Action.BeforePrefabBinaryExport)
            {
                ShapeCollection shapes = GetRelevantShapes();
                if (shapes == null || shapes.Count == 0)
                {
                    return;
                }
                string name;
                string fileextension = ".vmesh";
                if (string.IsNullOrEmpty(_exportFileName))
                {
                    //use UID
                    name = string.Format("SM_{0:x8}_{1:x8}", ParentLayer.LayerID, this.LocalID);
                }
                else
                {
                    name = _exportFileName;
                }
                name += fileextension;

                string filename = null;
                if (e is ExportSceneEventArgs)
                {
                    filename = Path.Combine(((ExportSceneEventArgs)e).ExportInfo.AbsoluteExportDataFolder, name);
                }
                else
                {
                    // this path is taken by BeforePrefabBinaryExport
                    PropertyInfo property = EditorManager.Scene.GetType().GetProperty("AbsoluteZoneExportFolder");
                    if (property != null)
                    {
                        filename = property.GetValue(EditorManager.Scene, null) as string;
                    }
                    if (string.IsNullOrEmpty(filename))
                    {
                        return;
                    }
                    filename = Path.Combine(filename, name);
                }
                filename = EditorManager.Project.MakeRelative(filename);

                EngineBox.fCombinedFarClipDist      = -1.0f;
                EngineBox.iCombinedVisibleBitmask   = 0;
                EngineBox.iCombinedCollisionBitmask = 0;
                EngineBox.bCombinedStaticShadows    = false;
                EngineBox.bCombinedDynamicShadows   = false;

                foreach (StaticMeshShape shape in shapes)
                {
                    if (StaticMeshShape.UsesCollisionGroups)
                    {
                        EngineBox.iCombinedCollisionBitmask = shape.EngineMesh.GetCollisionFilter();
                    }
                    else
                    {
                        EngineBox.iCombinedCollisionBitmask |= (uint)shape.CollisionBitmask;
                    }
                    EngineBox.iCombinedVisibleBitmask |= (uint)shape.VisibleBitmask;
                    EngineBox.fCombinedFarClipDist     = Math.Max(EngineBox.fCombinedFarClipDist, shape.FarClipDistance);
                    EngineBox.bCombinedStaticShadows  |= shape.CastStaticShadows;
                    EngineBox.bCombinedDynamicShadows |= shape.CastDynamicShadows;
                }

                EngineBox.BeginExport(shapes, filename);
                return;
            }
            if (e.action == SceneEventArgs.Action.AfterExport || e.action == SceneEventArgs.Action.AfterPrefabBinaryExport)
            {
                EngineBox.EndExport();
                return;
            }
        }