Skip to content

Instantly share code, notes, and snippets.

View moon-goon's full-sized avatar
🎯
Focusing

moongoon moon-goon

🎯
Focusing
  • Canada
View GitHub Profile
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
public static class SaveLoad {
public static List<Game> savedGames = new List<Game>();
using UnityEngine;
using System.Collections;
[System.Serializable]
public class Character {
public string name;
public Character () {
this.name = "";
using UnityEngine;
using System.Collections;
[System.Serializable]
public class Game {
public static Game current;
public Character warrior;
public Game () {
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class LevelLoadManager : MonoBehaviour {
public GameObject player;
public GameObject trigger;
public Texture2D fadeOutTexture; // the texture that will overlay the screen. This can be a black image or a loading graphic
public float fadeSpeed = 0.2f; // the fading speed
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class ClickToLoad : MonoBehaviour {
public void loadLevel(string nextLevel) {
StartCoroutine(DisplayLoading(nextLevel));
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class LevelLoadManager : MonoBehaviour {
public GameObject player;
public GameObject trigger;
public Texture2D fadeOutTexture; // the texture that will overlay the screen. This can be a black image or a loading graphic
public float fadeSpeed = 0.2f; // the fading speed
using UnityEngine;
using System.Collections;
public class AsyncSample : MonoBehaviour {
IEnumerator Start() {
AsyncOperation async = Application.LoadLevelAsync("name of the scene here");
yield return async;
Debug.Log("Loading complete");
}
}
using UnityEngine;
public class Spawn_Manager : MonoBehaviour {
public Transform[] spawnPoints;
public float invokeTime;
public GameObject spawnObjects;
public int maxInvoke;
private int invokeCount;
using UnityEngine;
public class AI_StateMachine : MonoBehaviour {
public Transform[] target;
public GameObject player;
private int destPoint = 0;
NavMeshAgent agent;
private float distance = 0.0f;
RaycastHit hit
void Start () {
}
void Update () {
bool found = Physics.Raycast(transform.position, transform.forward, hit, 7);
if(!found) return;