Cube changing colors from black to white over time.
This commit is contained in:
parent
54afeba20d
commit
ba5e208be0
@ -7,6 +7,8 @@
|
|||||||
<e p="C:\Users\qrsnow\AppData\Roaming\JetBrains\Rider2020.2\extensions" t="IncludeRecursive" />
|
<e p="C:\Users\qrsnow\AppData\Roaming\JetBrains\Rider2020.2\extensions" t="IncludeRecursive" />
|
||||||
<e p="C:\Users\qrsnow\AppData\Roaming\JetBrains\Rider2020.2\scratches" t="IncludeRecursive" />
|
<e p="C:\Users\qrsnow\AppData\Roaming\JetBrains\Rider2020.2\scratches" t="IncludeRecursive" />
|
||||||
<e p="D:\LQ_Files\JetBrains\Projects\RiderProjects\AgeTestingGrounds" t="IncludeFlat">
|
<e p="D:\LQ_Files\JetBrains\Projects\RiderProjects\AgeTestingGrounds" t="IncludeFlat">
|
||||||
|
<e p=".gitattributes" t="Include" />
|
||||||
|
<e p=".gitignore" t="Include" />
|
||||||
<e p="AgeTestingGrounds.sln" t="IncludeFlat" />
|
<e p="AgeTestingGrounds.sln" t="IncludeFlat" />
|
||||||
<e p="AgeTestingGrounds.uproject" t="Include" />
|
<e p="AgeTestingGrounds.uproject" t="Include" />
|
||||||
<e p="Config" t="Include">
|
<e p="Config" t="Include">
|
||||||
@ -29,6 +31,12 @@
|
|||||||
<e p="AgeTestingGrounds.h" t="Include" />
|
<e p="AgeTestingGrounds.h" t="Include" />
|
||||||
<e p="AgeTestingGroundsGameModeBase.cpp" t="Include" />
|
<e p="AgeTestingGroundsGameModeBase.cpp" t="Include" />
|
||||||
<e p="AgeTestingGroundsGameModeBase.h" t="Include" />
|
<e p="AgeTestingGroundsGameModeBase.h" t="Include" />
|
||||||
|
<e p="Private" t="Include">
|
||||||
|
<e p="ColoredCube.cpp" t="Include" />
|
||||||
|
</e>
|
||||||
|
<e p="Public" t="Include">
|
||||||
|
<e p="ColoredCube.h" t="Include" />
|
||||||
|
</e>
|
||||||
</e>
|
</e>
|
||||||
<e p="AgeTestingGrounds.Target.cs" t="Include" />
|
<e p="AgeTestingGrounds.Target.cs" t="Include" />
|
||||||
<e p="AgeTestingGroundsEditor.Target.cs" t="Include" />
|
<e p="AgeTestingGroundsEditor.Target.cs" t="Include" />
|
||||||
|
51
.idea/.idea.AgeTestingGrounds/.idea/workspace.xml
generated
51
.idea/.idea.AgeTestingGrounds/.idea/workspace.xml
generated
@ -2,6 +2,7 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="AutoGeneratedRunConfigurationManager">
|
<component name="AutoGeneratedRunConfigurationManager">
|
||||||
<projectFile>Intermediate/ProjectFiles/AgeTestingGrounds.vcxproj</projectFile>
|
<projectFile>Intermediate/ProjectFiles/AgeTestingGrounds.vcxproj</projectFile>
|
||||||
|
<projectFile>Intermediate/ProjectFiles/UE4.vcxproj</projectFile>
|
||||||
</component>
|
</component>
|
||||||
<component name="AutoImportSettings">
|
<component name="AutoImportSettings">
|
||||||
<option name="autoReloadType" value="SELECTIVE" />
|
<option name="autoReloadType" value="SELECTIVE" />
|
||||||
@ -22,11 +23,24 @@
|
|||||||
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
|
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
|
||||||
</path>
|
</path>
|
||||||
</expand>
|
</expand>
|
||||||
<select />
|
<select>
|
||||||
|
<path>
|
||||||
|
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
|
||||||
|
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
|
||||||
|
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
|
||||||
|
<item name="BRANCH:origin/master" type="e8cecc67:BranchNodeDescriptor" />
|
||||||
|
</path>
|
||||||
|
</select>
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="a1af30d9-726c-4692-87c8-1c06531df09b" name="Default Changelist" comment="initial commit">
|
<list default="true" id="a1af30d9-726c-4692-87c8-1c06531df09b" name="Default Changelist" comment="initial commit">
|
||||||
|
<change beforePath="$PROJECT_DIR$/.idea/.idea.AgeTestingGrounds/.idea/contentModel.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.AgeTestingGrounds/.idea/contentModel.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.AgeTestingGrounds/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.AgeTestingGrounds/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/.idea.AgeTestingGrounds/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.AgeTestingGrounds/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/AgeTestingGrounds.uproject" beforeDir="false" afterPath="$PROJECT_DIR$/AgeTestingGrounds.uproject" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/Binaries/Win64/AgeTestingGroundsEditor.target" beforeDir="false" afterPath="$PROJECT_DIR$/Binaries/Win64/AgeTestingGroundsEditor.target" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/Content/StarterContent/Maps/Minimal_Default.umap" beforeDir="false" afterPath="$PROJECT_DIR$/Content/StarterContent/Maps/Minimal_Default.umap" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/Content/StarterContent/Maps/Minimal_Default_BuiltData.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/StarterContent/Maps/Minimal_Default_BuiltData.uasset" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/Intermediate/ProjectFiles/AgeTestingGrounds.vcxproj" beforeDir="false" afterPath="$PROJECT_DIR$/Intermediate/ProjectFiles/AgeTestingGrounds.vcxproj" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@ -34,12 +48,20 @@
|
|||||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||||
</component>
|
</component>
|
||||||
<component name="Git.Settings">
|
<component name="Git.Settings">
|
||||||
|
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||||
|
<map>
|
||||||
|
<entry key="$PROJECT_DIR$" value="master" />
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
</component>
|
</component>
|
||||||
<component name="IdeDocumentHistory">
|
<component name="IdeDocumentHistory">
|
||||||
<option name="CHANGED_PATHS">
|
<option name="CHANGED_PATHS">
|
||||||
<list>
|
<list>
|
||||||
<option value="$PROJECT_DIR$/.gitignore" />
|
<option value="$PROJECT_DIR$/.gitignore" />
|
||||||
|
<option value="$PROJECT_DIR$/Source/AgeTestingGrounds/Public/ColoredCube.cpp" />
|
||||||
|
<option value="$PROJECT_DIR$/Source/AgeTestingGrounds/Public/ColoredCube.h" />
|
||||||
|
<option value="$PROJECT_DIR$/Source/AgeTestingGrounds/Private/ColoredCube.cpp" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
@ -230,6 +252,7 @@
|
|||||||
<workItem from="1600829622926" duration="585000" />
|
<workItem from="1600829622926" duration="585000" />
|
||||||
<workItem from="1600830250345" duration="3275000" />
|
<workItem from="1600830250345" duration="3275000" />
|
||||||
<workItem from="1600899228967" duration="4409000" />
|
<workItem from="1600899228967" duration="4409000" />
|
||||||
|
<workItem from="1601154856437" duration="2416000" />
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00001" summary="initial commit">
|
<task id="LOCAL-00001" summary="initial commit">
|
||||||
<created>1600830459800</created>
|
<created>1600830459800</created>
|
||||||
@ -272,11 +295,24 @@
|
|||||||
<map>
|
<map>
|
||||||
<entry key="MAIN">
|
<entry key="MAIN">
|
||||||
<value>
|
<value>
|
||||||
<State />
|
<State>
|
||||||
|
<option name="FILTERS">
|
||||||
|
<map>
|
||||||
|
<entry key="branch">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="origin/master" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</State>
|
||||||
</value>
|
</value>
|
||||||
</entry>
|
</entry>
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
|
<option name="oldMeFiltersMigrated" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
|
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
|
||||||
@ -304,4 +340,15 @@
|
|||||||
</state>
|
</state>
|
||||||
<state x="552" y="253" key="Vcs.Push.Dialog.v2/0.0.1920.1040@0.0.1920.1040" timestamp="1600900824152" />
|
<state x="552" y="253" key="Vcs.Push.Dialog.v2/0.0.1920.1040@0.0.1920.1040" timestamp="1600900824152" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="XDebuggerManager">
|
||||||
|
<breakpoint-manager>
|
||||||
|
<breakpoints>
|
||||||
|
<line-breakpoint enabled="true" type="com.jetbrains.cidr.execution.debugger.OCBreakpointType">
|
||||||
|
<url>file://$PROJECT_DIR$/Source/AgeTestingGrounds/Private/ColoredCube.cpp</url>
|
||||||
|
<line>39</line>
|
||||||
|
<option name="timeStamp" value="2" />
|
||||||
|
</line-breakpoint>
|
||||||
|
</breakpoints>
|
||||||
|
</breakpoint-manager>
|
||||||
|
</component>
|
||||||
</project>
|
</project>
|
@ -7,7 +7,10 @@
|
|||||||
{
|
{
|
||||||
"Name": "AgeTestingGrounds",
|
"Name": "AgeTestingGrounds",
|
||||||
"Type": "Runtime",
|
"Type": "Runtime",
|
||||||
"LoadingPhase": "Default"
|
"LoadingPhase": "Default",
|
||||||
|
"AdditionalDependencies": [
|
||||||
|
"Engine"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
@ -2,6 +2,6 @@
|
|||||||
"BuildId": "13144385",
|
"BuildId": "13144385",
|
||||||
"Modules":
|
"Modules":
|
||||||
{
|
{
|
||||||
"AgeTestingGrounds": "UE4Editor-AgeTestingGrounds.dll"
|
"AgeTestingGrounds": "UE4Editor-AgeTestingGrounds-7862.dll"
|
||||||
}
|
}
|
||||||
}
|
}
|
3
Content/ColoredCube_BP.uasset
Normal file
3
Content/ColoredCube_BP.uasset
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:335425d332c75541e8639fe181b7e85823953652287033acc85ea6148b1dad63
|
||||||
|
size 75331
|
3
Content/Colors.uasset
Normal file
3
Content/Colors.uasset
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:056b14739ac169382bc296ab0f1b2e3fefc510e604433492c540784b73796253
|
||||||
|
size 81655
|
Binary file not shown.
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:a95d89fc904c9966cf7336969e37a6fadc4b78dd3c276c78782350219b0a0874
|
oid sha256:13f7062ee1dcfc2b5e6a59e7336c52e26b0f6f8ebb67b4e56785eae8cf7126c4
|
||||||
size 3173454
|
size 3161903
|
||||||
|
File diff suppressed because one or more lines are too long
42
Source/AgeTestingGrounds/Private/ColoredCube.cpp
Normal file
42
Source/AgeTestingGrounds/Private/ColoredCube.cpp
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Sets default values
|
||||||
|
#include "AgeTestingGrounds/Public/ColoredCube.h"
|
||||||
|
|
||||||
|
#include "Materials/MaterialInstanceDynamic.h"
|
||||||
|
#include "Materials/MaterialInterface.h"
|
||||||
|
#include "Components/StaticMeshComponent.h"
|
||||||
|
|
||||||
|
|
||||||
|
AColoredCube::AColoredCube()
|
||||||
|
{
|
||||||
|
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
||||||
|
PrimaryActorTick.bCanEverTick = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when the game starts or when spawned
|
||||||
|
void AColoredCube::BeginPlay()
|
||||||
|
{
|
||||||
|
Super::BeginPlay();
|
||||||
|
|
||||||
|
auto Cube = FindComponentByClass<UStaticMeshComponent>();
|
||||||
|
auto Material = Cube->GetMaterial(0);
|
||||||
|
|
||||||
|
DynamicMaterial = UMaterialInstanceDynamic::Create(Material, NULL);
|
||||||
|
|
||||||
|
Cube->SetMaterial(0, DynamicMaterial);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called every frame
|
||||||
|
void AColoredCube::Tick(float DeltaTime)
|
||||||
|
{
|
||||||
|
Super::Tick(DeltaTime);
|
||||||
|
|
||||||
|
float Blend = .05f + FMath::Cos(GetWorld()->TimeSeconds/2);
|
||||||
|
DynamicMaterial->SetScalarParameterValue(TEXT("Blend"), Blend);
|
||||||
|
}
|
||||||
|
|
31
Source/AgeTestingGrounds/Public/ColoredCube.h
Normal file
31
Source/AgeTestingGrounds/Public/ColoredCube.h
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "GameFramework/Actor.h"
|
||||||
|
#include "ColoredCube.generated.h"
|
||||||
|
|
||||||
|
class UMaterialInstanceDynamic;
|
||||||
|
|
||||||
|
UCLASS()
|
||||||
|
class AGETESTINGGROUNDS_API AColoredCube : public AActor
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Sets default values for this actor's properties
|
||||||
|
AColoredCube();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Called when the game starts or when spawned
|
||||||
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Called every frame
|
||||||
|
virtual void Tick(float DeltaTime) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
UMaterialInstanceDynamic* DynamicMaterial;
|
||||||
|
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user