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.Generic; | |
using UnityEngine; | |
using UnityEngine.Pool; | |
using UnityEngine.Profiling; | |
public sealed class ListPoolExample : MonoBehaviour | |
{ | |
private void Update() | |
{ | |
Profiler.BeginSample("Bad"); //for performance measurements |
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.Profiling; | |
public sealed class RaycastExample : MonoBehaviour | |
{ | |
private void Update() | |
{ | |
Profiler.BeginSample("Bad"); //for performance measurements | |
//do 1000 raycasts | |
for (int i = 0; i < 1000; i++) |
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 Godot; | |
public static class GDExtensions | |
{ | |
public static T GetChildByType<T>(this Node node, bool recursive = true) | |
where T : Node | |
{ | |
int childCount = node.GetChildCount(); | |
for (int i = 0; i < childCount; i++) |