ソースコード
using JetBrains.Annotations; using Unity.Collections; public static class SourceTemplates { [SourceTemplate] [Macro( Target = "index" )] [Macro( Target = "value" )] public static void @for<T>( this NativeArray<T> self ) where T : struct { for ( var index = 0; index < self.Length; index++ ) { var value = self[ index ]; //$ $END$ } } }
使用例