Skip to content

Instantly share code, notes, and snippets.

View ProfPollati's full-sized avatar

Christopher Pollati ProfPollati

View GitHub Profile
@ProfPollati
ProfPollati / AddScriptToEachChild.cs
Last active September 21, 2017 22:20
Unity C# - Add a script to each child on startup
using UnityEngine;
public class AddScriptToEachChild : MonoBehaviour {
public float changeValueOfScript = 10.0f;
void Start () {
foreach (Transform child in transform) {
AttachScript(child.gameObject);
}
}
@ProfPollati
ProfPollati / LaunchDuplicator.cs
Created November 5, 2016 19:45
Unity Editor script for class used for launching a duplicate instance of the project. Useful for testing multiplayer.
#if UNITY_EDITOR
// You'll need to include compiler conditions to only compile this if this is going through the Unity Editor, otherwise, you will not be able to compile a Build!
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.SceneManagement;
using System.IO;
using System.Diagnostics;
public class LaunchDuplicator : EditorWindow {
@ProfPollati
ProfPollati / BuildBuddy.cs
Created November 5, 2016 19:44
Unity Editor script for class. Builds and ZIPs executables for GitHub release. Requires Ionic.Zip.Unity DLL.
#if UNITY_EDITOR
using UnityEditor;
using System.Diagnostics;
using UnityEngine;
using System.IO.Compression;
using System.IO;
using Ionic.Zip;
public class BuildBuddy : MonoBehaviour {
[MenuItem("Pollati Rules!/Build Buddy")]