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 rounds = new List(); // 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().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() != 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().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 ================================================  ================================================ 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; /// /// Basic singleton implementation /// 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().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().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() == 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 { /// /// Carrot prefab /// 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().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 { /// /// Constant helper variables /// 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; /// /// Drag and drop mechanism /// 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() == 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().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().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().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().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 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(); PathPiecesParent = GameObject.Find("PathPieces"); WaypointsParent = GameObject.Find("Waypoints"); levelStuffFromXML = Utilities.ReadXMLFile(); CreateLevelFromXML(); CurrentGameState = GameState.Start; FinalRoundFinished = false; } /// /// Will create necessary stuff from the object that has the XML stuff /// private void CreateLevelFromXML() { foreach (var position in levelStuffFromXML.Paths) { GameObject go = Instantiate(PathPrefab, position, Quaternion.identity) as GameObject; go.GetComponent().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().sortingLayerName = "Foreground"; Waypoints = GameObject.FindGameObjectsWithTag("Waypoint") .OrderBy(x => x.name).Select(x => x.transform).ToArray(); MoneyAvailable = levelStuffFromXML.InitialMoney; MinCarrotSpawnTime = levelStuffFromXML.MinCarrotSpawnTime; MaxCarrotSpawnTime = levelStuffFromXML.MaxCarrotSpawnTime; } /// /// Will make the arrow collide only with enemies! /// 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(); //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)); } } /// /// Handler for the enemy killed event /// /// /// 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(); } /// /// Starts a new round (if available) and sets the FinalRound flag /// 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); } } /// /// Increase or decrease money available /// /// 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; } } /// /// Show GUI stuff with the deprecated way /// Long live Unity 4.6! /// 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 { /// /// Simple class to hold all our level details /// public class LevelStuffFromXML { public float MinCarrotSpawnTime; public float MaxCarrotSpawnTime; public int InitialMoney; public List Rounds; public List Paths; public List Waypoints; public Vector2 Tower; public LevelStuffFromXML() { Paths = new List(); Waypoints = new List(); Rounds = new List(); } } /// /// Some basic information about each game round /// 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; /// /// A very simple object pooler that duplicates its initial capacity when needed /// Can add custom components on creation /// 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 PooledObjects; public int PoolLength = 10; private Type[] componentsToAdd; public void Initialize() { PooledObjects = new List(); 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(); ArrowPooler.PooledObject = ArrowPrefab; go.transform.parent = this.gameObject.transform; ArrowPooler.Initialize(); } if (AudioPooler == null) { GameObject go = new GameObject("AudioPooler"); AudioPooler = go.AddComponent(); 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 { /// /// Found here /// http://www.bensilvis.com/?p=500 /// /// /// 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)); } /// /// Reads the XML file /// /// A new FileStuffFromXML object 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 ================================================ [![unofficial Google Analytics for GitHub](https://gaforgithub.azurewebsites.net/api?repo=TowerDefenseStyleGame)](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/