void Foo()
{
StartCoroutine(Bar((bool myReturnValue) => {
if(myReturnValue) { ... }
});
}
IEnumerator Bar(System.Action<bool> callback)
{
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; | |
| /// <summary> | |
| /// Allows a single GameObject layer to be selected from the inspector when applied to an | |
| /// <see langword="int" /> field. Intended to be used when a <see cref="LayerMask" />'s | |
| /// multiselection is not suitable. | |
| /// </summary> | |
| public class LayerFieldAttribute : PropertyAttribute | |
| { | |
| } |
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 Oculus.Interaction; | |
| using Oculus.Interaction.Input; | |
| using System; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| /// <summary> | |
| /// Renders the hand. | |
| /// <br /><br /> | |
| /// |
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.IO; | |
| using UnityEngine; | |
| using UnityEditor; | |
| using UnityEditor.PackageManager; | |
| using PackageInfo = UnityEditor.PackageManager.PackageInfo; | |
| /// <summary> | |
| /// Adds a menu command to find and fix all assets that have mismatched main | |
| /// object names and file names. I.e., "Main Object Name '{0}' does not match |
- press F12 to open browser developer tools, open Network tab
- generate some 3d object https://aidemos.meta.com/segment-anything/editor/convert-image-to-3d
- view Fetch/XHR requests in the network panel
- find graphql/ request (usually the last one), with data like: data: {xfair_sam3d_3dfy_model_gaussian_splat...
- open the data hierarchy to find "gaussian_splat: ..." and it contains url to .ply file
- copy that url and open in browser to download file
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
| // ==UserScript== | |
| // @name Replace YouTube Menu Item with My Channel | |
| // @namespace http://unitycoder.com | |
| // @version 1.3 | |
| // @description Fix youtube layout : https://gist.github.com/unitycoder/cfc311ac35d9c8da15401ca3f34fdf9a | |
| // @author You | |
| // @match https://www.youtube.com/ | |
| // @grant none | |
| // ==/UserScript== |
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.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class Example : MonoBehaviour | |
| { | |
| public List<ListWrapper<Vector3>> example = new List<ListWrapper<Vector3>>(); | |
| public void ExampleFunctions() | |
| { |
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
| // https://discussions.unity.com/t/how-to-disable-searcher-in-6-4/1693707/6 | |
| // You can disable indexing of assets for advance search (this is what is crashing) by modifyin the UserSettings/Search.index file in your project: | |
| { | |
| "name": "Assets", | |
| "type": "asset", | |
| "roots": [ | |
| ], | |
| "includes": [], | |
| "excludes": [ | |
| "Assets/Temp/", |
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
| // https://www.twitch.tv/digitalsalmon | |
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Text.RegularExpressions; | |
| using DigitalSalmon.Extensions; | |
| using UnityEditor; | |
| using UnityEditor.Graphs; | |
| using UnityEditor.Rendering; |
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 UnityEngine; | |
| using UnityEngine.Rendering; | |
| using Random = System.Random; | |
| namespace StellarConquest.Presentation.Unity | |
| { | |
| public class StarfieldMeshBuilder : MonoBehaviour | |
| { | |
| public float SphereRadius = 4000; |