Repository: dgkanatsios/TowerDefense
Branch: master
Commit: f52cebbde3c8
Files: 115
Total size: 75.6 KB
Directory structure:
gitextract_n54cm9fx/
├── .gitattributes
├── .gitignore
├── Assets/
│ ├── Editor/
│ │ ├── LevelExport.cs
│ │ └── LevelExport.cs.meta
│ ├── Editor.meta
│ ├── Prefabs/
│ │ ├── Arrow.prefab
│ │ ├── Arrow.prefab.meta
│ │ ├── Bunny.prefab
│ │ ├── Bunny.prefab.meta
│ │ ├── Enemy.prefab
│ │ ├── Enemy.prefab.meta
│ │ ├── Path.prefab
│ │ ├── Path.prefab.meta
│ │ ├── RootGO.prefab
│ │ ├── RootGO.prefab.meta
│ │ ├── Tower.prefab
│ │ ├── Tower.prefab.meta
│ │ ├── carrot.prefab
│ │ └── carrot.prefab.meta
│ ├── Prefabs.meta
│ ├── Resources/
│ │ ├── Level1.xml
│ │ └── Level1.xml.meta
│ ├── Resources.meta
│ ├── Scenes/
│ │ ├── game.unity
│ │ └── game.unity.meta
│ ├── Scenes.meta
│ ├── Scripts/
│ │ ├── Arrow.cs
│ │ ├── Arrow.cs.meta
│ │ ├── AudioManager.cs
│ │ ├── AudioManager.cs.meta
│ │ ├── Bunny.cs
│ │ ├── Bunny.cs.meta
│ │ ├── Carrot.cs
│ │ ├── Carrot.cs.meta
│ │ ├── CarrotSpawner.cs
│ │ ├── CarrotSpawner.cs.meta
│ │ ├── Constants.cs
│ │ ├── Constants.cs.meta
│ │ ├── DragDropBunny.cs
│ │ ├── DragDropBunny.cs.meta
│ │ ├── Enemy.cs
│ │ ├── Enemy.cs.meta
│ │ ├── Enums.cs
│ │ ├── Enums.cs.meta
│ │ ├── GameManager.cs
│ │ ├── GameManager.cs.meta
│ │ ├── LevelStuffFromXML.cs
│ │ ├── LevelStuffFromXML.cs.meta
│ │ ├── ObjectPooler.cs
│ │ ├── ObjectPooler.cs.meta
│ │ ├── ObjectPoolerManager.cs
│ │ ├── ObjectPoolerManager.cs.meta
│ │ ├── OrderedWaypointForEditor.cs
│ │ ├── OrderedWaypointForEditor.cs.meta
│ │ ├── Utilities.cs
│ │ └── Utilities.cs.meta
│ ├── Scripts.meta
│ ├── Shaders/
│ │ ├── ColorTint.mat
│ │ ├── ColorTint.mat.meta
│ │ ├── ColorTint.shader
│ │ └── ColorTint.shader.meta
│ ├── Shaders.meta
│ ├── Sounds/
│ │ ├── 168567__psychentist__ratdeath.mp3.meta
│ │ └── 65734__erdie__bow02.wav.meta
│ ├── Sounds.meta
│ ├── Sprites/
│ │ ├── Badger/
│ │ │ ├── EnemyAnimation.anim
│ │ │ ├── EnemyAnimation.anim.meta
│ │ │ ├── badger_01.controller
│ │ │ ├── badger_01.controller.meta
│ │ │ ├── badger_01.png.meta
│ │ │ ├── badger_01@2x.png.meta
│ │ │ ├── badger_02.png.meta
│ │ │ ├── badger_02@2x.png.meta
│ │ │ ├── badger_03.png.meta
│ │ │ ├── badger_03@2x.png.meta
│ │ │ ├── badger_04.png.meta
│ │ │ └── badger_04@2x.png.meta
│ │ ├── Badger.meta
│ │ ├── Bunnies/
│ │ │ ├── BunnyAnimation.anim
│ │ │ ├── BunnyAnimation.anim.meta
│ │ │ ├── arrow.png.meta
│ │ │ ├── arrow@2x.png.meta
│ │ │ ├── bottom.png.meta
│ │ │ ├── bunny_1.controller
│ │ │ ├── bunny_1.controller.meta
│ │ │ ├── bunny_1.png.meta
│ │ │ ├── bunny_1@2x.png.meta
│ │ │ ├── bunny_2.png.meta
│ │ │ ├── bunny_2@2x.png.meta
│ │ │ ├── carrot.png.meta
│ │ │ ├── tower_bunnies.png.meta
│ │ │ └── tower_bunnies@2x.png.meta
│ │ ├── Bunnies.meta
│ │ ├── License.txt
│ │ ├── License.txt.meta
│ │ ├── Tiles/
│ │ │ ├── bg_tile.png.meta
│ │ │ ├── bg_tile@2x.png.meta
│ │ │ ├── tile_path_step.png.meta
│ │ │ └── tile_path_step@2x.png.meta
│ │ └── Tiles.meta
│ └── Sprites.meta
├── ProjectSettings/
│ ├── AudioManager.asset
│ ├── DynamicsManager.asset
│ ├── EditorBuildSettings.asset
│ ├── EditorSettings.asset
│ ├── GraphicsSettings.asset
│ ├── InputManager.asset
│ ├── NavMeshLayers.asset
│ ├── NetworkManager.asset
│ ├── Physics2DSettings.asset
│ ├── ProjectSettings.asset
│ ├── QualitySettings.asset
│ ├── TagManager.asset
│ └── TimeManager.asset
└── README.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
================================================
FILE: .gitignore
================================================
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
# Autogenerated VS/MD solution and project files
/*.csproj
/*.unityproj
/*.sln
/*.suo
/*.user
/*.userprefs
/*.pidb
/*.booproj
# =========================
# Operating System Files
# =========================
# OSX
# =========================
.DS_Store
.AppleDouble
.LSOverride
# Icon must ends with two \r.
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Windows
# =========================
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
================================================
FILE: Assets/Editor/LevelExport.cs
================================================
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.IO;
using System.Xml.Linq;
using Assets.Scripts;
using System.Collections.Generic;
using System.Linq;
public class LevelExport : EditorWindow
{
[MenuItem("Custom Editor/Export Level")]
public static void ShowWindow()
{
EditorWindow.GetWindow(typeof(LevelExport));
}
Vector2 scrollPosition = Vector2.zero;
int noOfEnemies;
int initialMoney;
int MinCarrotSpawnTime, MaxCarrotSpawnTime;
string filename = "LevelX.xml";
int waypointsCount;
int pathsCount;
void OnGUI()
{
scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
EditorGUILayout.LabelField("Total Rounds created:" + rounds.Count);
for (int i = 0; i < rounds.Count; i++)
{
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField("Round " + (i + 1));
EditorGUILayout.LabelField("Number of Enemies " + rounds[i].NoOfEnemies);
if (GUILayout.Button("Delete"))
{
rounds.RemoveAt(i);
}
EditorGUILayout.EndHorizontal();
}
EditorGUILayout.EndScrollView();
EditorGUILayout.LabelField("Add a new round", EditorStyles.boldLabel);
noOfEnemies = EditorGUILayout.IntSlider("Number of enemies", noOfEnemies, 1, 20);
if (GUILayout.Button("Add new round"))
{
rounds.Add(new Round() { NoOfEnemies = noOfEnemies });
}
initialMoney = EditorGUILayout.IntSlider("Initial Money", initialMoney, 200, 400);
MinCarrotSpawnTime = EditorGUILayout.IntSlider("MinCarrotSpawnTime", MinCarrotSpawnTime, 1, 10);
MaxCarrotSpawnTime = EditorGUILayout.IntSlider("MaxCarrotSpawnTime", MaxCarrotSpawnTime, 1, 10);
filename = EditorGUILayout.TextField("Filename:", filename);
EditorGUILayout.LabelField("Export Level", EditorStyles.boldLabel);
if (GUILayout.Button("Export"))
{
Export();
}
}
XDocument doc;
List<Round> rounds = new List<Round>();
// The export method
void Export()
{
// Create a new output file stream
doc = new XDocument();
doc.Add(new XElement("Elements"));
XElement elements = doc.Element("Elements");
XElement pathPiecesXML = new XElement("PathPieces");
var paths = GameObject.FindGameObjectsWithTag("Path");
foreach (var item in paths)
{
XElement path = new XElement("Path");
XAttribute attrX = new XAttribute("X", item.transform.position.x);
XAttribute attrY = new XAttribute("Y", item.transform.position.y);
path.Add(attrX, attrY);
pathPiecesXML.Add(path);
}
pathsCount = paths.Length;
elements.Add(pathPiecesXML);
XElement waypointsXML = new XElement("Waypoints");
var waypoints = GameObject.FindGameObjectsWithTag("Waypoint");
if (!WaypointsAreValid(waypoints))
{
return;
}
//order by user selected order
waypoints = waypoints.OrderBy(x => x.GetComponent<OrderedWaypointForEditor>().Order).ToArray();
foreach (var item in waypoints)
{
XElement waypoint = new XElement("Waypoint");
XAttribute attrX = new XAttribute("X", item.transform.position.x);
XAttribute attrY = new XAttribute("Y", item.transform.position.y);
waypoint.Add(attrX, attrY);
waypointsXML.Add(waypoint);
}
waypointsCount = waypoints.Length;
elements.Add(waypointsXML);
XElement roundsXML = new XElement("Rounds");
foreach (var item in rounds)
{
XElement round = new XElement("Round");
XAttribute NoOfEnemies = new XAttribute("NoOfEnemies", item.NoOfEnemies);
round.Add(NoOfEnemies);
roundsXML.Add(round);
}
elements.Add(roundsXML);
XElement towerXML = new XElement("Tower");
var tower = GameObject.FindGameObjectWithTag("Tower");
if(tower == null)
{
ShowErrorForNull("Tower");
return;
}
XAttribute towerX = new XAttribute("X", tower.transform.position.x);
XAttribute towerY = new XAttribute("Y", tower.transform.position.y);
towerXML.Add(towerX, towerY);
elements.Add(towerXML);
XElement otherStuffXML = new XElement("OtherStuff");
otherStuffXML.Add(new XAttribute("InitialMoney", initialMoney));
otherStuffXML.Add(new XAttribute("MinCarrotSpawnTime", MinCarrotSpawnTime));
otherStuffXML.Add(new XAttribute("MaxCarrotSpawnTime", MaxCarrotSpawnTime));
elements.Add(otherStuffXML);
if (!InputIsValid())
return;
if (EditorUtility.DisplayDialog("Save confirmation",
"Are you sure you want to save level " + filename +"?", "OK", "Cancel"))
{
doc.Save("Assets/" + filename);
EditorUtility.DisplayDialog("Saved", filename + " saved!", "OK");
}
else
{
EditorUtility.DisplayDialog("NOT Saved", filename + " not saved!", "OK");
}
}
private bool WaypointsAreValid(GameObject[] waypoints)
{
//first check whether whey all have a OrderedWaypoint component
if (!waypoints.All(x => x.GetComponent<OrderedWaypointForEditor>() != null))
{
EditorUtility.DisplayDialog("Error", "All waypoints must have an ordered waypoint component", "OK");
return false;
}
//check if all Order fields on the orderwaypoint components are different
if (waypoints.Count() != waypoints.Select(x=>x.GetComponent<OrderedWaypointForEditor>().Order).Distinct().Count())
{
EditorUtility.DisplayDialog("Error", "All waypoints must have a different order", "OK");
return false;
}
return true;
}
private void ShowErrorForNull(string gameObjectName)
{
EditorUtility.DisplayDialog("Error", "Cannot find gameobject " + gameObjectName, "OK");
}
private bool InputIsValid()
{
if (MinCarrotSpawnTime > MaxCarrotSpawnTime)
{
EditorUtility.DisplayDialog("Error", "MinCarrotSpawnTime must be less or equal "
+ " to MaxCarrotSpawnTime", "OK");
return false;
}
if (rounds.Count == 0)
{
EditorUtility.DisplayDialog("Error", "You cannot have 0 rounds", "OK");
return false;
}
if (waypointsCount == 0)
{
EditorUtility.DisplayDialog("Error", "You cannot have 0 waypoints", "OK");
return false;
}
if (pathsCount == 0)
{
EditorUtility.DisplayDialog("Error", "You cannot have 0 paths", "OK");
return false;
}
return true;
}
}
================================================
FILE: Assets/Editor/LevelExport.cs.meta
================================================
fileFormatVersion: 2
guid: 9a1f98525123ab0448bcd52794183e29
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
================================================
FILE: Assets/Editor.meta
================================================
fileFormatVersion: 2
guid: 0ec61eb9e3c0b01418f1349ad01afec7
folderAsset: yes
DefaultImporter:
userData:
================================================
FILE: Assets/Prefabs/Arrow.prefab.meta
================================================
fileFormatVersion: 2
guid: f19afcd826e89cb488afdd3215cc2f64
NativeFormatImporter:
userData:
================================================
FILE: Assets/Prefabs/Bunny.prefab.meta
================================================
fileFormatVersion: 2
guid: 2432be9b4f27c07418472db59ada6820
NativeFormatImporter:
userData:
================================================
FILE: Assets/Prefabs/Enemy.prefab.meta
================================================
fileFormatVersion: 2
guid: a84d866c941de9c4f8466adb84ab6371
NativeFormatImporter:
userData:
================================================
FILE: Assets/Prefabs/Path.prefab.meta
================================================
fileFormatVersion: 2
guid: b1e0f8e16e04e3a48ab9865c613b0a8d
NativeFormatImporter:
userData:
================================================
FILE: Assets/Prefabs/RootGO.prefab.meta
================================================
fileFormatVersion: 2
guid: 672ec9dc8634232488dc5b57ae3b541f
NativeFormatImporter:
userData:
================================================
FILE: Assets/Prefabs/Tower.prefab.meta
================================================
fileFormatVersion: 2
guid: 72b25f8bade59464daa9a3b36a4a0f04
NativeFormatImporter:
userData:
================================================
FILE: Assets/Prefabs/carrot.prefab.meta
================================================
fileFormatVersion: 2
guid: 72926e40b231c84498bdcebbf5ec8d81
NativeFormatImporter:
userData:
================================================
FILE: Assets/Prefabs.meta
================================================
fileFormatVersion: 2
guid: 787b4919f33dbac4fb854100a24852e5
folderAsset: yes
DefaultImporter:
userData:
================================================
FILE: Assets/Resources/Level1.xml
================================================
<?xml version="1.0" encoding="utf-8" ?>
<Elements>
<PathPieces>
<Path X="-1.30081642" Y="1.43285584" />
<Path X="-2.30081654" Y="1.43285584" />
<Path X="-3.30081654" Y="1.47059512" />
<Path X="-0.300816417" Y="-0.5671437" />
<Path X="0.6992016" Y="-0.5671451" />
<Path X="-1.30081642" Y="-0.5671439" />
<Path X="-2.30081654" Y="-0.5671439" />
<Path X="-3.30081654" Y="-0.5671439" />
<Path X="4.699178" Y="-4.56714344" />
<Path X="3.69918251" Y="-4.56714344" />
<Path X="5.699173" Y="-4.56714344" />
<Path X="6.69917536" Y="-4.56714344" />
<Path X="7.6991663" Y="-4.56714344" />
<Path X="8.699181" Y="-4.56714344" />
<Path X="9.699175" Y="-4.56714344" />
<Path X="2.69918823" Y="-2.56714845" />
<Path X="3.69917679" Y="-2.56714845" />
<Path X="1.69918823" Y="-2.56714845" />
<Path X="1.699192" Y="-3.56714559" />
<Path X="1.69918823" Y="-4.56714344" />
<Path X="1.69918823" Y="-0.5671432" />
<Path X="6.6991663" Y="-1.567147" />
<Path X="2.69918823" Y="-4.56714344" />
<Path X="2.69918823" Y="-0.5671432" />
<Path X="3.69917679" Y="-0.5671432" />
<Path X="4.69918442" Y="-0.5671432" />
<Path X="5.69918251" Y="-0.5671451" />
<Path X="6.69918156" Y="-0.5671432" />
<Path X="6.699174" Y="-2.56714845" />
<Path X="5.69918251" Y="-2.56714845" />
<Path X="4.699188" Y="1.432855" />
<Path X="3.699192" Y="1.432855" />
<Path X="2.69919968" Y="1.432855" />
<Path X="1.699192" Y="1.432855" />
<Path X="0.699192047" Y="1.432855" />
<Path X="-4.30081654" Y="1.47059512" />
<Path X="-4.30081654" Y="0.432856083" />
<Path X="4.69918251" Y="-2.56714845" />
<Path X="-4.30081654" Y="-0.5671439" />
<Path X="-0.300816417" Y="1.43285584" />
<Path X="3.699171" Y="4.432855" />
<Path X="4.6991787" Y="4.432855" />
<Path X="5.699171" Y="4.432855" />
<Path X="6.69916248" Y="4.432855" />
<Path X="7.69917774" Y="4.432855" />
<Path X="7.69917" Y="3.432859" />
<Path X="7.6991663" Y="2.43286085" />
<Path X="7.69918156" Y="1.432855" />
<Path X="6.69918537" Y="1.432855" />
<Path X="5.699171" Y="1.432855" />
<Path X="-5.290001" Y="4.44432974" />
<Path X="-4.30081558" Y="4.432855" />
<Path X="-3.30081558" Y="4.432855" />
<Path X="-2.30081558" Y="4.432855" />
<Path X="-1.30081546" Y="4.432855" />
<Path X="-0.300815582" Y="4.432855" />
<Path X="0.6991844" Y="4.432855" />
<Path X="1.6991806" Y="4.432855" />
<Path X="2.6991787" Y="4.432855" />
<Path X="-6.290001" Y="4.44432974" />
</PathPieces>
<Waypoints>
<Waypoint X="11.2078037" Y="-4.519046" />
<Waypoint X="1.741848" Y="-4.519046" />
<Waypoint X="1.741848" Y="-2.55718851" />
<Waypoint X="6.69554234" Y="-2.55718851" />
<Waypoint X="6.69554234" Y="-0.5462837" />
<Waypoint X="-4.241806" Y="-0.5462837" />
<Waypoint X="-4.241806" Y="1.51366663" />
<Waypoint X="7.725524" Y="1.51366663" />
<Waypoint X="7.725524" Y="4.45645332" />
<Waypoint X="-7.28267574" Y="4.45645332" />
</Waypoints>
<Tower X="-7.37928" Y="4.42552137" />
<Rounds>
<Round NoOfEnemies="2" />
<Round NoOfEnemies="2" />
<Round NoOfEnemies="4" />
<Round NoOfEnemies="4" />
<Round NoOfEnemies="6" />
<Round NoOfEnemies="6" />
<Round NoOfEnemies="8" />
<Round NoOfEnemies="8" />
<Round NoOfEnemies="10" />
<Round NoOfEnemies="12" />
</Rounds>
<OtherStuff InitialMoney ="200" MinCarrotSpawnTime="1" MaxCarrotSpawnTime="3" />
</Elements>
================================================
FILE: Assets/Resources/Level1.xml.meta
================================================
fileFormatVersion: 2
guid: 111b176d9751b244f9766267f11fc925
TextScriptImporter:
userData:
================================================
FILE: Assets/Resources.meta
================================================
fileFormatVersion: 2
guid: 027bff34dfdf63540b766acb3fa45a4b
folderAsset: yes
DefaultImporter:
userData:
================================================
FILE: Assets/Scenes/game.unity.meta
================================================
fileFormatVersion: 2
guid: 8048a33abbc13eb42b049b36a2c26c4a
DefaultImporter:
userData:
================================================
FILE: Assets/Scenes.meta
================================================
fileFormatVersion: 2
guid: 46411d2a8f3579c40b74596148184941
folderAsset: yes
DefaultImporter:
userData:
================================================
FILE: Assets/Scripts/Arrow.cs
================================================
using UnityEngine;
using System.Collections;
public class Arrow : MonoBehaviour {
// Use this for initialization
void Start () {
//disable it after 5 seconds, whatever happens
Invoke("Disable", 5f);
}
public void Disable()
{
//if we are called from another gameobject,
//cancel the timed invoke
CancelInvoke();
//since we're pooling it, make it inactive instead of destroying it
this.gameObject.SetActive(false);
}
}
================================================
FILE: Assets/Scripts/Arrow.cs.meta
================================================
fileFormatVersion: 2
guid: 3efa080e0e608b44f8797ac518170b84
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
================================================
FILE: Assets/Scripts/AudioManager.cs
================================================
using UnityEngine;
using System.Collections;
public class AudioManager : MonoBehaviour {
public AudioClip ArrowAudioClip, DeathSoundAudioClip;
/// <summary>
/// Basic singleton implementation
/// </summary>
public static AudioManager Instance { get; private set; }
void Awake()
{
Instance = this;
}
public void PlayArrowSound()
{
StartCoroutine(PlaySound(ArrowAudioClip));
}
public void PlayDeathSound()
{
StartCoroutine(PlaySound(DeathSoundAudioClip));
}
//coroutine is used since we also want to deactivate it after the sound is played
private IEnumerator PlaySound(AudioClip clip)
{
//get an object from the pooler, activate it, play the sound
//wait for sound completion and then deactivate the object
GameObject go = ObjectPoolerManager.Instance.AudioPooler.GetPooledObject();
go.SetActive(true);
go.GetComponent<AudioSource>().PlayOneShot(clip);
yield return new WaitForSeconds(clip.length);
go.SetActive(false);
}
}
================================================
FILE: Assets/Scripts/AudioManager.cs.meta
================================================
fileFormatVersion: 2
guid: b76483430df840a4fa28c360640f3991
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
================================================
FILE: Assets/Scripts/Bunny.cs
================================================
using UnityEngine;
using System.Collections;
using System.Linq;
using Assets.Scripts;
public class Bunny : MonoBehaviour
{
//arrow sound found here
//https://www.freesound.org/people/Erdie/sounds/65734/
public Transform ArrowSpawnPosition;
public GameObject ArrowPrefab;
public float ShootWaitTime = 2f;
private float LastShootTime = 0f;
GameObject targetedEnemy;
private float InitialArrowForce = 500f;
// Use this for initialization
void Start()
{
State = BunnyState.Inactive;
//find where we're shooting from
ArrowSpawnPosition = transform.FindChild("ArrowSpawnPosition");
}
// Update is called once per frame
void Update()
{
//if we're in the last round and we've killed all enemies, do nothing
if (GameManager.Instance.FinalRoundFinished &&
GameManager.Instance.Enemies.Where(x => x != null).Count() == 0)
State = BunnyState.Inactive;
//searching for an enemy
if (State == BunnyState.Searching)
{
if (GameManager.Instance.Enemies.Where(x => x != null).Count() == 0) return;
//find the closest enemy
//aggregate method proposed here
//http://unitygems.com/linq-1-time-linq/
targetedEnemy = GameManager.Instance.Enemies.Where(x => x != null)
.Aggregate((current, next) => Vector2.Distance(current.transform.position, transform.position)
< Vector2.Distance(next.transform.position, transform.position)
? current : next);
//if there is an enemy and is close to us, target it
if (targetedEnemy != null && targetedEnemy.activeSelf
&& Vector3.Distance(transform.position, targetedEnemy.transform.position)
< Constants.MinDistanceForBunnyToShoot)
{
State = BunnyState.Targeting;
}
}
else if (State == BunnyState.Targeting)
{
//if the targeted enemy is still close to us, look at it and shoot!
if (targetedEnemy != null
&& Vector3.Distance(transform.position, targetedEnemy.transform.position)
< Constants.MinDistanceForBunnyToShoot)
{
LookAndShoot();
}
else //enemy has left our shooting range, so look for another one
{
State = BunnyState.Searching;
}
}
}
private void LookAndShoot()
{
//look at the enemy
Quaternion diffRotation = Quaternion.LookRotation
(transform.position - targetedEnemy.transform.position, Vector3.forward);
transform.rotation = Quaternion.RotateTowards
(transform.rotation, diffRotation, Time.deltaTime * 2000);
transform.eulerAngles = new Vector3(0, 0, transform.eulerAngles.z);
//make sure we're almost looking at the enemy before start shooting
Vector2 direction = targetedEnemy.transform.position - transform.position;
float axisDif = Vector2.Angle(transform.up, direction);
//shoot only if we have 20 degrees rotation difference to the enemy
if (axisDif <= 20f)
{
if (Time.time - LastShootTime > ShootWaitTime)
{
Shoot(direction);
LastShootTime = Time.time;
}
}
}
private void Shoot(Vector2 dir)
{
//if the enemy is still close to us
if (targetedEnemy != null && targetedEnemy.activeSelf
&& Vector3.Distance(transform.position, targetedEnemy.transform.position)
< Constants.MinDistanceForBunnyToShoot)
{
//create a new arrow
GameObject go = ObjectPoolerManager.Instance.ArrowPooler.GetPooledObject();
go.transform.position = ArrowSpawnPosition.position;
go.transform.rotation = transform.rotation;
go.SetActive(true);
//SHOOT IT!
go.GetComponent<Rigidbody2D>().AddForce(dir * InitialArrowForce);
AudioManager.Instance.PlayArrowSound();
}
else//find another enemy
{
State = BunnyState.Searching;
}
}
private BunnyState State;
public void Activate()
{
State = BunnyState.Searching;
}
}
================================================
FILE: Assets/Scripts/Bunny.cs.meta
================================================
fileFormatVersion: 2
guid: 709dea957d3aa334d925137e1c5adea3
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
================================================
FILE: Assets/Scripts/Carrot.cs
================================================
using UnityEngine;
using System.Collections;
using Assets.Scripts;
public class Carrot : MonoBehaviour
{
//carrot sprite found in http://opengameart.org/content/easter-carrot-pick-up-item
Camera mainCamera;
// Use this for initialization
void Start()
{
mainCamera = Camera.main;
}
// Update is called once per frame
void Update()
{
transform.position = new Vector3(
transform.position.x,
transform.position.y - Time.deltaTime * FallSpeed,
transform.position.z);
transform.Rotate(0, 0, Time.deltaTime * 10);
if (Input.GetMouseButtonDown(0))
{
//check if the user tap/click touches the carrot
Vector2 location = mainCamera.ScreenToWorldPoint(Input.mousePosition);
if (this.GetComponent<BoxCollider2D>() == Physics2D.OverlapPoint(location,
1 << LayerMask.NameToLayer("Carrot")))
{
//increase player money
GameManager.Instance.AlterMoneyAvailable(Constants.CarrotAward);
//destroy carrot
Destroy(this.gameObject);
}
}
}
public float FallSpeed = 1;
}
================================================
FILE: Assets/Scripts/Carrot.cs.meta
================================================
fileFormatVersion: 2
guid: 3bae68fd5da19fb4282e7ea8bb942abf
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
================================================
FILE: Assets/Scripts/CarrotSpawner.cs
================================================
using UnityEngine;
using System.Collections;
public class CarrotSpawner : MonoBehaviour {
/// <summary>
/// Carrot prefab
/// </summary>
public GameObject Carrot;
public void StartCarrotSpawning()
{
StartCoroutine(SpawnCarrots());
}
public void StopCarrotSpawning()
{
StopAllCoroutines();
}
private IEnumerator SpawnCarrots()
{
while (true)
{
//select a random position
float X = Random.Range(100, Screen.width - 100);
Vector3 randomPosition = Camera.main.ScreenToWorldPoint(new Vector3(X, 0, 0));
//create and drop a carrot
GameObject carrot = Instantiate(Carrot,
new Vector3(randomPosition.x, transform.position.y, transform.position.z),
Quaternion.identity) as GameObject;
carrot.GetComponent<Carrot>().FallSpeed = Random.Range(1f, 3f);
//wait for random seconds, based on level parameters
yield return new WaitForSeconds
(Random.Range(GameManager.Instance.MinCarrotSpawnTime,
GameManager.Instance.MaxCarrotSpawnTime));
}
}
}
================================================
FILE: Assets/Scripts/CarrotSpawner.cs.meta
================================================
fileFormatVersion: 2
guid: 5b9bb9fb6b842624db44df45e2f9add1
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
================================================
FILE: Assets/Scripts/Constants.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace Assets.Scripts
{
/// <summary>
/// Constant helper variables
/// </summary>
public static class Constants
{
public static readonly Color RedColor = new Color(1f, 0f, 0f, 0f);
public static readonly Color BlackColor = new Color(0f, 0f, 0f, 0f);
public static readonly int BunnyCost = 50;
public static readonly int CarrotAward = 10;
public static readonly int InitialEnemyHealth = 50;
public static readonly int ArrowDamage = 20;
public static readonly float MinDistanceForBunnyToShoot = 3f;
}
}
================================================
FILE: Assets/Scripts/Constants.cs.meta
================================================
fileFormatVersion: 2
guid: e8abcfc6062ce5f4a857ac7393af9e6a
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
================================================
FILE: Assets/Scripts/DragDropBunny.cs
================================================
using UnityEngine;
using System.Collections;
using System.Linq;
using Assets.Scripts;
/// <summary>
/// Drag and drop mechanism
/// </summary>
public class DragDropBunny : MonoBehaviour
{
// Use this for initialization
void Start()
{
mainCamera = Camera.main;
}
private Camera mainCamera;
//type of bunnies we'll create
public GameObject BunnyPrefab;
//the starting object for the drag
public GameObject BunnyGenerator;
bool isDragging = false;
//temp bunny
private GameObject newBunny;
//will be colored red if we cannot place a bunny there
private GameObject tempBackgroundBehindPath;
// Update is called once per frame
void Update()
{
//if we have money and we can drag a new bunny
if (Input.GetMouseButtonDown(0) && !isDragging &&
GameManager.Instance.MoneyAvailable >= Constants.BunnyCost)
{
ResetTempBackgroundColor();
Vector2 location = mainCamera.ScreenToWorldPoint(Input.mousePosition);
//if user has tapped onto the bunny generator
if (BunnyGenerator.GetComponent<CircleCollider2D>() ==
Physics2D.OverlapPoint(location, 1 << LayerMask.NameToLayer("BunnyGenerator")))
{
//initiate dragging operation and create a new bunny for us to drag
isDragging = true;
//create a temp bunny to drag around
newBunny = Instantiate(BunnyPrefab, BunnyGenerator.transform.position, Quaternion.identity)
as GameObject;
}
}
else if (Input.GetMouseButton(0) && isDragging)
{
Ray ray = mainCamera.ScreenPointToRay(Input.mousePosition);
RaycastHit2D[] hits = Physics2D.RaycastAll(ray.origin, ray.direction);
if (hits.Length > 0 && hits[0].collider != null)
{
newBunny.transform.position = hits[0].collider.gameObject.transform.position;
//if we're hitting a path or tower
//or there is an existing bunny there
//we use > 1 since we're hovering over the newBunny gameobject
//(i.e. there is already a bunny there)
if (hits.Where(x => x.collider.gameObject.tag == "Path"
|| x.collider.gameObject.tag == "Tower").Count() > 0
|| hits.Where(x=>x.collider.gameObject.tag == "Bunny").Count() > 1)
{
//we cannot place a bunny there
GameObject backgroundBehindPath = hits.Where
(x => x.collider.gameObject.tag == "Background").First().collider.gameObject;
//make the sprite material "more red"
//to let the user know that we can't place a bunny here
backgroundBehindPath.GetComponent<SpriteRenderer>().color = Constants.RedColor;
if (tempBackgroundBehindPath != backgroundBehindPath)
ResetTempBackgroundColor();
//cache it to revert later
tempBackgroundBehindPath = backgroundBehindPath;
}
else //just reset the color on previously set paths
{
ResetTempBackgroundColor();
}
}
}
//we're stopping dragging
else if (Input.GetMouseButtonUp(0) && isDragging)
{
ResetTempBackgroundColor();
//check if we can leave the bunny here
Ray ray = mainCamera.ScreenPointToRay(Input.mousePosition);
RaycastHit2D[] hits = Physics2D.RaycastAll(ray.origin, ray.direction,
Mathf.Infinity, ~(1 << LayerMask.NameToLayer("BunnyGenerator")));
//in order to place it, we must have a background and no other bunnies
if (hits.Where(x=>x.collider.gameObject.tag == "Background").Count() > 0
&& hits.Where(x => x.collider.gameObject.tag == "Path").Count() == 0
&& hits.Where(x=>x.collider.gameObject.tag == "Bunny").Count() == 1)
{
//we can leave a bunny here, so decrease money and activate it
GameManager.Instance.AlterMoneyAvailable(-Constants.BunnyCost);
newBunny.transform.position =
hits.Where(x => x.collider.gameObject.tag == "Background")
.First().collider.gameObject.transform.position;
newBunny.GetComponent<Bunny>().Activate();
}
else
{
//we can't leave a bunny here, so destroy the temp one
Destroy(newBunny);
}
isDragging = false;
}
}
//make background sprite appear as it is
private void ResetTempBackgroundColor()
{
if (tempBackgroundBehindPath != null)
tempBackgroundBehindPath.GetComponent<SpriteRenderer>().color = Constants.BlackColor;
}
}
================================================
FILE: Assets/Scripts/DragDropBunny.cs.meta
================================================
fileFormatVersion: 2
guid: dc48c92ee473e39499456b4328dde1ac
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
================================================
FILE: Assets/Scripts/Enemy.cs
================================================
using UnityEngine;
using System.Collections;
using Assets.Scripts;
using System;
public class Enemy : MonoBehaviour
{
//death sound found here
//https://www.freesound.org/people/psychentist/sounds/168567/
public int Health;
int nextWaypointIndex = 0;
public float Speed = 1f;
// Use this for initialization
void Start()
{
Health = Constants.InitialEnemyHealth;
}
// Update is called once per frame
void Update()
{
//calculate the distance between current position
//and the target waypoint
if (Vector2.Distance(transform.position,
GameManager.Instance.Waypoints[nextWaypointIndex].position) < 0.01f)
{
//is this waypoint the last one?
if (nextWaypointIndex == GameManager.Instance.Waypoints.Length - 1)
{
RemoveAndDestroy();
GameManager.Instance.Lives--;
}
else
{
//our enemy will go to the next waypoint
nextWaypointIndex++;
//our simple AI, enemy is looking at the next waypoint
transform.LookAt(GameManager.Instance.Waypoints[nextWaypointIndex].position,
-Vector3.forward);
//only in the z axis
transform.eulerAngles = new Vector3(0, 0, transform.eulerAngles.z);
}
}
//enemy is moved towards the next waypoint
transform.position = Vector2.MoveTowards(transform.position,
GameManager.Instance.Waypoints[nextWaypointIndex].position,
Time.deltaTime * Speed);
}
void OnCollisionEnter2D(Collision2D col)
{
if (col.gameObject.tag == "Arrow")
{//if we're hit by an arrow
if (Health > 0)
{
//decrease enemy health
Health -= Constants.ArrowDamage;
if (Health <= 0)
{
RemoveAndDestroy();
}
}
col.gameObject.GetComponent<Arrow>().Disable(); //disable the arrow
}
}
public event EventHandler EnemyKilled;
void RemoveAndDestroy()
{
AudioManager.Instance.PlayDeathSound();
//remove it from the enemy list
GameManager.Instance.Enemies.Remove(this.gameObject);
Destroy(this.gameObject);
//notify interested parties that we died
if (EnemyKilled != null)
EnemyKilled(this, EventArgs.Empty);
}
}
================================================
FILE: Assets/Scripts/Enemy.cs.meta
================================================
fileFormatVersion: 2
guid: afc9dcbac1e688c4384857ea0f44e5b9
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
================================================
FILE: Assets/Scripts/Enums.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Assets.Scripts
{
public enum BunnyState
{
Inactive,
Searching,
Targeting
}
public enum GameState
{
Start,
Playing,
Won,
Lost
}
}
================================================
FILE: Assets/Scripts/Enums.cs.meta
================================================
fileFormatVersion: 2
guid: 28a214e46c3781448abaea3be81ab638
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
================================================
FILE: Assets/Scripts/GameManager.cs
================================================
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
using Assets.Scripts;
using System.Collections;
using System;
public class GameManager : MonoBehaviour
{
//basic singleton implementation
[HideInInspector]
public static GameManager Instance { get; private set; }
void Awake()
{
Instance = this;
}
//sprites can be found here:
//http://www.gameartguppy.com/shop/top-tower-defense-bunny-badgers-game-art-set/
//enemies on screen
public List<GameObject> Enemies;
//prefabs
public GameObject EnemyPrefab;
public GameObject PathPrefab;
public GameObject TowerPrefab;
//list of waypoints in the current level
public Transform[] Waypoints;
private GameObject PathPiecesParent;
private GameObject WaypointsParent;
//file pulled from resources
private LevelStuffFromXML levelStuffFromXML;
//will spawn carrots on screen
public CarrotSpawner CarrotSpawner;
//helpful variables for our player
[HideInInspector]
public int MoneyAvailable { get; private set; }
[HideInInspector]
public float MinCarrotSpawnTime;
[HideInInspector]
public float MaxCarrotSpawnTime;
public int Lives = 10;
private int currentRoundIndex = 0;
[HideInInspector]
public GameState CurrentGameState;
public SpriteRenderer BunnyGeneratorSprite;
[HideInInspector]
public bool FinalRoundFinished;
public GUIText infoText;
private object lockerObject = new object();
// Use this for initialization
void Start()
{
IgnoreLayerCollisions();
Enemies = new List<GameObject>();
PathPiecesParent = GameObject.Find("PathPieces");
WaypointsParent = GameObject.Find("Waypoints");
levelStuffFromXML = Utilities.ReadXMLFile();
CreateLevelFromXML();
CurrentGameState = GameState.Start;
FinalRoundFinished = false;
}
/// <summary>
/// Will create necessary stuff from the object that has the XML stuff
/// </summary>
private void CreateLevelFromXML()
{
foreach (var position in levelStuffFromXML.Paths)
{
GameObject go = Instantiate(PathPrefab, position,
Quaternion.identity) as GameObject;
go.GetComponent<SpriteRenderer>().sortingLayerName = "Path";
go.transform.parent = PathPiecesParent.transform;
}
for (int i = 0; i < levelStuffFromXML.Waypoints.Count; i++)
{
GameObject go = new GameObject();
go.transform.position = levelStuffFromXML.Waypoints[i];
go.transform.parent = WaypointsParent.transform;
go.tag = "Waypoint";
go.name = "Waypoints" + i.ToString();
}
GameObject tower = Instantiate(TowerPrefab, levelStuffFromXML.Tower,
Quaternion.identity) as GameObject;
tower.GetComponent<SpriteRenderer>().sortingLayerName = "Foreground";
Waypoints = GameObject.FindGameObjectsWithTag("Waypoint")
.OrderBy(x => x.name).Select(x => x.transform).ToArray();
MoneyAvailable = levelStuffFromXML.InitialMoney;
MinCarrotSpawnTime = levelStuffFromXML.MinCarrotSpawnTime;
MaxCarrotSpawnTime = levelStuffFromXML.MaxCarrotSpawnTime;
}
/// <summary>
/// Will make the arrow collide only with enemies!
/// </summary>
private void IgnoreLayerCollisions()
{
int bunnyLayerID = LayerMask.NameToLayer("Bunny");
int enemyLayerID = LayerMask.NameToLayer("Enemy");
int arrowLayerID = LayerMask.NameToLayer("Arrow");
int bunnyGeneratorLayerID = LayerMask.NameToLayer("BunnyGenerator");
int backgroundLayerID = LayerMask.NameToLayer("Background");
int pathLayerID = LayerMask.NameToLayer("Path");
int towerLayerID = LayerMask.NameToLayer("Tower");
int carrotLayerID = LayerMask.NameToLayer("Carrot");
Physics2D.IgnoreLayerCollision(bunnyLayerID, enemyLayerID); //Bunny and Enemy (when dragging the bunny)
Physics2D.IgnoreLayerCollision(arrowLayerID, bunnyGeneratorLayerID); //Arrow and BunnyGenerator
Physics2D.IgnoreLayerCollision(arrowLayerID, backgroundLayerID); //Arrow and Background
Physics2D.IgnoreLayerCollision(arrowLayerID, pathLayerID); //Arrow and Path
Physics2D.IgnoreLayerCollision(arrowLayerID, bunnyLayerID); //Arrow and Bunny
Physics2D.IgnoreLayerCollision(arrowLayerID, towerLayerID); //Arrow and Tower
Physics2D.IgnoreLayerCollision(arrowLayerID, carrotLayerID); //Arrow and Carrot
}
IEnumerator NextRound()
{
//give the player 2 secs to do stuff
yield return new WaitForSeconds(2f);
//get a reference to the next round details
Round currentRound = levelStuffFromXML.Rounds[currentRoundIndex];
for (int i = 0; i < currentRound.NoOfEnemies; i++)
{//spawn a new enemy
GameObject enemy = Instantiate(EnemyPrefab, Waypoints[0].position, Quaternion.identity) as GameObject;
Enemy enemyComponent = enemy.GetComponent<Enemy>();
//set speed and enemyKilled handler
enemyComponent.Speed += Mathf.Clamp(currentRoundIndex, 1f, 5f);
enemyComponent.EnemyKilled += OnEnemyKilled;
//add it to the list and wait till you spawn the next one
Enemies.Add(enemy);
yield return new WaitForSeconds(1f / (currentRoundIndex == 0 ? 1 : currentRoundIndex));
}
}
/// <summary>
/// Handler for the enemy killed event
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void OnEnemyKilled(object sender, EventArgs e)
{
bool startNewRound = false;
//explicit lock, since this may occur any time by any enemy
//not 100% that this is needed, but better safe than sorry!
lock (lockerObject)
{
if (Enemies.Where(x => x != null).Count() == 0 && CurrentGameState == GameState.Playing)
{
startNewRound = true;
}
}
if (startNewRound)
CheckAndStartNewRound();
}
/// <summary>
/// Starts a new round (if available) and sets the FinalRound flag
/// </summary>
private void CheckAndStartNewRound()
{
if (currentRoundIndex < levelStuffFromXML.Rounds.Count - 1)
{
currentRoundIndex++;
StartCoroutine(NextRound());
}
else
{
FinalRoundFinished = true;
}
}
// Update is called once per frame
void Update()
{
switch (CurrentGameState)
{
//start state, on tap, start the game and spawn carrots!
case GameState.Start:
if (Input.GetMouseButtonUp(0))
{
CurrentGameState = GameState.Playing;
StartCoroutine(NextRound());
CarrotSpawner.StartCarrotSpawning();
}
break;
case GameState.Playing:
if (Lives == 0) //we lost
{
//no more rounds
StopCoroutine(NextRound());
DestroyExistingEnemiesAndCarrots();
CarrotSpawner.StopCarrotSpawning();
CurrentGameState = GameState.Lost;
}
else if (FinalRoundFinished && Enemies.Where(x => x != null).Count() == 0)
{
DestroyExistingEnemiesAndCarrots();
CarrotSpawner.StopCarrotSpawning();
CurrentGameState = GameState.Won;
}
break;
case GameState.Won:
if (Input.GetMouseButtonUp(0))
{//restart
Application.LoadLevel(Application.loadedLevel);
}
break;
case GameState.Lost:
if (Input.GetMouseButtonUp(0))
{//restart
Application.LoadLevel(Application.loadedLevel);
}
break;
default:
break;
}
}
private void DestroyExistingEnemiesAndCarrots()
{
//get all the enemies
foreach (var item in Enemies)
{
if (item != null)
Destroy(item.gameObject);
}
//get all the carrots
var carrots = GameObject.FindGameObjectsWithTag("Carrot");
foreach (var item in carrots)
{
Destroy(item);
}
}
/// <summary>
/// Increase or decrease money available
/// </summary>
/// <param name="money"></param>
public void AlterMoneyAvailable(int money)
{
MoneyAvailable += money;
//we're also modifying the BunnyGenerator alpha color
//yeah, I know, I could use an event for that, next time!
if (MoneyAvailable < Constants.BunnyCost)
{
Color temp = BunnyGeneratorSprite.color;
temp.a = 0.3f;
BunnyGeneratorSprite.color = temp;
}
else
{
Color temp = BunnyGeneratorSprite.color;
temp.a = 1.0f;
BunnyGeneratorSprite.color = temp;
}
}
/// <summary>
/// Show GUI stuff with the deprecated way
/// Long live Unity 4.6!
/// </summary>
void OnGUI()
{
Utilities.AutoResize(800, 480);
switch (CurrentGameState)
{
case GameState.Start:
infoText.text = "Tap to start!";
break;
case GameState.Playing:
infoText.text = "Money: " + MoneyAvailable.ToString() + "\n"
+ "Life: " + Lives.ToString() + "\n" +
string.Format("round {0} of {1}", currentRoundIndex + 1, levelStuffFromXML.Rounds.Count);
break;
case GameState.Won:
infoText.text = "Won! Tap to restart!";
break;
case GameState.Lost:
infoText.text = "Lost :( Tap to restart!";
break;
default:
break;
}
}
}
================================================
FILE: Assets/Scripts/GameManager.cs.meta
================================================
fileFormatVersion: 2
guid: dca7afd3653af314d8caa97a1b2b9c65
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
================================================
FILE: Assets/Scripts/LevelStuffFromXML.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace Assets.Scripts
{
/// <summary>
/// Simple class to hold all our level details
/// </summary>
public class LevelStuffFromXML
{
public float MinCarrotSpawnTime;
public float MaxCarrotSpawnTime;
public int InitialMoney;
public List<Round> Rounds;
public List<Vector2> Paths;
public List<Vector2> Waypoints;
public Vector2 Tower;
public LevelStuffFromXML()
{
Paths = new List<Vector2>();
Waypoints = new List<Vector2>();
Rounds = new List<Round>();
}
}
/// <summary>
/// Some basic information about each game round
/// </summary>
public class Round
{
public int NoOfEnemies { get; set; }
}
}
================================================
FILE: Assets/Scripts/LevelStuffFromXML.cs.meta
================================================
fileFormatVersion: 2
guid: 49ad409a2968e44438f811f5e011dc2a
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
================================================
FILE: Assets/Scripts/ObjectPooler.cs
================================================
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
/// <summary>
/// A very simple object pooler that duplicates its initial capacity when needed
/// Can add custom components on creation
/// </summary>
public class ObjectPooler : MonoBehaviour
{
//[optional] set a parent for the new gameobject
public Transform Parent;
//[optional] prefab to instantiate our pool with
public GameObject PooledObject;
private List<GameObject> PooledObjects;
public int PoolLength = 10;
private Type[] componentsToAdd;
public void Initialize()
{
PooledObjects = new List<GameObject>();
for (int i = 0; i < PoolLength; i++)
{
CreateObjectInPool();
}
}
public void Initialize(params Type[] componentsToAdd)
{
this.componentsToAdd = componentsToAdd;
Initialize();
}
public GameObject GetPooledObject()
{
for (int i = 0; i < PooledObjects.Count; i++)
{
if (!PooledObjects[i].activeInHierarchy)
{
return PooledObjects[i];
}
}
int indexToReturn = PooledObjects.Count;
//create more
CreateObjectInPool();
//will return the first one that we created
return PooledObjects[indexToReturn];
}
private void CreateObjectInPool()
{
//if we don't have a prefab set, instantiate a new gameobject
//else instantiate the prefab
GameObject go;
if (PooledObject == null)
go = new GameObject(this.name + " PooledObject");
else
{
go = Instantiate(PooledObject) as GameObject;
}
//set the new object as inactive and add it to the list
go.SetActive(false);
PooledObjects.Add(go);
//if we have components to add
//add them
if (componentsToAdd != null)
foreach (Type itemType in componentsToAdd)
{
go.AddComponent(itemType);
}
//if we have set the parent, assign it as the new object's parent
if (Parent != null)
go.transform.parent = this.Parent;
}
}
================================================
FILE: Assets/Scripts/ObjectPooler.cs.meta
================================================
fileFormatVersion: 2
guid: 488109e57cfeb4f439fbe3c2d1fff85a
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
================================================
FILE: Assets/Scripts/ObjectPoolerManager.cs
================================================
using UnityEngine;
using System.Collections;
using System;
public class ObjectPoolerManager : MonoBehaviour {
//we'll need pools for arrows and audio objects
public ObjectPooler ArrowPooler;
public ObjectPooler AudioPooler;
public GameObject ArrowPrefab;
//basic singleton implementation
public static ObjectPoolerManager Instance {get;private set;}
void Awake()
{
Instance = this;
}
void Start()
{
//just instantiate the pools
if (ArrowPooler == null)
{
GameObject go = new GameObject("ArrowPooler");
ArrowPooler = go.AddComponent<ObjectPooler>();
ArrowPooler.PooledObject = ArrowPrefab;
go.transform.parent = this.gameObject.transform;
ArrowPooler.Initialize();
}
if (AudioPooler == null)
{
GameObject go = new GameObject("AudioPooler");
AudioPooler = go.AddComponent<ObjectPooler>();
go.transform.parent = this.gameObject.transform;
AudioPooler.Initialize(typeof(AudioSource));
}
}
}
================================================
FILE: Assets/Scripts/ObjectPoolerManager.cs.meta
================================================
fileFormatVersion: 2
guid: e2d7d1d58baa9c84a9844e78d48e9856
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
================================================
FILE: Assets/Scripts/OrderedWaypointForEditor.cs
================================================
using UnityEngine;
using System.Collections;
public class OrderedWaypointForEditor : MonoBehaviour {
[Range(0, 20)]
public int Order;
}
================================================
FILE: Assets/Scripts/OrderedWaypointForEditor.cs.meta
================================================
fileFormatVersion: 2
guid: 64a78926b994396478dd7aeb85de7891
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
================================================
FILE: Assets/Scripts/Utilities.cs
================================================
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using UnityEngine;
namespace Assets.Scripts
{
public static class Utilities
{
/// <summary>
/// Found here
/// http://www.bensilvis.com/?p=500
/// </summary>
/// <param name="screenWidth"></param>
/// <param name="screenHeight"></param>
public static void AutoResize(int screenWidth, int screenHeight)
{
Vector2 resizeRatio = new Vector2((float)Screen.width / screenWidth, (float)Screen.height / screenHeight);
GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(resizeRatio.x, resizeRatio.y, 1.0f));
}
/// <summary>
/// Reads the XML file
/// </summary>
/// <returns>A new FileStuffFromXML object</returns>
public static LevelStuffFromXML ReadXMLFile()
{
LevelStuffFromXML ls = new LevelStuffFromXML();
//we're directly loading the level1 file, change if appropriate
TextAsset ta = Resources.Load("Level1") as TextAsset;
//LINQ to XML rulez!
XDocument xdoc = XDocument.Parse(ta.text);
XElement el = xdoc.Element("Elements");
var paths = el.Element("PathPieces").Elements("Path");
foreach (var item in paths)
{
ls.Paths.Add(new Vector2(float.Parse(item.Attribute("X").Value), float.Parse(item.Attribute("Y").Value)));
}
var waypoints = el.Element("Waypoints").Elements("Waypoint");
foreach (var item in waypoints)
{
ls.Waypoints.Add(new Vector2(float.Parse(item.Attribute("X").Value), float.Parse(item.Attribute("Y").Value)));
}
var rounds = el.Element("Rounds").Elements("Round");
foreach (var item in rounds)
{
ls.Rounds.Add(new Round()
{
NoOfEnemies = int.Parse(item.Attribute("NoOfEnemies").Value),
});
}
XElement tower = el.Element("Tower");
ls.Tower = new Vector2(float.Parse(tower.Attribute("X").Value), float.Parse(tower.Attribute("Y").Value));
XElement otherStuff = el.Element("OtherStuff");
ls.InitialMoney = int.Parse(otherStuff.Attribute("InitialMoney").Value);
ls.MinCarrotSpawnTime = float.Parse(otherStuff.Attribute("MinCarrotSpawnTime").Value);
ls.MaxCarrotSpawnTime = float.Parse(otherStuff.Attribute("MaxCarrotSpawnTime").Value);
return ls;
}
}
}
================================================
FILE: Assets/Scripts/Utilities.cs.meta
================================================
fileFormatVersion: 2
guid: 7a20868bd88fd7049b4a5140a5d29a85
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
================================================
FILE: Assets/Scripts.meta
================================================
fileFormatVersion: 2
guid: b19b59416800782489d18fe36a84ab3b
folderAsset: yes
DefaultImporter:
userData:
================================================
FILE: Assets/Shaders/ColorTint.mat.meta
================================================
fileFormatVersion: 2
guid: b7ba5a509df92a74398bf5b62eb4fe8d
NativeFormatImporter:
userData:
================================================
FILE: Assets/Shaders/ColorTint.shader
================================================
Shader "Sprites/ColorTint"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Cull Off
Lighting Off
ZWrite Off
Fog { Mode Off }
Blend One OneMinusSrcAlpha
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile DUMMY PIXELSNAP_ON
#include "UnityCG.cginc"
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
half2 texcoord : TEXCOORD0;
};
fixed4 _Color;
v2f vert(appdata_t IN)
{
v2f OUT;
OUT.vertex = mul(UNITY_MATRIX_MVP, IN.vertex);
OUT.texcoord = IN.texcoord;
OUT.color = IN.color * _Color;
#ifdef PIXELSNAP_ON
OUT.vertex = UnityPixelSnap (OUT.vertex);
#endif
return OUT;
}
sampler2D _MainTex;
fixed4 frag(v2f IN) : SV_Target
{
fixed4 c = tex2D(_MainTex, IN.texcoord) + IN.color;
c.rgb *= c.a;
return c;
}
ENDCG
}
}
}
================================================
FILE: Assets/Shaders/ColorTint.shader.meta
================================================
fileFormatVersion: 2
guid: 7c8d7f59d7a80fc45912a0c9d8b64579
ShaderImporter:
defaultTextures: []
userData:
================================================
FILE: Assets/Shaders.meta
================================================
fileFormatVersion: 2
guid: 69b51734598a78d4a8e279e7fb493066
folderAsset: yes
DefaultImporter:
userData:
================================================
FILE: Assets/Sounds/168567__psychentist__ratdeath.mp3.meta
================================================
fileFormatVersion: 2
guid: 9aaa3da4158013243a187e055f33dbd5
AudioImporter:
serializedVersion: 4
format: 0
quality: .5
stream: 1
3D: 0
forceToMono: 0
useHardware: 0
loopable: 0
userData:
================================================
FILE: Assets/Sounds/65734__erdie__bow02.wav.meta
================================================
fileFormatVersion: 2
guid: 541fe3a7f0ec22948a88a86e6774cfe4
AudioImporter:
serializedVersion: 4
format: -1
quality: .5
stream: 1
3D: 0
forceToMono: 0
useHardware: 0
loopable: 0
userData:
================================================
FILE: Assets/Sounds.meta
================================================
fileFormatVersion: 2
guid: c71b79bd02e1cde4d812907a26d27c9f
folderAsset: yes
DefaultImporter:
userData:
================================================
FILE: Assets/Sprites/Badger/EnemyAnimation.anim.meta
================================================
fileFormatVersion: 2
guid: ef008c9025b82b04585bba2c7a5f1a22
NativeFormatImporter:
userData:
================================================
FILE: Assets/Sprites/Badger/badger_01.controller.meta
================================================
fileFormatVersion: 2
guid: 06c4e1dfa0810ed4db81b595f2de3bf8
NativeFormatImporter:
userData:
================================================
FILE: Assets/Sprites/Badger/badger_01.png.meta
================================================
fileFormatVersion: 2
guid: 443e5452ed1796e4699de9831c7b493b
TextureImporter:
fileIDToRecycleName:
21300000: badger_01
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Badger/badger_01@2x.png.meta
================================================
fileFormatVersion: 2
guid: 42c55b1dc33d21a49919e9b1a6d9928b
TextureImporter:
fileIDToRecycleName:
21300000: badger_01@2x
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Badger/badger_02.png.meta
================================================
fileFormatVersion: 2
guid: 6d9cb6ab118c1a3408e53fc162708882
TextureImporter:
fileIDToRecycleName:
21300000: badger_02
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Badger/badger_02@2x.png.meta
================================================
fileFormatVersion: 2
guid: c3096ba5b7896744fa6399ffbbc9cbc3
TextureImporter:
fileIDToRecycleName:
21300000: badger_02@2x
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Badger/badger_03.png.meta
================================================
fileFormatVersion: 2
guid: 0d1f44e860c375649a4d60e03d8b7cd9
TextureImporter:
fileIDToRecycleName:
21300000: badger_03
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Badger/badger_03@2x.png.meta
================================================
fileFormatVersion: 2
guid: d75b717cdc914a247802604c25de0926
TextureImporter:
fileIDToRecycleName:
21300000: badger_03@2x
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Badger/badger_04.png.meta
================================================
fileFormatVersion: 2
guid: e83644e8d4773a142909f1df20881009
TextureImporter:
fileIDToRecycleName:
21300000: badger_04
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Badger/badger_04@2x.png.meta
================================================
fileFormatVersion: 2
guid: 7400c9026a5d695479a5cbed5f2d9994
TextureImporter:
fileIDToRecycleName:
21300000: badger_04@2x
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Badger.meta
================================================
fileFormatVersion: 2
guid: 13d68614efe659c4293a66bd1bb231c3
folderAsset: yes
DefaultImporter:
userData:
================================================
FILE: Assets/Sprites/Bunnies/BunnyAnimation.anim.meta
================================================
fileFormatVersion: 2
guid: 5deddcdc66d096a4994986b4f7c6d010
NativeFormatImporter:
userData:
================================================
FILE: Assets/Sprites/Bunnies/arrow.png.meta
================================================
fileFormatVersion: 2
guid: c693a10ba62079b4f997524d1b6c260f
TextureImporter:
fileIDToRecycleName:
21300000: arrow
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Bunnies/arrow@2x.png.meta
================================================
fileFormatVersion: 2
guid: 621f7ea190675c34fb870b6334c17ae5
TextureImporter:
fileIDToRecycleName:
21300000: arrow@2x
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Bunnies/bottom.png.meta
================================================
fileFormatVersion: 2
guid: 1a7d014538ccce54eb9a0dd4faa6c9cb
TextureImporter:
fileIDToRecycleName:
21300000: bottom
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Bunnies/bunny_1.controller.meta
================================================
fileFormatVersion: 2
guid: 15d94c4b5a586b24fa07a8630cfc5d0c
NativeFormatImporter:
userData:
================================================
FILE: Assets/Sprites/Bunnies/bunny_1.png.meta
================================================
fileFormatVersion: 2
guid: 7d1c98caecbf5e44db21404a61b97fff
TextureImporter:
fileIDToRecycleName:
21300000: bunny_1
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Bunnies/bunny_1@2x.png.meta
================================================
fileFormatVersion: 2
guid: b0b30b9403990714cb19556fc431958b
TextureImporter:
fileIDToRecycleName:
21300000: bunny_1@2x
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Bunnies/bunny_2.png.meta
================================================
fileFormatVersion: 2
guid: 710f7fefa97723546ab50e8e4717c454
TextureImporter:
fileIDToRecycleName:
21300000: bunny_2
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Bunnies/bunny_2@2x.png.meta
================================================
fileFormatVersion: 2
guid: 0aaf43323629cd94b80f77508b5e5df7
TextureImporter:
fileIDToRecycleName:
21300000: bunny_2@2x
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Bunnies/carrot.png.meta
================================================
fileFormatVersion: 2
guid: de362250c89ad5e4faea67651309a36d
TextureImporter:
fileIDToRecycleName:
21300000: carrot
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Bunnies/tower_bunnies.png.meta
================================================
fileFormatVersion: 2
guid: 885e425c85fccd54a854bdc0ac7682ec
TextureImporter:
fileIDToRecycleName:
21300000: tower_bunnies
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Bunnies/tower_bunnies@2x.png.meta
================================================
fileFormatVersion: 2
guid: dd20952364264be4bafa677bd019a27f
TextureImporter:
fileIDToRecycleName:
21300000: tower_bunnies@2x
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Bunnies.meta
================================================
fileFormatVersion: 2
guid: 3795f53b69028044892d738c8db9664f
folderAsset: yes
DefaultImporter:
userData:
================================================
FILE: Assets/Sprites/License.txt
================================================
THIS LICENSE AGREEMENT, is between you (the “Licensee”), and Razeware LLC (http://www.raywenderlich.com) (the “Licensor”). By purchasing, downloading, or using any art licensed by Razeware LLC, you agree to the following:
Ownership of Work
Licensor owns all proprietary rights in and to all copyrightable works, generally described as game art, all of which are displayed and viewable at http://www.gameartguppy.com (the “Work”), and has the exclusive right to license others to produce, copy, make, or sell the Work.
Grant of License
Licensee is granted a non-exclusive, non-transferrable license to use the Work, royalty free, for personal and commercial projects, including games and apps created for the computer, web, or smartphone/tablet. Licensee may modify Work.
License Prohibitions
Licensee may not:
a) Resell game art, or resell modified game art.
b) Use game art in a template of any nature for distribution or sale to third parties.
c) Place licensed art on any website in a complete or archived downloadable format.
Assignment
Licensee may not convey, sublicense, assign, transfer, pledge, hypothecate, encumber or otherwise dispose of this Agreement without the prior written consent of the Licensor.
Indemnification
Licensee shall fully indemnify, defend, and hold harmless Licensor from and against any and all claims, losses, damages, expenses, and liability.
Acknowledgement
YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT AND UNDERSTAND IT PRIOR TO AGREEING TO IT. YOU AGREE TO BE BOUND BY THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU FURTHER AGREE THAT IT IS THE COMPLETE AND EXCLUSIVE STATEMENT OF THE AGREEMENT BETWEEN YOU AND RAZEWARE LLC, WHICH SUPERSEDES ANY PROPOSAL OR PRIOR AGREEMENT, ORAL OR WRITTEN, AND ANY OTHER COMMUNICATION BETWEEN YOU AND RAZEWARE LLC RELATING TO THE SUBJECT OF THIS AGREEMENT.
================================================
FILE: Assets/Sprites/License.txt.meta
================================================
fileFormatVersion: 2
guid: d88eccb2082153d4cb76731a55b2b8ed
TextScriptImporter:
userData:
================================================
FILE: Assets/Sprites/Tiles/bg_tile.png.meta
================================================
fileFormatVersion: 2
guid: 907cad51a106b1e46b8e86e9a199cd45
TextureImporter:
fileIDToRecycleName:
21300000: bg_tile
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Tiles/bg_tile@2x.png.meta
================================================
fileFormatVersion: 2
guid: 02b9236213329e348972f816b10c7fd8
TextureImporter:
fileIDToRecycleName:
21300000: bg_tile@2x
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Tiles/tile_path_step.png.meta
================================================
fileFormatVersion: 2
guid: 2f958940635368745b1c90b3b11e67a4
TextureImporter:
fileIDToRecycleName:
21300000: tile_path_step
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Tiles/tile_path_step@2x.png.meta
================================================
fileFormatVersion: 2
guid: 216858c04f59db84b8f2929a270316a2
TextureImporter:
fileIDToRecycleName:
21300000: tile_path_step@2x
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
================================================
FILE: Assets/Sprites/Tiles.meta
================================================
fileFormatVersion: 2
guid: 7c85e353d39294a4da7b4cc2d0b4bf10
folderAsset: yes
DefaultImporter:
userData:
================================================
FILE: Assets/Sprites.meta
================================================
fileFormatVersion: 2
guid: 1a3a02826cda25047868c30b8415cd37
folderAsset: yes
DefaultImporter:
userData:
================================================
FILE: README.md
================================================
[](https://github.com/dgkanatsios/gaforgithub)
TowerDefense
============
A Tower Defense clone in Unity3D. For a tutorial blog post please see:
http://dgkanatsios.com/2014/09/04/a-tower-defense-game-in-unity-part-1-3/
http://dgkanatsios.com/2014/09/06/a-tower-defense-game-in-unity-part-2-3/
gitextract_n54cm9fx/ ├── .gitattributes ├── .gitignore ├── Assets/ │ ├── Editor/ │ │ ├── LevelExport.cs │ │ └── LevelExport.cs.meta │ ├── Editor.meta │ ├── Prefabs/ │ │ ├── Arrow.prefab │ │ ├── Arrow.prefab.meta │ │ ├── Bunny.prefab │ │ ├── Bunny.prefab.meta │ │ ├── Enemy.prefab │ │ ├── Enemy.prefab.meta │ │ ├── Path.prefab │ │ ├── Path.prefab.meta │ │ ├── RootGO.prefab │ │ ├── RootGO.prefab.meta │ │ ├── Tower.prefab │ │ ├── Tower.prefab.meta │ │ ├── carrot.prefab │ │ └── carrot.prefab.meta │ ├── Prefabs.meta │ ├── Resources/ │ │ ├── Level1.xml │ │ └── Level1.xml.meta │ ├── Resources.meta │ ├── Scenes/ │ │ ├── game.unity │ │ └── game.unity.meta │ ├── Scenes.meta │ ├── Scripts/ │ │ ├── Arrow.cs │ │ ├── Arrow.cs.meta │ │ ├── AudioManager.cs │ │ ├── AudioManager.cs.meta │ │ ├── Bunny.cs │ │ ├── Bunny.cs.meta │ │ ├── Carrot.cs │ │ ├── Carrot.cs.meta │ │ ├── CarrotSpawner.cs │ │ ├── CarrotSpawner.cs.meta │ │ ├── Constants.cs │ │ ├── Constants.cs.meta │ │ ├── DragDropBunny.cs │ │ ├── DragDropBunny.cs.meta │ │ ├── Enemy.cs │ │ ├── Enemy.cs.meta │ │ ├── Enums.cs │ │ ├── Enums.cs.meta │ │ ├── GameManager.cs │ │ ├── GameManager.cs.meta │ │ ├── LevelStuffFromXML.cs │ │ ├── LevelStuffFromXML.cs.meta │ │ ├── ObjectPooler.cs │ │ ├── ObjectPooler.cs.meta │ │ ├── ObjectPoolerManager.cs │ │ ├── ObjectPoolerManager.cs.meta │ │ ├── OrderedWaypointForEditor.cs │ │ ├── OrderedWaypointForEditor.cs.meta │ │ ├── Utilities.cs │ │ └── Utilities.cs.meta │ ├── Scripts.meta │ ├── Shaders/ │ │ ├── ColorTint.mat │ │ ├── ColorTint.mat.meta │ │ ├── ColorTint.shader │ │ └── ColorTint.shader.meta │ ├── Shaders.meta │ ├── Sounds/ │ │ ├── 168567__psychentist__ratdeath.mp3.meta │ │ └── 65734__erdie__bow02.wav.meta │ ├── Sounds.meta │ ├── Sprites/ │ │ ├── Badger/ │ │ │ ├── EnemyAnimation.anim │ │ │ ├── EnemyAnimation.anim.meta │ │ │ ├── badger_01.controller │ │ │ ├── badger_01.controller.meta │ │ │ ├── badger_01.png.meta │ │ │ ├── badger_01@2x.png.meta │ │ │ ├── badger_02.png.meta │ │ │ ├── badger_02@2x.png.meta │ │ │ ├── badger_03.png.meta │ │ │ ├── badger_03@2x.png.meta │ │ │ ├── badger_04.png.meta │ │ │ └── badger_04@2x.png.meta │ │ ├── Badger.meta │ │ ├── Bunnies/ │ │ │ ├── BunnyAnimation.anim │ │ │ ├── BunnyAnimation.anim.meta │ │ │ ├── arrow.png.meta │ │ │ ├── arrow@2x.png.meta │ │ │ ├── bottom.png.meta │ │ │ ├── bunny_1.controller │ │ │ ├── bunny_1.controller.meta │ │ │ ├── bunny_1.png.meta │ │ │ ├── bunny_1@2x.png.meta │ │ │ ├── bunny_2.png.meta │ │ │ ├── bunny_2@2x.png.meta │ │ │ ├── carrot.png.meta │ │ │ ├── tower_bunnies.png.meta │ │ │ └── tower_bunnies@2x.png.meta │ │ ├── Bunnies.meta │ │ ├── License.txt │ │ ├── License.txt.meta │ │ ├── Tiles/ │ │ │ ├── bg_tile.png.meta │ │ │ ├── bg_tile@2x.png.meta │ │ │ ├── tile_path_step.png.meta │ │ │ └── tile_path_step@2x.png.meta │ │ └── Tiles.meta │ └── Sprites.meta ├── ProjectSettings/ │ ├── AudioManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshLayers.asset │ ├── NetworkManager.asset │ ├── Physics2DSettings.asset │ ├── ProjectSettings.asset │ ├── QualitySettings.asset │ ├── TagManager.asset │ └── TimeManager.asset └── README.md
SYMBOL INDEX (67 symbols across 16 files)
FILE: Assets/Editor/LevelExport.cs
class LevelExport (line 10) | public class LevelExport : EditorWindow
method ShowWindow (line 12) | [MenuItem("Custom Editor/Export Level")]
method OnGUI (line 25) | void OnGUI()
method Export (line 64) | void Export()
method WaypointsAreValid (line 151) | private bool WaypointsAreValid(GameObject[] waypoints)
method ShowErrorForNull (line 169) | private void ShowErrorForNull(string gameObjectName)
method InputIsValid (line 174) | private bool InputIsValid()
FILE: Assets/Scripts/Arrow.cs
class Arrow (line 4) | public class Arrow : MonoBehaviour {
method Start (line 7) | void Start () {
method Disable (line 12) | public void Disable()
FILE: Assets/Scripts/AudioManager.cs
class AudioManager (line 4) | public class AudioManager : MonoBehaviour {
method Awake (line 13) | void Awake()
method PlayArrowSound (line 18) | public void PlayArrowSound()
method PlayDeathSound (line 23) | public void PlayDeathSound()
method PlaySound (line 29) | private IEnumerator PlaySound(AudioClip clip)
FILE: Assets/Scripts/Bunny.cs
class Bunny (line 6) | public class Bunny : MonoBehaviour
method Start (line 20) | void Start()
method Update (line 28) | void Update()
method LookAndShoot (line 73) | private void LookAndShoot()
method Shoot (line 98) | private void Shoot(Vector2 dir)
method Activate (line 124) | public void Activate()
FILE: Assets/Scripts/Carrot.cs
class Carrot (line 5) | public class Carrot : MonoBehaviour
method Start (line 13) | void Start()
method Update (line 19) | void Update()
FILE: Assets/Scripts/CarrotSpawner.cs
class CarrotSpawner (line 4) | public class CarrotSpawner : MonoBehaviour {
method StartCarrotSpawning (line 11) | public void StartCarrotSpawning()
method StopCarrotSpawning (line 16) | public void StopCarrotSpawning()
method SpawnCarrots (line 20) | private IEnumerator SpawnCarrots()
FILE: Assets/Scripts/Constants.cs
class Constants (line 12) | public static class Constants
FILE: Assets/Scripts/DragDropBunny.cs
class DragDropBunny (line 9) | public class DragDropBunny : MonoBehaviour
method Start (line 13) | void Start()
method Update (line 31) | void Update()
method ResetTempBackgroundColor (line 117) | private void ResetTempBackgroundColor()
FILE: Assets/Scripts/Enemy.cs
class Enemy (line 6) | public class Enemy : MonoBehaviour
method Start (line 15) | void Start()
method Update (line 21) | void Update()
method OnCollisionEnter2D (line 55) | void OnCollisionEnter2D(Collision2D col)
method RemoveAndDestroy (line 73) | void RemoveAndDestroy()
FILE: Assets/Scripts/Enums.cs
type BunnyState (line 8) | public enum BunnyState
type GameState (line 15) | public enum GameState
FILE: Assets/Scripts/GameManager.cs
class GameManager (line 8) | public class GameManager : MonoBehaviour
method Awake (line 14) | void Awake()
method Start (line 56) | void Start()
method CreateLevelFromXML (line 75) | private void CreateLevelFromXML()
method IgnoreLayerCollisions (line 109) | private void IgnoreLayerCollisions()
method NextRound (line 130) | IEnumerator NextRound()
method OnEnemyKilled (line 155) | void OnEnemyKilled(object sender, EventArgs e)
method CheckAndStartNewRound (line 174) | private void CheckAndStartNewRound()
method Update (line 188) | void Update()
method DestroyExistingEnemiesAndCarrots (line 234) | private void DestroyExistingEnemiesAndCarrots()
method AlterMoneyAvailable (line 254) | public void AlterMoneyAvailable(int money)
method OnGUI (line 277) | void OnGUI()
FILE: Assets/Scripts/LevelStuffFromXML.cs
class LevelStuffFromXML (line 12) | public class LevelStuffFromXML
method LevelStuffFromXML (line 21) | public LevelStuffFromXML()
class Round (line 33) | public class Round
FILE: Assets/Scripts/ObjectPooler.cs
class ObjectPooler (line 10) | public class ObjectPooler : MonoBehaviour
method Initialize (line 21) | public void Initialize()
method Initialize (line 30) | public void Initialize(params Type[] componentsToAdd)
method GetPooledObject (line 38) | public GameObject GetPooledObject()
method CreateObjectInPool (line 54) | private void CreateObjectInPool()
FILE: Assets/Scripts/ObjectPoolerManager.cs
class ObjectPoolerManager (line 5) | public class ObjectPoolerManager : MonoBehaviour {
method Awake (line 16) | void Awake()
method Start (line 21) | void Start()
FILE: Assets/Scripts/OrderedWaypointForEditor.cs
class OrderedWaypointForEditor (line 4) | public class OrderedWaypointForEditor : MonoBehaviour {
FILE: Assets/Scripts/Utilities.cs
class Utilities (line 11) | public static class Utilities
method AutoResize (line 19) | public static void AutoResize(int screenWidth, int screenHeight)
method ReadXMLFile (line 29) | public static LevelStuffFromXML ReadXMLFile()
Condensed preview — 115 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (87K chars).
[
{
"path": ".gitattributes",
"chars": 483,
"preview": "# Auto detect text files and perform LF normalization\n* text=auto\n\n# Custom for Visual Studio\n*.cs diff=csharp\n*.sln"
},
{
"path": ".gitignore",
"chars": 698,
"preview": "[Ll]ibrary/\r\n[Tt]emp/\r\n[Oo]bj/\r\n\r\n# Autogenerated VS/MD solution and project files\r\n/*.csproj\r\n/*.unityproj\r\n/*.sln\r\n/*."
},
{
"path": "Assets/Editor/LevelExport.cs",
"chars": 6999,
"preview": "using UnityEngine;\nusing System.Collections;\nusing UnityEditor;\nusing System.IO;\nusing System.Xml.Linq;\nusing Assets.Sc"
},
{
"path": "Assets/Editor/LevelExport.cs.meta",
"chars": 178,
"preview": "fileFormatVersion: 2\nguid: 9a1f98525123ab0448bcd52794183e29\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []"
},
{
"path": "Assets/Editor.meta",
"chars": 107,
"preview": "fileFormatVersion: 2\nguid: 0ec61eb9e3c0b01418f1349ad01afec7\nfolderAsset: yes\nDefaultImporter:\n userData: \n"
},
{
"path": "Assets/Prefabs/Arrow.prefab.meta",
"chars": 95,
"preview": "fileFormatVersion: 2\nguid: f19afcd826e89cb488afdd3215cc2f64\nNativeFormatImporter:\n userData: \n"
},
{
"path": "Assets/Prefabs/Bunny.prefab.meta",
"chars": 95,
"preview": "fileFormatVersion: 2\nguid: 2432be9b4f27c07418472db59ada6820\nNativeFormatImporter:\n userData: \n"
},
{
"path": "Assets/Prefabs/Enemy.prefab.meta",
"chars": 95,
"preview": "fileFormatVersion: 2\nguid: a84d866c941de9c4f8466adb84ab6371\nNativeFormatImporter:\n userData: \n"
},
{
"path": "Assets/Prefabs/Path.prefab.meta",
"chars": 95,
"preview": "fileFormatVersion: 2\nguid: b1e0f8e16e04e3a48ab9865c613b0a8d\nNativeFormatImporter:\n userData: \n"
},
{
"path": "Assets/Prefabs/RootGO.prefab.meta",
"chars": 95,
"preview": "fileFormatVersion: 2\nguid: 672ec9dc8634232488dc5b57ae3b541f\nNativeFormatImporter:\n userData: \n"
},
{
"path": "Assets/Prefabs/Tower.prefab.meta",
"chars": 95,
"preview": "fileFormatVersion: 2\nguid: 72b25f8bade59464daa9a3b36a4a0f04\nNativeFormatImporter:\n userData: \n"
},
{
"path": "Assets/Prefabs/carrot.prefab.meta",
"chars": 95,
"preview": "fileFormatVersion: 2\nguid: 72926e40b231c84498bdcebbf5ec8d81\nNativeFormatImporter:\n userData: \n"
},
{
"path": "Assets/Prefabs.meta",
"chars": 107,
"preview": "fileFormatVersion: 2\nguid: 787b4919f33dbac4fb854100a24852e5\nfolderAsset: yes\nDefaultImporter:\n userData: \n"
},
{
"path": "Assets/Resources/Level1.xml",
"chars": 3568,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<Elements>\n <PathPieces>\n <Path X=\"-1.30081642\" Y=\"1.43285584\" />\n <Path"
},
{
"path": "Assets/Resources/Level1.xml.meta",
"chars": 93,
"preview": "fileFormatVersion: 2\nguid: 111b176d9751b244f9766267f11fc925\nTextScriptImporter:\n userData: \n"
},
{
"path": "Assets/Resources.meta",
"chars": 107,
"preview": "fileFormatVersion: 2\nguid: 027bff34dfdf63540b766acb3fa45a4b\nfolderAsset: yes\nDefaultImporter:\n userData: \n"
},
{
"path": "Assets/Scenes/game.unity.meta",
"chars": 90,
"preview": "fileFormatVersion: 2\nguid: 8048a33abbc13eb42b049b36a2c26c4a\nDefaultImporter:\n userData: \n"
},
{
"path": "Assets/Scenes.meta",
"chars": 107,
"preview": "fileFormatVersion: 2\nguid: 46411d2a8f3579c40b74596148184941\nfolderAsset: yes\nDefaultImporter:\n userData: \n"
},
{
"path": "Assets/Scripts/Arrow.cs",
"chars": 445,
"preview": "using UnityEngine;\nusing System.Collections;\n\npublic class Arrow : MonoBehaviour {\n\n\t// Use this for initialization\n\tvo"
},
{
"path": "Assets/Scripts/Arrow.cs.meta",
"chars": 178,
"preview": "fileFormatVersion: 2\nguid: 3efa080e0e608b44f8797ac518170b84\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []"
},
{
"path": "Assets/Scripts/AudioManager.cs",
"chars": 1083,
"preview": "using UnityEngine;\nusing System.Collections;\n\npublic class AudioManager : MonoBehaviour {\n\n public AudioClip ArrowAu"
},
{
"path": "Assets/Scripts/AudioManager.cs.meta",
"chars": 178,
"preview": "fileFormatVersion: 2\nguid: b76483430df840a4fa28c360640f3991\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []"
},
{
"path": "Assets/Scripts/Bunny.cs",
"chars": 4386,
"preview": "using UnityEngine;\nusing System.Collections;\nusing System.Linq;\nusing Assets.Scripts;\n\npublic class Bunny : MonoBehavio"
},
{
"path": "Assets/Scripts/Bunny.cs.meta",
"chars": 178,
"preview": "fileFormatVersion: 2\nguid: 709dea957d3aa334d925137e1c5adea3\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []"
},
{
"path": "Assets/Scripts/Carrot.cs",
"chars": 1223,
"preview": "using UnityEngine;\nusing System.Collections;\nusing Assets.Scripts;\n\npublic class Carrot : MonoBehaviour\n{\n\n //carrot"
},
{
"path": "Assets/Scripts/Carrot.cs.meta",
"chars": 178,
"preview": "fileFormatVersion: 2\nguid: 3bae68fd5da19fb4282e7ea8bb942abf\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []"
},
{
"path": "Assets/Scripts/CarrotSpawner.cs",
"chars": 1001,
"preview": "using UnityEngine;\nusing System.Collections;\n\npublic class CarrotSpawner : MonoBehaviour {\n\n\t/// <summary>\n\t/// Carrot "
},
{
"path": "Assets/Scripts/CarrotSpawner.cs.meta",
"chars": 178,
"preview": "fileFormatVersion: 2\nguid: 5b9bb9fb6b842624db44df45e2f9add1\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []"
},
{
"path": "Assets/Scripts/Constants.cs",
"chars": 701,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing UnityEngine;\n\nnamespace Ass"
},
{
"path": "Assets/Scripts/Constants.cs.meta",
"chars": 178,
"preview": "fileFormatVersion: 2\nguid: e8abcfc6062ce5f4a857ac7393af9e6a\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []"
},
{
"path": "Assets/Scripts/DragDropBunny.cs",
"chars": 5067,
"preview": "using UnityEngine;\nusing System.Collections;\nusing System.Linq;\nusing Assets.Scripts;\n\n/// <summary>\n/// Drag and drop "
},
{
"path": "Assets/Scripts/DragDropBunny.cs.meta",
"chars": 178,
"preview": "fileFormatVersion: 2\nguid: dc48c92ee473e39499456b4328dde1ac\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []"
},
{
"path": "Assets/Scripts/Enemy.cs",
"chars": 2542,
"preview": "using UnityEngine;\nusing System.Collections;\nusing Assets.Scripts;\nusing System;\n\npublic class Enemy : MonoBehaviour\n{\n"
},
{
"path": "Assets/Scripts/Enemy.cs.meta",
"chars": 178,
"preview": "fileFormatVersion: 2\nguid: afc9dcbac1e688c4384857ea0f44e5b9\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []"
},
{
"path": "Assets/Scripts/Enums.cs",
"chars": 308,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Assets.Scripts\n{\n p"
},
{
"path": "Assets/Scripts/Enums.cs.meta",
"chars": 178,
"preview": "fileFormatVersion: 2\nguid: 28a214e46c3781448abaea3be81ab638\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []"
},
{
"path": "Assets/Scripts/GameManager.cs",
"chars": 10268,
"preview": "using UnityEngine;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Assets.Scripts;\nusing System.Collections;"
},
{
"path": "Assets/Scripts/GameManager.cs.meta",
"chars": 178,
"preview": "fileFormatVersion: 2\nguid: dca7afd3653af314d8caa97a1b2b9c65\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []"
},
{
"path": "Assets/Scripts/LevelStuffFromXML.cs",
"chars": 887,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing UnityEngine;\n\nnamespace Ass"
},
{
"path": "Assets/Scripts/LevelStuffFromXML.cs.meta",
"chars": 178,
"preview": "fileFormatVersion: 2\nguid: 49ad409a2968e44438f811f5e011dc2a\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []"
},
{
"path": "Assets/Scripts/ObjectPooler.cs",
"chars": 2225,
"preview": "using UnityEngine;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System;\n\n/// <summary>\n/// A very "
},
{
"path": "Assets/Scripts/ObjectPooler.cs.meta",
"chars": 178,
"preview": "fileFormatVersion: 2\nguid: 488109e57cfeb4f439fbe3c2d1fff85a\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []"
},
{
"path": "Assets/Scripts/ObjectPoolerManager.cs",
"chars": 1126,
"preview": "using UnityEngine;\nusing System.Collections;\nusing System;\n\npublic class ObjectPoolerManager : MonoBehaviour {\n\n //w"
},
{
"path": "Assets/Scripts/ObjectPoolerManager.cs.meta",
"chars": 178,
"preview": "fileFormatVersion: 2\nguid: e2d7d1d58baa9c84a9844e78d48e9856\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []"
},
{
"path": "Assets/Scripts/OrderedWaypointForEditor.cs",
"chars": 147,
"preview": "using UnityEngine;\nusing System.Collections;\n\npublic class OrderedWaypointForEditor : MonoBehaviour {\n\n [Range(0, 20"
},
{
"path": "Assets/Scripts/OrderedWaypointForEditor.cs.meta",
"chars": 178,
"preview": "fileFormatVersion: 2\nguid: 64a78926b994396478dd7aeb85de7891\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []"
},
{
"path": "Assets/Scripts/Utilities.cs",
"chars": 2686,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Xml"
},
{
"path": "Assets/Scripts/Utilities.cs.meta",
"chars": 178,
"preview": "fileFormatVersion: 2\nguid: 7a20868bd88fd7049b4a5140a5d29a85\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []"
},
{
"path": "Assets/Scripts.meta",
"chars": 107,
"preview": "fileFormatVersion: 2\nguid: b19b59416800782489d18fe36a84ab3b\nfolderAsset: yes\nDefaultImporter:\n userData: \n"
},
{
"path": "Assets/Shaders/ColorTint.mat.meta",
"chars": 95,
"preview": "fileFormatVersion: 2\nguid: b7ba5a509df92a74398bf5b62eb4fe8d\nNativeFormatImporter:\n userData: \n"
},
{
"path": "Assets/Shaders/ColorTint.shader",
"chars": 1323,
"preview": "Shader \"Sprites/ColorTint\"\n{\n\tProperties\n\t{\n\t\t[PerRendererData] _MainTex (\"Sprite Texture\", 2D) = \"white\" {}\n\t\t_Color (\""
},
{
"path": "Assets/Shaders/ColorTint.shader.meta",
"chars": 111,
"preview": "fileFormatVersion: 2\nguid: 7c8d7f59d7a80fc45912a0c9d8b64579\nShaderImporter:\n defaultTextures: []\n userData: \n"
},
{
"path": "Assets/Shaders.meta",
"chars": 107,
"preview": "fileFormatVersion: 2\nguid: 69b51734598a78d4a8e279e7fb493066\nfolderAsset: yes\nDefaultImporter:\n userData: \n"
},
{
"path": "Assets/Sounds/168567__psychentist__ratdeath.mp3.meta",
"chars": 205,
"preview": "fileFormatVersion: 2\nguid: 9aaa3da4158013243a187e055f33dbd5\nAudioImporter:\n serializedVersion: 4\n format: 0\n quality:"
},
{
"path": "Assets/Sounds/65734__erdie__bow02.wav.meta",
"chars": 206,
"preview": "fileFormatVersion: 2\nguid: 541fe3a7f0ec22948a88a86e6774cfe4\nAudioImporter:\n serializedVersion: 4\n format: -1\n quality"
},
{
"path": "Assets/Sounds.meta",
"chars": 107,
"preview": "fileFormatVersion: 2\nguid: c71b79bd02e1cde4d812907a26d27c9f\nfolderAsset: yes\nDefaultImporter:\n userData: \n"
},
{
"path": "Assets/Sprites/Badger/EnemyAnimation.anim.meta",
"chars": 95,
"preview": "fileFormatVersion: 2\nguid: ef008c9025b82b04585bba2c7a5f1a22\nNativeFormatImporter:\n userData: \n"
},
{
"path": "Assets/Sprites/Badger/badger_01.controller.meta",
"chars": 95,
"preview": "fileFormatVersion: 2\nguid: 06c4e1dfa0810ed4db81b595f2de3bf8\nNativeFormatImporter:\n userData: \n"
},
{
"path": "Assets/Sprites/Badger/badger_01.png.meta",
"chars": 1001,
"preview": "fileFormatVersion: 2\nguid: 443e5452ed1796e4699de9831c7b493b\nTextureImporter:\n fileIDToRecycleName:\n 21300000: badger"
},
{
"path": "Assets/Sprites/Badger/badger_01@2x.png.meta",
"chars": 1004,
"preview": "fileFormatVersion: 2\nguid: 42c55b1dc33d21a49919e9b1a6d9928b\nTextureImporter:\n fileIDToRecycleName:\n 21300000: badger"
},
{
"path": "Assets/Sprites/Badger/badger_02.png.meta",
"chars": 1001,
"preview": "fileFormatVersion: 2\nguid: 6d9cb6ab118c1a3408e53fc162708882\nTextureImporter:\n fileIDToRecycleName:\n 21300000: badger"
},
{
"path": "Assets/Sprites/Badger/badger_02@2x.png.meta",
"chars": 1004,
"preview": "fileFormatVersion: 2\nguid: c3096ba5b7896744fa6399ffbbc9cbc3\nTextureImporter:\n fileIDToRecycleName:\n 21300000: badger"
},
{
"path": "Assets/Sprites/Badger/badger_03.png.meta",
"chars": 1001,
"preview": "fileFormatVersion: 2\nguid: 0d1f44e860c375649a4d60e03d8b7cd9\nTextureImporter:\n fileIDToRecycleName:\n 21300000: badger"
},
{
"path": "Assets/Sprites/Badger/badger_03@2x.png.meta",
"chars": 1004,
"preview": "fileFormatVersion: 2\nguid: d75b717cdc914a247802604c25de0926\nTextureImporter:\n fileIDToRecycleName:\n 21300000: badger"
},
{
"path": "Assets/Sprites/Badger/badger_04.png.meta",
"chars": 1001,
"preview": "fileFormatVersion: 2\nguid: e83644e8d4773a142909f1df20881009\nTextureImporter:\n fileIDToRecycleName:\n 21300000: badger"
},
{
"path": "Assets/Sprites/Badger/badger_04@2x.png.meta",
"chars": 1004,
"preview": "fileFormatVersion: 2\nguid: 7400c9026a5d695479a5cbed5f2d9994\nTextureImporter:\n fileIDToRecycleName:\n 21300000: badger"
},
{
"path": "Assets/Sprites/Badger.meta",
"chars": 107,
"preview": "fileFormatVersion: 2\nguid: 13d68614efe659c4293a66bd1bb231c3\nfolderAsset: yes\nDefaultImporter:\n userData: \n"
},
{
"path": "Assets/Sprites/Bunnies/BunnyAnimation.anim.meta",
"chars": 95,
"preview": "fileFormatVersion: 2\nguid: 5deddcdc66d096a4994986b4f7c6d010\nNativeFormatImporter:\n userData: \n"
},
{
"path": "Assets/Sprites/Bunnies/arrow.png.meta",
"chars": 997,
"preview": "fileFormatVersion: 2\nguid: c693a10ba62079b4f997524d1b6c260f\nTextureImporter:\n fileIDToRecycleName:\n 21300000: arrow\n"
},
{
"path": "Assets/Sprites/Bunnies/arrow@2x.png.meta",
"chars": 1000,
"preview": "fileFormatVersion: 2\nguid: 621f7ea190675c34fb870b6334c17ae5\nTextureImporter:\n fileIDToRecycleName:\n 21300000: arrow@"
},
{
"path": "Assets/Sprites/Bunnies/bottom.png.meta",
"chars": 998,
"preview": "fileFormatVersion: 2\nguid: 1a7d014538ccce54eb9a0dd4faa6c9cb\nTextureImporter:\n fileIDToRecycleName:\n 21300000: bottom"
},
{
"path": "Assets/Sprites/Bunnies/bunny_1.controller.meta",
"chars": 95,
"preview": "fileFormatVersion: 2\nguid: 15d94c4b5a586b24fa07a8630cfc5d0c\nNativeFormatImporter:\n userData: \n"
},
{
"path": "Assets/Sprites/Bunnies/bunny_1.png.meta",
"chars": 999,
"preview": "fileFormatVersion: 2\nguid: 7d1c98caecbf5e44db21404a61b97fff\nTextureImporter:\n fileIDToRecycleName:\n 21300000: bunny_"
},
{
"path": "Assets/Sprites/Bunnies/bunny_1@2x.png.meta",
"chars": 1002,
"preview": "fileFormatVersion: 2\nguid: b0b30b9403990714cb19556fc431958b\nTextureImporter:\n fileIDToRecycleName:\n 21300000: bunny_"
},
{
"path": "Assets/Sprites/Bunnies/bunny_2.png.meta",
"chars": 999,
"preview": "fileFormatVersion: 2\nguid: 710f7fefa97723546ab50e8e4717c454\nTextureImporter:\n fileIDToRecycleName:\n 21300000: bunny_"
},
{
"path": "Assets/Sprites/Bunnies/bunny_2@2x.png.meta",
"chars": 1002,
"preview": "fileFormatVersion: 2\nguid: 0aaf43323629cd94b80f77508b5e5df7\nTextureImporter:\n fileIDToRecycleName:\n 21300000: bunny_"
},
{
"path": "Assets/Sprites/Bunnies/carrot.png.meta",
"chars": 998,
"preview": "fileFormatVersion: 2\nguid: de362250c89ad5e4faea67651309a36d\nTextureImporter:\n fileIDToRecycleName:\n 21300000: carrot"
},
{
"path": "Assets/Sprites/Bunnies/tower_bunnies.png.meta",
"chars": 1005,
"preview": "fileFormatVersion: 2\nguid: 885e425c85fccd54a854bdc0ac7682ec\nTextureImporter:\n fileIDToRecycleName:\n 21300000: tower_"
},
{
"path": "Assets/Sprites/Bunnies/tower_bunnies@2x.png.meta",
"chars": 1008,
"preview": "fileFormatVersion: 2\nguid: dd20952364264be4bafa677bd019a27f\nTextureImporter:\n fileIDToRecycleName:\n 21300000: tower_"
},
{
"path": "Assets/Sprites/Bunnies.meta",
"chars": 107,
"preview": "fileFormatVersion: 2\nguid: 3795f53b69028044892d738c8db9664f\nfolderAsset: yes\nDefaultImporter:\n userData: \n"
},
{
"path": "Assets/Sprites/License.txt",
"chars": 1854,
"preview": "THIS LICENSE AGREEMENT, is between you (the “Licensee”), and Razeware LLC (http://www.raywenderlich.com) (the “Licensor”"
},
{
"path": "Assets/Sprites/License.txt.meta",
"chars": 93,
"preview": "fileFormatVersion: 2\nguid: d88eccb2082153d4cb76731a55b2b8ed\nTextScriptImporter:\n userData: \n"
},
{
"path": "Assets/Sprites/Tiles/bg_tile.png.meta",
"chars": 999,
"preview": "fileFormatVersion: 2\nguid: 907cad51a106b1e46b8e86e9a199cd45\nTextureImporter:\n fileIDToRecycleName:\n 21300000: bg_til"
},
{
"path": "Assets/Sprites/Tiles/bg_tile@2x.png.meta",
"chars": 1002,
"preview": "fileFormatVersion: 2\nguid: 02b9236213329e348972f816b10c7fd8\nTextureImporter:\n fileIDToRecycleName:\n 21300000: bg_til"
},
{
"path": "Assets/Sprites/Tiles/tile_path_step.png.meta",
"chars": 1006,
"preview": "fileFormatVersion: 2\nguid: 2f958940635368745b1c90b3b11e67a4\nTextureImporter:\n fileIDToRecycleName:\n 21300000: tile_p"
},
{
"path": "Assets/Sprites/Tiles/tile_path_step@2x.png.meta",
"chars": 1009,
"preview": "fileFormatVersion: 2\nguid: 216858c04f59db84b8f2929a270316a2\nTextureImporter:\n fileIDToRecycleName:\n 21300000: tile_p"
},
{
"path": "Assets/Sprites/Tiles.meta",
"chars": 107,
"preview": "fileFormatVersion: 2\nguid: 7c85e353d39294a4da7b4cc2d0b4bf10\nfolderAsset: yes\nDefaultImporter:\n userData: \n"
},
{
"path": "Assets/Sprites.meta",
"chars": 107,
"preview": "fileFormatVersion: 2\nguid: 1a3a02826cda25047868c30b8415cd37\nfolderAsset: yes\nDefaultImporter:\n userData: \n"
},
{
"path": "README.md",
"chars": 407,
"preview": "[](https:"
}
]
// ... and 26 more files (download for full content)
About this extraction
This page contains the full source code of the dgkanatsios/TowerDefense GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 115 files (75.6 KB), approximately 25.4k tokens, and a symbol index with 67 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.