Commit f783813c authored by Paul Jervis's avatar Paul Jervis

Initial commit

parents
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
beepBeep
DebugTaskData.txt
# Unity3D generated meta files
*.pidb.meta
# Unity3D Generated File On Crash Reports
sysinfo.txt
# Builds
*.apk
*.unitypackage
\ No newline at end of file
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class GameManager : MonoBehaviour {
public Text ClickCount; // UI element in scene under Canvas.
public GameObject ClickButton; // Gameobject in scene under Canvas.
public bool UseRefillTimer; // Toggle in Inspector if used or not.
public GameObject scaleRefillBar; // Gameobject in scene under Canvas > Timer shows refill progress.
public float timeToRefill = 5;
private int clickTotal;
private float refillValue; // counter used to refill bar progress.
private bool refilling;
void Start()
{
// Activate button but once clicked disable until refilled.
ClickButton.SetActive(true);
if (!UseRefillTimer)
{
scaleRefillBar.SetActive(false);
}
}
private void Update()
{
if (refilling)
{
refillValue += Time.deltaTime;
scaleRefillBar.transform.localScale = new Vector3(refillValue/timeToRefill, 1, 1);
// Ir bar full is full, reactivate button.
if (refillValue >= timeToRefill)
{
refilling = false;
ClickButton.GetComponent<Button>().interactable = true;
}
}
}
// Fired from UI button.
public void Clicked()
{
// Increment and update UI.
clickTotal++;
ClickCount.text = string.Format("#CLICKS: {0}", clickTotal);
// If refilling activated then reset and trigger it.
if (UseRefillTimer)
{
// Disable button until refill finished.
ClickButton.GetComponent<Button>().interactable = false;
refillValue = 0;
refilling = true;
}
}
}
m_EditorVersion: 5.6.1p4
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.20506</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9A13C470-1D72-CB98-A56D-6FAF7B704DA6}</ProjectGuid>
<OutputType>Library</OutputType>
<AssemblyName>Assembly-CSharp</AssemblyName>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Unity Subset v3.5</TargetFrameworkProfile>
<CompilerResponseFile></CompilerResponseFile>
<UnityProjectType>Game:1</UnityProjectType>
<UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
<UnityVersion>5.6.1p4</UnityVersion>
<RootNamespace></RootNamespace>
<LangVersion Condition=" '$(VisualStudioVersion)' != '10.0' ">4</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>false</Optimize>
<OutputPath>Temp\UnityVS_bin\Debug\</OutputPath>
<IntermediateOutputPath>Temp\UnityVS_obj\Debug\</IntermediateOutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_5_6_1;UNITY_5_6;UNITY_5;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;INCLUDE_DYNAMIC_GI;INCLUDE_GI;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_SCRIPTING_NEW_CSHARP_COMPILER;ENABLE_VIDEO;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_2_0_SUBSET;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE</DefineConstants>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>false</Optimize>
<OutputPath>Temp\UnityVS_bin\Release\</OutputPath>
<IntermediateOutputPath>Temp\UnityVS_obj\Release\</IntermediateOutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_5_6_1;UNITY_5_6;UNITY_5;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;INCLUDE_DYNAMIC_GI;INCLUDE_GI;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_SCRIPTING_NEW_CSHARP_COMPILER;ENABLE_VIDEO;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_2_0_SUBSET;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE</DefineConstants>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.XML" />
<Reference Include="System.Core" />
<Reference Include="Boo.Lang" />
<Reference Include="UnityScript.Lang" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml.Linq" />
<Reference Include="UnityEngine">
<HintPath>Library\UnityAssemblies\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>Library\UnityAssemblies\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>Library\UnityAssemblies\UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TestRunner">
<HintPath>Library\UnityAssemblies\UnityEngine.TestRunner.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>Library\UnityAssemblies\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Analytics">
<HintPath>Library\UnityAssemblies\UnityEngine.Analytics.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.HoloLens">
<HintPath>Library\UnityAssemblies\UnityEngine.HoloLens.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.VR">
<HintPath>Library\UnityAssemblies\UnityEngine.VR.dll</HintPath>
</Reference>
<Reference Include="UnityEditor">
<HintPath>Library\UnityAssemblies\UnityEditor.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\GameManager.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="GenerateTargetFrameworkMonikerAttribute" />
</Project>

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2017
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YSJ_Clicker", "YSJ_Clicker.csproj", "{9A13C470-1D72-CB98-A56D-6FAF7B704DA6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9A13C470-1D72-CB98-A56D-6FAF7B704DA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9A13C470-1D72-CB98-A56D-6FAF7B704DA6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9A13C470-1D72-CB98-A56D-6FAF7B704DA6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9A13C470-1D72-CB98-A56D-6FAF7B704DA6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment