-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<?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> | ||
<RootNamespace></RootNamespace> | ||
<ProjectGuid>{30FF7FBC-16A6-B8CA-7429-438E50CDFE23}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<AssemblyName>Assembly-CSharp</AssemblyName> | ||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<BaseDirectory>Assets</BaseDirectory> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>Temp\bin\Debug\</OutputPath> | ||
<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_0;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;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<NoWarn>0169</NoWarn> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>Temp\bin\Release\</OutputPath> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<NoWarn>0169</NoWarn> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.XML" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Runtime.Serialization" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="UnityEngine"> | ||
<HintPath>C:/Program Files/Unity/Editor/Data/Managed/UnityEngine.dll</HintPath> | ||
</Reference> | ||
<Reference Include="UnityEditor"> | ||
<HintPath>C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Assets\BarrelRotate.cs" /> | ||
<Compile Include="Assets\Bug.cs" /> | ||
<Compile Include="Assets\CameraMovement.cs" /> | ||
<Compile Include="Assets\Health.cs" /> | ||
<Compile Include="Assets\MacroButton.cs" /> | ||
<Compile Include="Assets\Placer.cs" /> | ||
<Compile Include="Assets\Projectile.cs" /> | ||
<Compile Include="Assets\Quitter.cs" /> | ||
<Compile Include="Assets\RocketRotate.cs" /> | ||
<Compile Include="Assets\Shoot.cs" /> | ||
<Compile Include="Assets\Spawner.cs" /> | ||
<Compile Include="Assets\Stats.cs" /> | ||
<Compile Include="Assets\TowerSelector.cs" /> | ||
<Compile Include="Assets\Waves.cs" /> | ||
<Reference Include="UnityEngine.UI"> | ||
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath> | ||
</Reference> | ||
<Reference Include="UnityEngine.Networking"> | ||
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath> | ||
</Reference> | ||
<Reference Include="UnityEngine.TestRunner"> | ||
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/TestRunner/UnityEngine.TestRunner.dll</HintPath> | ||
</Reference> | ||
<Reference Include="nunit.framework"> | ||
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/TestRunner/nunit.framework.dll</HintPath> | ||
</Reference> | ||
<Reference Include="UnityEngine.Analytics"> | ||
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll</HintPath> | ||
</Reference> | ||
<Reference Include="UnityEngine.HoloLens"> | ||
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll</HintPath> | ||
</Reference> | ||
<Reference Include="UnityEngine.VR"> | ||
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityVR/RuntimeEditor/UnityEngine.VR.dll</HintPath> | ||
</Reference> | ||
<Reference Include="UnityEditor.iOS.Extensions.Xcode"> | ||
<HintPath>C:/Program Files/Unity/Editor/Data/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath> | ||
</Reference> | ||
<Reference Include="UnityEditor.iOS.Extensions.Common"> | ||
<HintPath>C:/Program Files/Unity/Editor/Data/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Common.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class BarrelRotate : MonoBehaviour, Shoot.Event { | ||
|
||
// Use this for initialization | ||
void Start () { | ||
transform.parent.GetComponent<Shoot> ().shootEvent = this; | ||
} | ||
|
||
public void OnShoot() { | ||
transform.localEulerAngles += new Vector3 (0, 10, 0); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
|
||
public class Bug : MonoBehaviour { | ||
|
||
public float acceleration = 1; | ||
public float speed = 5; | ||
|
||
public Transform path; | ||
|
||
public int lifetime = 0; | ||
|
||
public Vector3 currentSpeed = new Vector3(); | ||
|
||
public bool demo = false; | ||
|
||
// Use this for initialization | ||
void Start () { | ||
|
||
} | ||
|
||
// Update is called once per frame | ||
void Update () { | ||
Vector3 delta = (path.position - transform.position); | ||
if (delta.sqrMagnitude > 0.1f) { | ||
transform.position += currentSpeed * Time.deltaTime; | ||
|
||
Vector3 wantedSpeed; | ||
|
||
if (acceleration / (2 * currentSpeed.magnitude) < currentSpeed.magnitude / delta.magnitude) { | ||
wantedSpeed = Vector3.zero; | ||
} else { | ||
wantedSpeed = delta.normalized * speed; | ||
} | ||
|
||
if (currentSpeed != wantedSpeed) { | ||
currentSpeed += (wantedSpeed - currentSpeed).normalized * acceleration * Time.deltaTime; | ||
} | ||
|
||
if (currentSpeed.sqrMagnitude > 0.1f) { | ||
transform.LookAt (transform.position + currentSpeed); | ||
} | ||
} else { | ||
transform.position = path.position; | ||
if (path.childCount > 0) { | ||
path = path.GetChild (0); | ||
} else { | ||
Destroy (gameObject); | ||
if(!demo) Stats.ChangeLife (-1); | ||
} | ||
} | ||
++lifetime; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
|
||
public class CameraMovement : MonoBehaviour { | ||
|
||
public float mouseThreshold = 0.3f; | ||
public float multiplier = 1; | ||
public float scrollMultiplier = 1; | ||
public float minimumY = 5; | ||
public float maximumY = 50; | ||
|
||
public float minX = -16; | ||
public float maxX = 16; | ||
public float minZ = -60; | ||
public float maxZ = 40; | ||
|
||
// Use this for initialization | ||
void Start () { | ||
|
||
} | ||
|
||
Vector2 currentSpeed = new Vector2(); | ||
|
||
void Update () { | ||
if ((gameObject.transform.position.y > minimumY || Input.mouseScrollDelta.y < 0) && | ||
(gameObject.transform.position.y < maximumY || Input.mouseScrollDelta.y > 0)) { | ||
gameObject.transform.position -= new Vector3 (0, Input.mouseScrollDelta.y * scrollMultiplier * Time.deltaTime, 0); | ||
} | ||
|
||
Vector3 mouseComp = Camera.main.ScreenToViewportPoint (Input.mousePosition); | ||
mouseComp -= new Vector3 (0.5f, 0.5f, 0); | ||
|
||
float totalMult = (multiplier * gameObject.transform.position.y) / (minimumY * mouseThreshold); | ||
|
||
Vector2 mouseSpeed = new Vector2(); | ||
if (mouseComp.y > mouseThreshold) { | ||
mouseSpeed.y = (mouseComp.y - mouseThreshold)* totalMult; | ||
} else if (mouseComp.y < -mouseThreshold) { | ||
mouseSpeed.y = (mouseComp.y + mouseThreshold)* totalMult; | ||
} | ||
if (mouseComp.x > mouseThreshold) { | ||
mouseSpeed.x = (mouseComp.x - mouseThreshold) * totalMult; | ||
} else if (mouseComp.x < -mouseThreshold) { | ||
mouseSpeed.x = (mouseComp.x + mouseThreshold) * totalMult; | ||
} | ||
|
||
if (!Input.GetMouseButton (2)) | ||
mouseSpeed = new Vector2(0, 0); | ||
|
||
currentSpeed += (mouseSpeed - currentSpeed) * 0.2f; | ||
|
||
gameObject.transform.localPosition += new Vector3 (currentSpeed.x, 0, currentSpeed.y) * Time.deltaTime; | ||
|
||
float x = gameObject.transform.localPosition.x; | ||
float z = gameObject.transform.localPosition.z; | ||
|
||
float aminx = minX * (maximumY / transform.position.y); | ||
float aminz = minZ;// * (maximumY / transform.position.y); | ||
float amaxx = maxX * (maximumY / transform.position.y); | ||
float amaxz = maxZ * (maximumY / transform.position.y); | ||
|
||
if (x < aminx) | ||
x = aminx; | ||
if (x > amaxx) | ||
x = amaxx; | ||
if (z < aminz) | ||
z = aminz; | ||
if (z > amaxz) | ||
z = amaxz; | ||
gameObject.transform.localPosition = new Vector3 (x, gameObject.transform.localPosition.y, z); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class Health : MonoBehaviour { | ||
|
||
public float maxHealth = 10; | ||
|
||
private float health; | ||
|
||
// Use this for initialization | ||
void Start () { | ||
health = maxHealth; | ||
} | ||
|
||
public void Change(float delta) { | ||
health += delta; | ||
if (health > maxHealth) { | ||
health = maxHealth; | ||
} | ||
if (health <= 0) { | ||
Stats.ChangeCurrency (Mathf.Clamp ((Random.Range (-2, 2) + maxHealth / 10), 1, Mathf.Infinity)); | ||
GameObject.Destroy (gameObject); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.SceneManagement; | ||
|
||
public class MacroButton : MonoBehaviour { | ||
|
||
// Use this for initialization | ||
void Start () { | ||
|
||
} | ||
|
||
// Update is called once per frame | ||
void Update () { | ||
|
||
} | ||
|
||
public void ToGame() { | ||
SceneManager.LoadScene ("game"); | ||
} | ||
|
||
public void ToMenu() { | ||
SceneManager.LoadScene ("menu"); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.