Skip to content

Instantly share code, notes, and snippets.

View Templar2020's full-sized avatar
🤠
Yeeeha!

Templar2020

🤠
Yeeeha!
View GitHub Profile
@Templar2020
Templar2020 / Array.cs
Created November 12, 2018 21:01
Arrays, Lists, ListArrays, Dictionary
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Arrays : MonoBehaviour {
public string[] familyMembers = new string[]{"Dharma","Greg","Zen","Karma","Serenity"};
public int[] numbers;
@Templar2020
Templar2020 / WolfAI.cs
Last active February 28, 2020 18:48
Improved Wolf AI with navmesh
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NavWolfAI : MonoBehaviour {
// Public
public Transform player;
public float speed;
@Templar2020
Templar2020 / Wander.cs
Created March 29, 2018 17:13
Unity Nav Mesh Wander Script
using UnityEngine;
using System.Collections;
public class Wander : MonoBehaviour {
public float wanderRadius;
public float wanderTimer;
private Transform target;
private NavMeshAgent agent;
@Templar2020
Templar2020 / Generic.cs
Created November 7, 2017 01:17
Transforms
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Generic : MonoBehaviour {
public float x;
public float y;
public float z;
public float w;
using UnityEngine;
using System.Collections;
/// <summary>
/// Creates wandering behaviour for a CharacterController.
/// </summary>
[RequireComponent(typeof(CharacterController))]
public class Wander : MonoBehaviour
{
public float speed = 5;
@Templar2020
Templar2020 / Functions.cs
Created October 10, 2017 00:03
C# Functions
// Void Function - returns nothing
public void DoStuff(){
Console.WriteLine("I'm doing something...");
}
// Void Function Call
DoStuff();
using UnityEngine;
using UnityEngine.UI;
public class playerHealth : MonoBehaviour
{
public const int maxHealth = 100;
public int currentHealth = maxHealth;
public Text hp;
public Text maxHP;
using UnityEngine;
using System.Collections;
public class follow : MonoBehaviour {
public Rigidbody enemy;
public float moveSpeed;
public Transform target;
void Update(){
transform.LookAt(target);
@Templar2020
Templar2020 / Destroy.cs
Created November 2, 2016 21:40
3D tank scripts
using UnityEngine;
using System.Collections;
public class Destroy : MonoBehaviour {
public float countDown;
public GameObject explosion;
void OnCollisionEnter(Collision collision){
if(collision.gameObject.name == "Terrain"){
Instantiate(explosion,transform.position,transform.rotation);
@Templar2020
Templar2020 / adventure-array.html
Created October 10, 2016 22:22
Adventure Game with Array and Random Outcomes
<!DOCTYPE html>
<html>
<head>
<title>Generic Adventure Game v0.1</title>
</head>
<body>
<script>
var score = 0;