├── CheckpointManager.cs ├── CheckpointScript.cs ├── Cursor2D.cs ├── DestroyOffscreen.cs ├── Draggable.cs ├── DualStickController.cs ├── Editor Scripts ├── CheckpointManagerEditor.cs ├── GameManagerEditor.cs ├── InstantPathMovementEditor.cs ├── SmoothPathMovementEditor.cs └── readme.md ├── FlagManager.cs ├── GameManager.cs ├── GoalScript.cs ├── GotoLevel.cs ├── Hover ├── Ground.prefab ├── Ground.prefab.meta ├── HeightFromGround.cs ├── HeightFromGround.cs.meta ├── Hover.cs ├── Hover.cs.meta ├── Hoverer.prefab └── Hoverer.prefab.meta ├── InstantPathMovement.cs ├── InstantiateAtClick.cs ├── IntervalSpawner.cs ├── KillOnTouch.cs ├── LICENSE ├── LookAtMouse.cs ├── MoveToPoint.cs ├── ObjectPooling ├── Bullet.cs ├── Bullet.cs.meta ├── CubePrefab.prefab ├── CubePrefab.prefab.meta ├── MoveForward.cs ├── MoveForward.cs.meta ├── ObjectPooling.cs ├── ObjectPooling.cs.meta ├── ShooterPrefab.prefab └── ShooterPrefab.prefab.meta ├── OscillatingMovement.cs ├── PlatformerMovement.cs ├── Readme.md ├── Script List.txt ├── SmoothPathMovement.cs ├── TriggerAreaLookAtTag.cs └── UrlButton.cs /CheckpointManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | 4 | public class CheckpointManager : MonoBehaviour { 5 | 6 | public List checkpoints = new List(); 7 | public bool allCheckpointsActivated = false; 8 | 9 | // Use this for initialization 10 | void Start () { 11 | 12 | } 13 | 14 | // Update is called once per frame 15 | void Update () { 16 | int totalCheckpoints = checkpoints.Count; 17 | int activatedCheckpoints = 0; 18 | foreach (GameObject checkpoint in checkpoints) 19 | { 20 | if (checkpoint.GetComponent().checkpointActivated) 21 | { 22 | activatedCheckpoints++; 23 | } 24 | } 25 | if (activatedCheckpoints == totalCheckpoints) 26 | { 27 | allCheckpointsActivated = true; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CheckpointScript.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | [RequireComponent(typeof(BoxCollider))] 5 | public class CheckpointScript : MonoBehaviour { 6 | public bool checkpointActivated = false; 7 | 8 | public void OnTriggerEnter(Collider other) 9 | { 10 | checkpointActivated = true; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Cursor2D.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Cursor2D : MonoBehaviour { 5 | 6 | private Ray ray; 7 | private Vector3 origin; 8 | private Vector3 currentPosition; 9 | 10 | public Texture2D cursorGraphic; 11 | public bool showMouse = true; 12 | // Use this for initialization 13 | void Start () { 14 | Screen.showCursor = showMouse; 15 | transform.gameObject.renderer.material.mainTexture = cursorGraphic; 16 | } 17 | 18 | // Update is called once per frame 19 | void Update () { 20 | currentPosition = transform.position; 21 | ray = Camera.main.ScreenPointToRay(Input.mousePosition); 22 | origin = ray.origin; 23 | currentPosition.x = origin.x; 24 | currentPosition.y = origin.y; 25 | transform.position = currentPosition; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DestroyOffscreen.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class DestroyOffscreen : MonoBehaviour { 5 | 6 | // Update is called once per frame 7 | void Update () { 8 | if (renderer.isVisible == false) 9 | { 10 | Destroy(gameObject); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Draggable.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | [RequireComponent(typeof(BoxCollider))] 5 | 6 | public class Draggable : MonoBehaviour { 7 | 8 | private Ray ray; 9 | private Vector3 origin; 10 | 11 | public bool lockX = true; 12 | public bool lockY = true; 13 | public int zIndex = 0; 14 | 15 | void OnMouseDrag() 16 | { 17 | ray = Camera.main.ScreenPointToRay(Input.mousePosition); 18 | origin = ray.origin; 19 | origin.z = zIndex; 20 | if (lockX) 21 | { 22 | origin.y = transform.position.y; 23 | } 24 | if (lockY) 25 | { 26 | origin.x = transform.position.x; 27 | } 28 | ray.origin = origin; 29 | transform.position = ray.origin; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /DualStickController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class DualStickController : MonoBehaviour { 5 | 6 | public float moveSpeed = 1.5f; 7 | public float shootSpeed = 1f; 8 | public GameObject projectile; 9 | public float shootDelay = 0.5f; 10 | 11 | [Header("Extendable Options")] 12 | public GameObject[] _projectilePool; 13 | 14 | private Vector2 moveDirection; 15 | private Vector2 shootDirection; 16 | private Vector2 position; 17 | private bool canFireWeapon = true; 18 | 19 | //Enable the weapon 20 | void enableWeaponFire() 21 | { 22 | canFireWeapon = true; 23 | } 24 | 25 | //Disable the weapon 26 | void disableWeaponFire() 27 | { 28 | canFireWeapon = false; 29 | } 30 | 31 | // Use this for initialization 32 | void Start () { 33 | 34 | } 35 | 36 | // Update is called once per frame 37 | void Update () { 38 | 39 | //Get Vector2 direction of movement 40 | moveDirection = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical")); 41 | 42 | //Convert Vector3 to Vector2 for 2D 43 | position = new Vector2(transform.position.x, transform.position.y); 44 | 45 | //Move by + * *