This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class NavWolfAI : MonoBehaviour { | |
// Public | |
public Transform player; | |
public float speed; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class Wander : MonoBehaviour { | |
public float wanderRadius; | |
public float wanderTimer; | |
private Transform target; | |
private NavMeshAgent agent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
/// <summary> | |
/// Creates wandering behaviour for a CharacterController. | |
/// </summary> | |
[RequireComponent(typeof(CharacterController))] | |
public class Wander : MonoBehaviour | |
{ | |
public float speed = 5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Void Function - returns nothing | |
public void DoStuff(){ | |
Console.WriteLine("I'm doing something..."); | |
} | |
// Void Function Call | |
DoStuff(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
public class playerHealth : MonoBehaviour | |
{ | |
public const int maxHealth = 100; | |
public int currentHealth = maxHealth; | |
public Text hp; | |
public Text maxHP; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class follow : MonoBehaviour { | |
public Rigidbody enemy; | |
public float moveSpeed; | |
public Transform target; | |
void Update(){ | |
transform.LookAt(target); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Generic Adventure Game v0.1</title> | |
</head> | |
<body> | |
<script> | |
var score = 0; |
NewerOlder