|
- // Fill out your copyright notice in the Description page of Project Settings.
- #pragma once
- #include "CoreMinimal.h"
- #include "SGridDragDrop.h"
- #include "LevelEditorViewport.h"
- /**
- *
- */
- class DLLEXPORT MyAnimationSlate : public SCompoundWidget
- {
- public:
- //SLATE_BEGIN_ARGS+SLATE_END_ARGS 其实是一个结构体, 内部写的东西都相当于写在了一个结构体里面
- SLATE_BEGIN_ARGS(MyAnimationSlate)
- {
- _Visibility = EVisibility::SelfHitTestInvisible;
- }
- //外部Slot里面的都是作为这个Slate里面的ChildSlot出现
- SLATE_DEFAULT_SLOT(FArguments, OutSlots)
- SLATE_END_ARGS()
- //外部执行SNew或者SAssignNew时候会调用Construct()
- void Construct(const FArguments& InArgs);
- //鼠标进入
- virtual void OnMouseEnter(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
- //鼠标离开
- virtual void OnMouseLeave(const FPointerEvent& MouseEvent) override;
- //
- UWorld* SetWorldRay(const FVector2D& ScreenPosition);
- //颜色变化
- virtual void Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override;
- FLinearColor SlateColorChanged();
- virtual FReply OnMouseButtonDown(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
- virtual FReply OnDragDetected(const FGeometry& MyGeometry,const FPointerEvent& MouseEvent) override;
- virtual void OnDragEnter(const FGeometry& MyGeometry, const FDragDropEvent& DragDropEvent) override;
- virtual void OnDragLeave(const FDragDropEvent& DragDropEvent) override;
- //virtual FReply OnDragOver(const FGeometry& MyGeometry, const FDragDropEvent& DragDropEvent) override;
- virtual FReply OnDrop(const FGeometry& MyGeometry, const FDragDropEvent& DragDropEvent) override;
- private:
- //Slate动画对象
- FCurveSequence MySlateCurveSequence;
- };
复制代码
|
|