Skip to content
This repository has been archived by the owner on Oct 19, 2020. It is now read-only.

Update to the TP_Puzzle #112

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
27 changes: 11 additions & 16 deletions Templates/TP_Puzzle/Managed/TP_Puzzle.Managed/PuzzleBlock.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnrealEngine.Engine;
using UnrealEngine.InputCore;
using UnrealEngine.Runtime;
Expand All @@ -14,8 +9,8 @@ class APuzzleBlock : AActor
{
// These are private fields. These aren't visible to UE4 in any way.
// This may be undesirable; such as in cases where you may want to duplicate a block. These wouldn't get serialized.
private bool isActive;
private bool isHighlighted;
private bool _isActive;
private bool _isHighlighted;

[UProperty, EditAnywhere, BlueprintReadWrite, ExposeOnSpawn]
public APuzzleBlockGrid OwningGrid { get; set; }
Expand Down Expand Up @@ -61,15 +56,15 @@ public override void Initialize(FObjectInitializer initializer)
}
}

protected override void ReceiveActorOnClicked_Implementation(FKey ButtonPressed)
protected override void ReceiveActorOnClicked_Implementation(FKey buttonPressed)
{
base.ReceiveActorOnClicked_Implementation(ButtonPressed);
base.ReceiveActorOnClicked_Implementation(buttonPressed);
HandleControllerClick();
}

protected override void ReceiveActorOnInputTouchBegin_Implementation(ETouchIndex FingerIndex)
protected override void ReceiveActorOnInputTouchBegin_Implementation(ETouchIndex fingerIndex)
{
base.ReceiveActorOnInputTouchBegin_Implementation(FingerIndex);
base.ReceiveActorOnInputTouchBegin_Implementation(fingerIndex);
HandleControllerClick();
}

Expand All @@ -91,9 +86,9 @@ protected override void ReceiveActorEndCursorOver_Implementation()
/// </summary>
public void HandleControllerClick()
{
if (!isActive)
if (!_isActive)
{
isActive = true;
_isActive = true;
BlockMesh.SetMaterial(0, orangeMaterial.Value);
if (OwningGrid != null)
{
Expand All @@ -104,10 +99,10 @@ public void HandleControllerClick()

public void DoHighlight(bool on)
{
if (!isActive && isHighlighted != on)
if (!_isActive && _isHighlighted != on)
{
isHighlighted = on;
BlockMesh.SetMaterial(0, isHighlighted ? baseMaterial.Value : blueMaterial.Value);
_isHighlighted = on;
BlockMesh.SetMaterial(0, _isHighlighted ? baseMaterial.Value : blueMaterial.Value);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnrealEngine.Engine;
using UnrealEngine.Runtime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnrealEngine.Runtime;
using UnrealEngine.Engine;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnrealEngine.Engine;
using UnrealEngine.HeadMountedDisplay;
using UnrealEngine.Runtime;
Expand Down Expand Up @@ -68,9 +63,9 @@ protected override void SetupPlayerInputComponent(UInputComponent playerInputCom
playerInputComponent.BindAction("TriggerClick", EInputEvent.Pressed, OnTriggerClick);
}

protected override void ReceiveTick_Implementation(float DeltaSeconds)
protected override void ReceiveTick_Implementation(float deltaSeconds)
{
base.ReceiveTick_Implementation(DeltaSeconds);
base.ReceiveTick_Implementation(deltaSeconds);

// Determine which Puzzle Block the player is looking at and highlight it.
if (UHeadMountedDisplayFunctionLibrary.IsHeadMountedDisplayEnabled())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnrealEngine.Runtime;
using UnrealEngine.Engine;
using UnrealEngine.InputCore;

namespace TP_Puzzle
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,44 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(SolutionDir)\USharpProject.props" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{%USHARP_CSPROJ_GUID%}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>TP_Puzzle</RootNamespace>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFramework>netcoreapp3.0</TargetFramework>
<OutputPath>$(OutDir)</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>$(OutDir)</OutputPath>
<AssemblyName>TP_Puzzle.Managed</AssemblyName>
<ErrorReport>prompt</ErrorReport>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>$(OutDir)</OutputPath>
<AssemblyName>TP_Puzzle.Managed</AssemblyName>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="PuzzleBlock.cs" />
<Compile Include="PuzzleBlockGrid.cs" />
<Compile Include="PuzzlePlayerCharacter.cs" />
<Compile Include="PuzzlePlayerController.cs" />
<Compile Include="PuzzleGameMode.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
<Import Project="$(SolutionDir)\USharpProject.props" />
</Project>