This file contains hidden or 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 Unity.AI.MCP.Editor.Helpers; | |
| using Unity.AI.MCP.Editor.ToolRegistry; | |
| using UnityEditor; | |
| using UnityEngine; | |
| using UnityEngine.Rendering; | |
| public enum MaterialConversionScope { All, Selected } | |
| public class ConvertBuiltinMaterialsParams { | |
| [McpDescription( |
This file contains hidden or 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
| // Example 2 — Customizing the node with XML hints (Unity 6.5+) | |
| // | |
| // The same three ingredients as Example 1, plus reflection hints that change | |
| // how the node looks and behaves in Shader Graph: | |
| // | |
| // funchints -> customize the node as a whole (name, search category...) | |
| // paramhints -> customize an individual port (display name, color picker, | |
| // slider range, default value...) | |
| // | |
| // Hint validation is strict and type-aware: |
This file contains hidden or 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
| // Adapted from Game AI Pro - Crytek’s Target Tracks Perception System | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| namespace Perception { | |
| public class PerceptionAgent : MonoBehaviour { | |
| #region Fields | |
| [Header("Sight")] | |
| [SerializeField] float viewRange = 15f; |
This file contains hidden or 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 ParticleController : MonoBehaviour { | |
| [SerializeField] ComputeShader compute; | |
| [SerializeField] Mesh mesh; | |
| [SerializeField] Material material; | |
| [SerializeField] int particleCount = 10000; | |
| [SerializeField] float areaSize = 10f; | |
| [SerializeField] float spawnDistanceFromCamera = 8f; |
This file contains hidden or 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 enum SimpleBuildPieceType { Floor, Wall, Door } | |
| public class SimpleBuildPart : MonoBehaviour { | |
| [SerializeField] SimpleBuildPieceType pieceType = SimpleBuildPieceType.Floor; // identity for occupancy and placer logic | |
| public SimpleBuildPieceType Type => pieceType; | |
| public void SetPieceType(SimpleBuildPieceType value) => pieceType = value; |
This file contains hidden or 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; | |
| using System.Diagnostics; | |
| using System.Text; | |
| using UnityEditor; | |
| using UnityEditor.SceneManagement; | |
| using UnityEngine; | |
| using UnityEngine.SceneManagement; | |
| using Debug = UnityEngine.Debug; |
This file contains hidden or 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.UIElements; | |
| using Unity.Properties; | |
| public static class DataBindingHelper { | |
| static string GetDefaultTargetProperty<T>() where T : VisualElement { | |
| return typeof(T) == typeof(Label) ? "text" : "value"; | |
| } | |
| /// <summary> |
This file contains hidden or 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
| (async function () { | |
| // ================= utilities ================= | |
| function secondsToHMS(seconds) { | |
| seconds = Math.floor(seconds); | |
| const h = Math.floor(seconds / 3600); | |
| const m = Math.floor((seconds % 3600) / 60); | |
| const s = seconds % 60; | |
| return `${h}h ${m}m ${s}s`; |
NewerOlder