Placr is now a package that you can download via package manager:
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; | |
public class CorouTweenTest : MonoBehaviour | |
{ | |
[SerializeField] | |
private Vector3 targetPosition; | |
[SerializeField] | |
private float duration = 1; | |
private void Start() |
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; | |
using System.Collections; | |
/// <summary> | |
/// A simple state machine class. Use it to run regular methods or coroutines as states. | |
/// Steps to use: | |
/// 1. Define a private field for the StateMachine object. | |
/// private StateMachine stateMachine; | |
/// 2. Initialize the object in Awake. Pass the MonoBehaviour object to the constructor. |
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; | |
[AttributeUsage(AttributeTargets.Method)] | |
public class ConsoleAccessAttribute : Attribute | |
{ | |
} |
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; | |
/// <summary> | |
/// This template allows to define code that runs independently of any GameObjects or Components created in the editor, even though using Unity events. | |
/// It can be used for any Scene-independent code, including coroutines, without having to manually add a component to a scene. | |
/// </summary> | |
public static class MyStaticCode | |
{ | |
[RuntimeInitializeOnLoadMethod] | |
private static void Initialize() |
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 static class CoroutineWorker | |
{ | |
private class Worker : MonoBehaviour { } | |
private static Worker worker; | |
[RuntimeInitializeOnLoadMethod] |
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; | |
/// <summary> | |
/// Temporarily set a color to be used for Gizmos. | |
/// <example> | |
/// <code> | |
/// using (new GizmosColor(Color.red)) | |
/// { |
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; | |
/// <summary> | |
/// Create a subclass of this class to manipulate particles in Update any way you see fit. | |
/// </summary> | |
[RequireComponent(typeof(ParticleSystem))] | |
[ExecuteInEditMode] | |
public abstract class ParticleManipulator : MonoBehaviour | |
{ | |
new protected ParticleSystem particleSystem { get; private set; } |
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; | |
/// <summary> | |
/// Extension methods to create simple code around working with WeakReferences referencing UnityEngine.Objects. | |
/// </summary> | |
public static class WeakReferenceExtensions | |
{ | |
/// <summary> | |
/// Destroys the referenced object if it still exists. | |
/// Does nothing if no object is referenced or the referenced object is already destroyed. |
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; | |
public class EventOrderTest : MonoBehaviour | |
{ | |
private bool firstUpdate = true; | |
private void Awake() | |
{ | |
Log("Awake"); | |
} |