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; | |
using System.Collections.Generic; | |
public class StateMachine | |
{ | |
public interface IState | |
{ | |
public void OnEnter(); | |
public void OnExit(); | |
} |
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; | |
using UnityEngine; | |
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Struct)] | |
public class ConditionalEnableAttribute : PropertyAttribute | |
{ | |
public readonly string ConditionalPropertyName; | |
public ConditionalEnableAttribute(string conditionalPropertyName) | |
{ |
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
public static Bounds GetBounds(this GameObject gameObject) | |
{ | |
var bounds = new Bounds(gameObject.transform.position, Vector3.zero); | |
var renderers = gameObject.GetComponentsInChildren<Renderer>(); | |
foreach (var renderer in renderers) | |
{ | |
bounds.Encapsulate(renderer.bounds); | |
} |
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.Linq; | |
using Cinemachine; | |
using UnityEngine; | |
using UnityEngine.Playables; | |
using UnityEngine.Timeline; | |
[ExecuteInEditMode] | |
public class CinemachineBrainTimelineBinder : MonoBehaviour | |
{ | |
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
/// <summary> | |
/// Modes that specify how the control points affect a Bezier curve. | |
/// </summary> | |
public enum BezierControlPointMode | |
{ | |
Aligned, | |
Free, | |
Mirrored, | |
} |
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.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using UnityEditor; | |
using UnityEditor.AddressableAssets.Build; | |
using UnityEditor.AddressableAssets.Build.AnalyzeRules; | |
using UnityEditor.AddressableAssets.Settings; | |
using UnityEngine; |
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.XR.Interaction.Toolkit; | |
public class OffsetGrabInteractable : XRGrabInteractable | |
{ | |
Vector3 interactorPosition; | |
Quaternion interactorRotation; | |
protected override void OnSelectEntered(XRBaseInteractor interactor) | |
{ |
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.VFX; | |
[ExecuteInEditMode] | |
[RequireComponent(typeof(VisualEffect))] | |
public class VisualEffectPlayRate : MonoBehaviour | |
{ | |
[SerializeField, Range(0, 10)] float playRate = 1f; | |
VisualEffect vfx; |
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 UnityEditor; | |
using UnityEditor.IMGUI.Controls; | |
using UnityEngine; | |
public class RotateAroundCircle : MonoBehaviour | |
{ | |
public Color color = Color.cyan; | |
public Vector3 pivot; | |
} |