Beispiel #1
0
        public CubeTexture(CodeGenerateSystem.Base.ConstructionParams smParam)
            : base(smParam)
        {
            InitializeComponent();

            IsInConstantBuffer = false;
            IsGeneric          = true;
            mDropAdorner       = new EditorCommon.DragDrop.DropAdorner(Image_Texture);

            ShaderVarInfo.EditorType = "Texture";
            //ShaderVarInfo.VarName = GetTextureName();

            TexturePath = EngineNS.CEngine.Instance.GameEditorInstance.Desc.DefaultTextureName;

            AddLinkPinInfo("TextureLink", TextureLink, TextureLink.BackBrush);
            AddLinkPinInfo("UVLink_3D", UVLink_3D, null);
            AddLinkPinInfo("RGBALink", RGBALink, RGBALink.BackBrush);
            AddLinkPinInfo("RGBLink", RGBLink, RGBLink.BackBrush);
            AddLinkPinInfo("RLink", RLink, RLink.BackBrush);
            AddLinkPinInfo("GLink", GLink, GLink.BackBrush);
            AddLinkPinInfo("BLink", BLink, BLink.BackBrush);
            AddLinkPinInfo("ALink", ALink, ALink.BackBrush);

            InitializeShaderVarInfo();
        }
Beispiel #2
0
        private void Rectangle_AddTech_DragEnter(object sender, DragEventArgs e)
        {
            var element = sender as FrameworkElement;

            if (element == null)
            {
                return;
            }

            mDropAdorner = new EditorCommon.DragDrop.DropAdorner(LayoutRoot);

            if (EditorCommon.DragDrop.DragDropManager.Instance.DragType.Equals("ResourceItem"))
            {
                e.Handled = true;
                mDropAdorner.IsAllowDrop = false;

                switch (AllowResourceItemDrop(e))
                {
                case enDropResult.Allow:
                {
                    EditorCommon.DragDrop.DragDropManager.Instance.InfoString = "添加材质模板";

                    mDropAdorner.IsAllowDrop = true;
                    var pos = e.GetPosition(element);
                    if (pos.X > 0 && pos.X < element.ActualWidth &&
                        pos.Y > 0 && pos.Y < element.ActualHeight)
                    {
                        var layer = AdornerLayer.GetAdornerLayer(element);
                        layer.Add(mDropAdorner);
                    }
                }
                break;

                case enDropResult.Denial_NoDragAbleObject:
                case enDropResult.Denial_UnknowFormat:
                {
                    EditorCommon.DragDrop.DragDropManager.Instance.InfoString = "拖动内容不是材质模板";

                    mDropAdorner.IsAllowDrop = false;
                    var pos = e.GetPosition(element);
                    if (pos.X > 0 && pos.X < element.ActualWidth &&
                        pos.Y > 0 && pos.Y < element.ActualHeight)
                    {
                        var layer = AdornerLayer.GetAdornerLayer(element);
                        layer.Add(mDropAdorner);
                    }
                }
                break;
                }
            }
        }
        private void RectCanvas_DragEnter(object sender, DragEventArgs e)
        {
            mDropAdorner = new EditorCommon.DragDrop.DropAdorner(RectCanvas);

            var pos = e.GetPosition(RectCanvas);

            if (pos.X > 0 && pos.X < RectCanvas.ActualWidth &&
                pos.Y > 0 && pos.Y < RectCanvas.ActualHeight)
            {
                var layer = AdornerLayer.GetAdornerLayer(RectCanvas);
                layer.Add(mDropAdorner);
            }

            mDropAdorner.IsAllowDrop = CheckDropAvailable(e);
        }