Skip to content

Instantly share code, notes, and snippets.

@ZeredaGames
ZeredaGames / WhatWeNeedFirst.cs
Created February 27, 2019 09:29
Part 1 of WindowEditor Tutorial
#region using
using UnityEngine;//<-- Mainly these two for now
#if UNITY_EDITOR
using UnityEditor;//<-- Mainly these two for now
#endif
//using UnityEngine.UI;
//using UnityEngine.SceneManagement;
//using System;
//using System.Collections;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class DoorLockManager : MonoBehaviour
{
public List<bool> lockStates;
public Renderer rend;
//Realized by looking at it that each manager deals with 1 door and has 2 for: A = unlocked, B = locked.
public List<HoriDoorManager> doorManagers;
/*using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagment;
using System.Collection;
using System.Collection.Generic;
namespace ZG
{
//[MenuItem ("testingPhase/${FileName} ")]
public class ${FileName} : MonoBehaviour
"#"region Update in editor NOT in play mode.// Remove the " "'s
"#"if UNITY_EDITOR// Remove the " "'s
[UnityEditor.Callbacks.DidReloadScripts]
public static void OnRecompiledScripts() {
UnityEditor.EditorApplication.playmodeStateChanged -= PlayModeStateChanged;
UnityEditor.EditorApplication.playmodeStateChanged += PlayModeStateChanged;
PlayModeStateChanged();
}
@ZeredaGames
ZeredaGames / SpawnPrefab.cs
Created February 23, 2019 11:03
Answers Help script
namespace ZeredaGamesEngine.UnityAwnsers.Help.Examples{
///<summary>
/// A basic tutorial script on how to spawn a prefab via code.
///</summary>
public class SpawnPrefab: MonoBehaviour{
[Header("Final Rendition - SpawnPrefab Script Class By Zereda-Games"),Space,Tooltip("The tag on the health text component we want to display on- 'Text Component'.[ Notes for Unity Awnsers.com] anyone who would like to change this post for future unity changes I give mediators full rights to do so.The script really is basic, and first write-up only took around 45 min. Editing took a few days but that's just because there are a ton of questions not many people see these post before they get buried. I made this with all of you by the comments for DanProd by request, it was a simple micro-challenge I took on to test my skill's. I started out on Udemy in 2015 and have been writing c# as much as i can for the past 3 years... If you are using this script in your kit, all i ask is to give the following
@ZeredaGames
ZeredaGames / BasicPauseMenu.cs
Last active February 23, 2019 09:17
Made for someone new on Answers, all this is is a basic example of many little toolets and a pause menu was made while doing so. All was written with no helpers in a TXT doc. when run on unity to fix and arrors. Made to work with at least Unity 2018 3,3,f1 but should be usable by anything from Unity 5.5x-present as far as i am aware.
#region Licensing
/*Free to use all are basic functions, made in the course of 2 hour's, top's! Hope u all like it, should be pretty simple to use.*/
#endregion
#region usings
using UnityEngine;
using UnityEngine.SceneManagement;
#endregion
#region namespace
using UnityEngine;
using System.Collections;
namespace UnityDevelopment.BowlMaster
{
[RequireComponent (typeof(Ball))]
public class BallDragLaunch : MonoBehaviour
{
they are usually used for holding up a method on doing something
A little mini level manager for yeah ;)
public float WaitTime;
public int SceneIndexToLoad=4;
public bool DebugMode=false;
${ScriptName}$ Instance;
namespace ZeredaGameEngine
{
public class ExampleScript:MonoBehaviour
{
[Header("Public Settings:")]
[Tooltip ("The tag on the health text component we want to display on")]
public string
TagOnHealthText = "HealthTxt";
@ZeredaGames
ZeredaGames / DrawOnGizmoDrawWireSphere.cs
Created December 30, 2018 03:23
Unity Gizmo Function
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class DrawOnGizmoDrawWireSphere : MonoBehaviour {
public float gizmoSize = 4;
public object gizmoedObject;
public void OnDrawGizmos()
{