text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_suffix|>new JObject { ["action"] = "set_material_color", ["materialPath"] = _matPath, ["color"] = new JArray(1f) // Invalid }; var resultBadColor = ToJObject(ManageMaterial.HandleCommand(paramsBadColor)); Assert.IsFals...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using System; using System.IO; using Newtonsoft.Json.Linq; using NUnit.Framework; using UnityEditor; using UnityEngine; using MCPForUnity.Editor.Tools; using static MCPForUnityTests.Editor.TestUtilities; namespace MCPForUnityTests.Editor.Tools { public class ManageMaterialTests { private ...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|>True(result.Value<bool>("success"), result.ToString()); Assert.AreEqual(2, result["data"]["removedCount"].Value<int>()); Assert.IsNull(go.GetComponent<HingeJoint>(), "HingeJoint should be removed."); Assert.IsNull(go.GetComponent<FixedJoint>(), ...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|>eateChild_SupportsNestedParenting() { string prefabPath = CreateNestedTestPrefab("NestedCreateChildTest"); try { var result = ToJObject(ManagePrefabs.HandleCommand(new JObject { ["action"] = "modify_contents",...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|>nt(stage.prefabContentsRoot.transform, false); var closeResult = ToJObject(ManagePrefabs.HandleCommand(new JObject { ["action"] = "close_prefab_stage", ["saveBeforeClose"] = true })); Assert.IsTrue(cl...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|> // direction may be null for angled faces, but should exist as key Assert.IsTrue(firstFace.ContainsKey("direction"), "Face should have direction key"); } [Test] public void GetMeshInfo_IncludeEdges_ReturnsEdgeData() { if (!_proBuilderInstal...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|>runcation var p1 = new JObject { ["action"] = "get_hierarchy", ["pageSize"] = 10, }; var raw1 = ManageScene.HandleCommand(p1); var res1 = raw1 as JObject ?? JObject.FromObject(raw1); // Assert: envelop...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using NUnit.Framework; using Newtonsoft.Json.Linq; using MCPForUnity.Editor.Tools; using UnityEngine.SceneManagement; namespace MCPForUnity.Tests.EditMode.Tools { [TestFixture] public class ManageSceneMultiSceneTests { [Test] public void GetLoadedScenes_ReturnsAtLeastOne() ...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|>t.FromObject(result); Assert.IsFalse(r.Value<bool>("success"), "Unknown template should fail"); } } } <|fim_prefix|>using NUnit.Framework; using Newtonsoft.Json.Linq; using MCPForUnity.Editor.Tools; namespace MCPForUnity.Tests.EditMode.Tools { [TestFixture] public class Ma...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using NUnit.Framework; using N<|fim_suffix|>result); Assert.IsTrue(r.Value<bool>("success"), r.ToString()); Assert.AreEqual(0, r["data"].Value<int>("repaired")); } } } <|fim_middle|>ewtonsoft.Json.Linq; using MCPForUnity.Editor.Tools; namespace MCPForUnity.Tests.EditMo...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using System; using System.Reflection; using NUnit.Framework; using UnityEngine; using MCPForUnity.Editor.Tools; namespace MCPForUnityTests.Editor.Tools { /// <summary> /// Tests for ManageScript delimiter-checking and token-finding logic, /// specifically covering C# string variants that the...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; using UnityEngine; using Newtonsoft.Json.Linq; using MCPForUnity.Editor.Tools; using System.Reflection; namespace MCPForUnityTests.Editor.Tools { /// <summary> /// In-memory tests for ManageScript validation...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|> { ["propertyPath"] = "animCurve", ["op"] = "set", ["value"] = new JArray { new JObject { ["time"] = 0f, ["value"] = 0f }, new JObject { ["time"] =...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using System; using System.Collections; using Newtonsoft.Json.Linq; using NUnit.Framework; using UnityEditor; using UnityEngine; using UnityEngine.TestTools; using MCPForUnity.Editor.Tools; using MCPForUnityTests.Editor.Tools.Fixtures; using static MCPForUnityTests.Editor.TestUtilities; namespace MCPForU...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|> } finally { UnityEngine.Object.DestroyImmediate(go); } } [Test] public void DetachUIDocument_NoUIDocument_ReturnsError() { var go = new GameObject("UITestObject_DetachNoDoc"); try ...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using System; using System.IO; using Newtonsoft.Json.Linq; using NUn<|fim_suffix|>using MCPForUnity.Editor.Tools; using static MCPForUnityTests.Editor.TestUtilities; namespace MCPForUnityTests.Editor.Tools { public class MaterialDirectPropertiesTests { private const string TempRoot = "Ass...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using System.Collections.Generic; using NUnit.Framework; using UnityEngine; using MCPForUnity.Editor.Helpers; namespace MCPForUnityTests.Editor.Tools { /// <summary> /// Tests specifically for the material and mesh instantiation warnings fix. /// These tests verify that the GameObjectSerializ...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using System; using System.IO; using MCPForUnity.Editor.Tools; using MCPForUnity.Editor.Tools.GameObjects; using Newtonsoft.Json.Linq; using NUnit.Framework; using UnityEditor; using UnityEngine; using static MCPForUnityTests.Editor.TestUtilities; namespace MCPForUnityTests.Editor.Tools { public clas...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|> { // Expect the error log that will be generated LogAssert.Expect(LogType.Error, new Regex("Error converting token to System.Single")); // Add AudioSource component var audioSource = testGameObject.AddComponent<AudioSource>(); // Try to set...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|>orFloat_Test"); } [TearDown] public void TearDown() { if (testGameObject != null) { UnityEngine.Object.DestroyImmediate(testGameObject); } } [Test] public void SetProperty_ArrayForFloat_ReturnsErr...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|>", "log" }, ["count"] = 10 })); Assert.IsTrue(getBefore.Value<bool>("success"), getBefore.ToString()); var entriesBefore = getBefore["data"] as JArray; // Ideally we'd assert count > 0, but other tests/system logs might affect this. // Just ensu...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|>unning error"); Assert.AreEqual("tests_running", data["reason"]?.ToString()); Assert.GreaterOrEqual(data["retry_after_ms"]?.Value<int>() ?? 0, 500); } finally { currentJobIdField.SetValue(null, originalJobId); ...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|> Assert.IsNotNull(result, "Should return serialized component data"); var resultDict = result as Dictionary<string, object>; Assert.IsNotNull(resultDict, "Result should be a dictionary"); // Check for expected top-level keys (matches C...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|>blic void GetType_MissingClassName_ReturnsError() { var jo = Invoke("get_type", new JObject()); Assert.IsFalse((bool)jo["success"]); Assert.IsNotNull(jo["error"], "Should have an error message"); } // ── get_member ─────────────────────────────...
fim
CoplayDev/unity-mcp
csharp
using System; using System.Linq; using System.Reflection; using NUnit.Framework; using MCPForUnity.Editor.Windows; using MCPForUnity.Editor.Windows.Components.Connection; using MCPForUnity.Editor.Constants; using UnityEngine.UIElements; namespace MCPForUnityTests.Editor.Windows.Characterization { /// <summary> ...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using System.Collections; using NUnit.Framework; using UnityEngine; using UnityEngine.TestTools; namespace MCPForUnityTests.PlayMode { /// <summary> /// Basic PlayMode tests to verify the MCP test runner handles PlayMode correctly. /// These tests exercise coroutine-based testing which requir...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|>, try to coerce to https github if possible if origin.startswith("file:"): # Not meaningful for remote option; keep upstream origin_remote = upstream_main else: origin_remote = origin return [ ("[1] Upstream main", upstream_main), ("[2] Upstream beta", u...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>es["func"] params = introspect_params(func) if params: param_lines = ["", "**Parameters:**", ""] for p in params: req = "required" if p.required else "optional" d = p.description or "" param_lines.append(f"- `{p.name}`...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>oundError: print( "Error: npx not found. Please install Node.js and npm.", file=sys.stderr, ) raise if not output_path.exists(): raise RuntimeError(f"MCPB file was not created: {output_path}") print(f"Generated: {output_...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>eplace_once( connection_section, r'scope = MCPServiceLocator\.Server\.IsLocalUrl\(\) \? "local" : "remote";', 'scope = "remote";', ) # 2) Replace Assets/MCPForUnity in the target project if dest_mcp.exists(): if args.backup: ...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>#!/usr/bin/env python3 """ Stress test for EditorStateCache.GetSnapshot() to reproduce GC allocation spikes. This script rapidly polls the editor state to simulate an MCP client that frequently checks Unity's readiness state. Run this while profiling in Unity to see if it causes the GC spikes reported in...
fim
CoplayDev/unity-mcp
python
#!/usr/bin/env python3 import asyncio import argparse import json import os import struct import time from pathlib import Path import random import sys TIMEOUT = float(os.environ.get("MCP_STRESS_TIMEOUT", "2.0")) DEBUG = os.environ.get("MCP_STRESS_DEBUG", "").lower() in ("1", "true", "yes") def dlog(*args): if ...
fim
CoplayDev/unity-mcp
python
#!/usr/bin/env python3 """ Sync release notes from GitHub Releases into: - website/docs/releases.md (full history, grouped by minor) - README.md "Recent Updates" (latest N releases between sentinel markers) Why a sync script: the previous releases.md was hand-maintained and went stale (it claimed v9....
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>rization.py -v --tb=short """ <|fim_prefix|>"""Characterization tests for unity-mcp build and release infrastructure. This package contains pytest-based characterization tests that document the CURRENT behavior of build, release, and testing tools without refactoring. Test Structure: - test_build_releas...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>"""Characterization tests for Build, Release & Testing domain. This module captures the CURRENT behavior of build, release, and testing infrastructure without refactoring. Tests document: 1. Version Bumping Logic & File Updates - Version loading from package.json - Multi-file version sync across J...
fim
CoplayDev/unity-mcp
python
#!/usr/bin/env python3 """Update version across all project files. This script updates the version in all files that need it: - MCPForUnity/package.json (Unity package version) - manifest.json (MCP bundle manifest) - Server/pyproject.toml (Python package version) - Server/README.md (version references) - README.md (fi...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>itle: 'More', items: [ { label: 'GitHub', href: 'https://github.com/CoplayDev/unity-mcp' }, { label: 'PyPI', href: 'https://pypi.org/p/mcpforunityserver' }, ], }, ], copyright: `MIT licensed. Sponsored and maintained by <a href=...
fim
CoplayDev/unity-mcp
javascript
<|fim_suffix|> 'migrations/v6', 'migrations/v8', ], }, 'releases', ], }; export default sidebars; <|fim_prefix|>// @ts-check // Locked information architecture — see the plan file. // Slugs are brand-neutral: no "mcp-for-unity" / "unity-mcp" in any URL. // Pages flagged TODO land in later miles...
fim
CoplayDev/unity-mcp
javascript
<|fim_prefix|>import React, { useState, useRef, useEffect } from 'react'; import styles from './styles.module.css'; /** * Minimal "copy to clipboard" button. Shows a 1.5s confirmation state * after a successful copy. Falls back silently when the Clipboard API * isn't available (older browsers, insecur<|fim_suffix|>...
fim
CoplayDev/unity-mcp
javascript
<|fim_suffix|>eLabel}>{label}</span> </div> ); } <|fim_prefix|>import React from 'react'; import styles from './styles.module.css'; export default function HomeArchitecture() { return ( <section className={styles.section}> <div className={styles.inner}> <div className={styles.header}> ...
fim
CoplayDev/unity-mcp
javascript
<|fim_suffix|> </p> <pre className={styles.citeBlock}> {`@inproceedings{10.1145/3757376.3771417, author = {Wu, Shutong and Barnett, Justin P.}, title = {MCP-Unity: Protocol-Driven Framework for Interactive 3D Authoring}, year = {2025}, isbn = {9798400721366}, publisher = {Associ...
fim
CoplayDev/unity-mcp
javascript
<|fim_prefix|>import React from 'react'; import Link from '@docusaurus/Link'; import styles from './styles.module.css'; const features = [ { n: '01', kicker: 'CONTROL', title: 'Talk to the Editor.', body: 'Drive scenes, GameObjects, scripts, assets, prefabs, and materials with natural language. 43 to...
fim
CoplayDev/unity-mcp
javascript
<|fim_prefix|>import React from 'react'; import Link from '@docusaurus/Link'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import CopyButton from '@site/src/components/CopyButton'; import styles from './styles.module.css'; const UPM_MAIN = 'https://github.com/CoplayDev/unity-mcp.git?path=/MCPFo...
fim
CoplayDev/unity-mcp
javascript
<|fim_suffix|>className={styles.num}>{s.value}</span> <span className={styles.unit}>{s.unit}</span> </dd> </div> ))} </dl> </div> </section> ); } <|fim_prefix|>import React from 'react'; import useDocusaurusContext from '@docusaurus/useDocusaurusCo...
fim
CoplayDev/unity-mcp
javascript
<|fim_prefix|>import Rea<|fim_suffix|>t from '@theme/Layout'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import HomeHero from '@site/src/components/HomeHero'; import HomeStats from '@site/src/components/HomeStats'; import HomeArchitecture from '@site/src/components/HomeArchitecture'; import Ho...
fim
CoplayDev/unity-mcp
javascript
package top.zibin.luban.app.java; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute o...
fim
Curzibn/Luban
java
<|fim_prefix|>package top.zibin.luban.app.java; import android.content.Context; import android.content.Intent; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Bundle; import android.provider.MediaStore; import android.util.Log; import android.widget.Button; import android.widget.ImageV...
fim
Curzibn/Luban
java
<|fim_prefix|>package top.zibin.luban.app.java; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute o<|fim_suffix|>uals(4, 2 + 2); } }<|fim_middle|>n the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentati...
fim
Curzibn/Luban
java
<|fim_suffix|>r = get_error_string(); return env->NewStringUTF(error ? error : "未知错误 (Unknown error)"); } <|fim_prefix|>#include <jni.h> #include <android/log.h> #include <cstring> #include "turbojpeg.h" #define LOG_TAG "TurboJpeg" #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) #defi...
fim
Curzibn/Luban
cpp
<|fim_suffix|>torRunnerChecker")] public static void RunUniTaskAsync() { RunCore().Forget(); } static async UniTaskVoid RunCore() { Debug.Log("Start"); //var r = await UnityWebRequest.Get("https://bing.com/").SendWebRequest().ToUniTask(); //Debug.Log(r.downloadHandl...
fim
Cysharp/UniTask
csharp
<|fim_suffix|> var version = Environment.GetEnvironmentVariable("UNITY_PACKAGE_VERSION"); var versionJson = Path.Combine(Application.dataPath, root, "package.json"); if (File.Exists(versionJson)) { var v = JsonUtility.FromJson<Version>(File.ReadAllText(versionJson)); ...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>t.Value.Invoke(null, Type.EmptyTypes); } } } <|fim_prefix|>#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; using System.Linq; using System.Reflection; using UnityEditor; using UnityEngine; namespace Cysharp.Threading.Tasks.Editor { ...
fim
Cysharp/UniTask
csharp
<|fim_prefix|>#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using UnityEngine; using UnityEditor; using System.Collections.Generic; using System.Linq; using System.Reflection; using System; using UnityEditor.IMGUI.Controls; using Cysharp.Threading.Tasks.Internal; using Syst...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>; } #endregion #region TableColumn Vector2 tableScroll; GUIStyle tableListStyle; void RenderTable() { if (tableListStyle == null) { tableListStyle = new GUIStyle("CN Box"); tableListStyle.ma...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>tialized)) { return; } EnsureInitializedCore(); } void EnsureInitializedCore() { lock (syncLock) { if (!Volatile.Read(ref initialized)) { var f = Interl...
fim
Cysharp/UniTask
csharp
<|fim_suffix|> new UniTask<bool>(this, completionSource.Version); } public UniTask DisposeAsync() { if (!isDisposed) { isDisposed = true; TaskTracker.RemoveTracking(this); completionSource.Tr...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>)"; } } } <|fim_prefix|>#pragma warning disable CS1591 // Missing XML comment for publicly visible type or using System; namespace Cysharp.Threading.Tasks { public readonly struct AsyncUnit : IEquatable<AsyncUnit> { public static readonly AsyncUnit<|fim_middle|> Default = n...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>uals(y); } public int GetHashCode(CancellationToken obj) { return obj.GetHashCode(); } } } <|fim_prefix|>#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; using System.Threading; ...
fim
Cysharp/UniTask
csharp
<|fim_prefix|>#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; using System.Runtime.CompilerServices; using System.Threading; namespace Cysharp.Threading.Tasks { public static class CancellationTokenExtensions { static readonly Action<object> can...
fim
Cysharp/UniTask
csharp
<|fim_prefix|>#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Threading; using UnityEngine; using Cysharp.Threading.Tasks.Triggers; using System; using Cysharp.Threading.Tasks.Internal; namespace Cysharp.Threading.Tasks { public static partial class Cancell...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>galCancellation(self.cancellationToken1); } static void CancellationCallback2(object state) { var self = (ReadAllAsyncEnumerable)state; self.parent.SingalCancellation(self.cancellationToken2); } ...
fim
Cysharp/UniTask
csharp
<|fim_suffix|> public Type BuilderType { get; } public AsyncMethodBuilderAttribute(Type builderType) { BuilderType = builderType; } } } <|fim_prefix|> #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member #pragma warning disable CS0436 ...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>tateMachine stateMachine) where TAwaiter : ICriticalNotifyCompletion where TStateMachine : IAsyncStateMachine { if (runnerPromise == null) { AsyncUniTask<TStateMachine, T>.SetStateMachine(ref stateMachine, ref runnerPromise); ...
fim
Cysharp/UniTask
csharp
<|fim_prefix|> #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; using System.Diagnostics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security; namespace Cysharp.Threading.Tasks.CompilerServices { [StructLayout(L...
fim
Cysharp/UniTask
csharp
<|fim_suffix|> Return; #endif } public static void SetStateMachine(ref TStateMachine stateMachine, ref IStateMachineRunnerPromise runnerPromiseFieldRef) { if (!pool.TryPop(out var result)) { result = new AsyncUniTask<TStateMachine>(); } ...
fim
Cysharp/UniTask
csharp
<|fim_prefix|>#pragma w<|fim_suffix|> return System.Linq.Enumerable.Select(source, selector); } public static IEnumerable<UniTask<TR>> Select<T, TR>(this IEnumerable<T> source, Func<T, int, UniTask<TR>> selector) { return System.Linq.Enumerable.Select(source, selector); ...
fim
Cysharp/UniTask
csharp
<|fim_suffix|> loopRunning = false; core.TrySetCanceled(cancellationToken); return false; } if (initialFrame == -1) { // Time can not touch in threadpool. if (PlayerLoopHe...
fim
Cysharp/UniTask
csharp
<|fim_prefix|> using System; namespace Cysharp.Threading.Tasks { public static class ExceptionExtensions { public static bool IsOperationCanceledException(this Exception exception)<|fim_suffix|> } } <|fim_middle|> { return exception is OperationCanceledException; } <|en...
fim
Cysharp/UniTask
csharp
// asmdef Version Defines, enabled when com.unity.addressables is imported. #if UNITASK_ADDRESSABLE_SUPPORT using Cysharp.Threading.Tasks.Internal; using System; using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; using System.Threading; using UnityEngine.AddressableAssets; using UnityEngi...
fim
Cysharp/UniTask
csharp
<|fim_suffix|> case TweenCancelBehaviour.Complete: tween.Complete(false); break; case TweenCancelBehaviour.CompleteAndCancelAwait: tween.Complete(false); break; case TweenCancelBe...
fim
Cysharp/UniTask
csharp
#if UNITASK_TEXTMESHPRO_SUPPORT using System; using System.Threading; using TMPro; namespace Cysharp.Threading.Tasks { public static partial class TextMeshProAsyncExtensions { public static IAsyncValueChangedEventHandler<string> GetAsyncValueChangedEventHandler(this TMP_InputField inputField) ...
fim
Cysharp/UniTask
csharp
<|fim_suffix|> } catch (Exception ex) { if (ex is OperationCanceledException) return; if (rebindOnError && !repeat) { repeat = true; go...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>ncEnumerable<T> enumerable, CancellationToken cancellationToken) { this.enumerable = enumerable; this.cancellationToken = cancellationToken; } public Enumerator GetAsyncEnumerator() { return new Enumerator(enumerable.GetAsyncEnumerator(c...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>esult(short token); #if SUPPORT_VALUETASK new public UniTaskStatus GetStatus(short token) { return ((IUniTaskSource)this).GetStatus(token); } new public void OnCompleted(Action<object> continuation, object state, short token) { ((IUniTaskS...
fim
Cysharp/UniTask
csharp
<|fim_prefix|>#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; using System.Threading; namespace Cysharp.Threading.Tasks.Internal { // Same interface as System.Buffers.ArrayPool<T> but only provides Shared. internal sealed class ArrayPool<T> { ...
fim
Cysharp/UniTask
csharp
<|fim_prefix|>#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; using System.Collections.Generic; using System.Runtime.CompilerServices; namespace Cysharp.Threading.Tasks.Internal { internal static class ArrayPoolUtil { [MethodImpl(MethodImplOptio...
fim
Cysharp/UniTask
csharp
<|fim_prefix|>#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; using System.Collections.Generic; using System.Runtime.CompilerServices; namespace Cysharp.Threading.Tasks.Internal { internal static class ArrayUtil { [MethodImpl(MethodImplOptions.A...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>reLateUpdate() => RunCore(); void PostLateUpdate() => RunCore(); void LastPostLateUpdate() => RunCore(); #if UNITY_2020_2_OR_NEWER void TimeUpdate() => RunCore(); void LastTimeUpdate() => RunCore(); #endif [System.Diagnostics.DebuggerHidden] void RunCore() ...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>rn fi.Name; } else { var fname = fi.FullName.Replace(Path.DirectorySeparatorChar, '/').Replace(PlayerLoopHelper.ApplicationDataPath, ""); var withAssetsPath = "Assets/" + fname; return "<a href=\"" + withAssetsPath + "\" l...
fim
Cysharp/UniTask
csharp
<|fim_prefix|>#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; using System.Runtime.CompilerServices; namespace Cysharp.Threading.Tasks.Internal { internal static class Error { [MethodImpl(MethodImplOptions.AggressiveInlining)] public sta...
fim
Cysharp/UniTask
csharp
<|fim_suffix|> this.array; T removed = array[head]; array[head] = default(T); MoveNext(ref this.head); size--; return removed; } void Grow() { int newcapacity = (int)((long)array.Length * (long)GrowFactor / 100); ...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>ExceptionCallback(ex); } catch { } } } // find null, loop from tail while (i < j) { var fromTail = loopItems[j]; ...
fim
Cysharp/UniTask
csharp
<|fim_prefix|>using System; using System.Runtime.CompilerServices; namespace Cysharp.Threading.Tasks.Internal <|fim_suffix|>> { static TaskPool<PooledDelegate<T>> pool; PooledDelegate<T> nextNode; public ref PooledDelegate<T> NextNode => ref nextNode; static PooledDelegate() ...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>ector, etc...) here if (t == typeof(Vector2)) return true; if (t == typeof(Vector3)) return true; if (t == typeof(Vector4)) return true; if (t == typeof(Color)) return true; if (t == typeof(Rect)) return true; if (t == typeof(Bounds))...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>; item2 = this.Item2; item3 = this.Item3; } public void Dispose() { StatePool<T1, T2, T3>.Return(this); } } internal static class StatePool<T1, T2, T3> { static readonly ConcurrentQueue<StateTuple<T1, T2, T3>> queue ...
fim
Cysharp/UniTask
csharp
<|fim_prefix|>#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; using System.Collections.Generic; using System.Diagnostics; using System.Text; using System.Threading; using Cysharp.Threading.Tasks.Internal; namespace Cysharp.Threading.Tasks { // public for ad...
fim
Cysharp/UniTask
csharp
<|fim_prefix|>using System; using System.Collections.Generic; using UnityEngine; namespace Cysharp.Threading.Tasks.Internal { internal static class UnityEqualityComparer { public static readonly IEqualityComparer<Vector2> Vector2 = new Vector2EqualityComparer(); public static readonly IEqualit...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>esult.ProtocolError); #else return unityWebRequest.isHttpError || unityWebRequest.isNetworkError; #endif } } #endif }<|fim_prefix|>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine.Netw<|fim_middl...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>ult'), only to create from StartNew()."); } var delta = Stopwatch.GetTimestamp() - startTimestamp; return (long)(delta * TimestampToTicks); } } } }<|fim_prefix|>using System; using System.Diagnostics; namespace Cysharp.Threading.Ta...
fim
Cysharp/UniTask
csharp
<|fim_suffix|> targetBuckets[hashIndex] = new Entry { Key = new WeakReference<TKey>(newKey, false), Value = value, Hash = h }; return true; } else { // ...
fim
Cysharp/UniTask
csharp
<|fim_suffix|> try { TSource value; if (await e.MoveNextAsync()) { value = e.Current; } else { throw Error.NoElements(); } while (a...
fim
Cysharp/UniTask
csharp
using Cysharp.Threading.Tasks.Internal; using System; using System.Threading; namespace Cysharp.Threading.Tasks.Linq { public static partial class UniTaskAsyncEnumerable { public static UniTask<Boolean> AllAsync<TSource>(this IUniTaskAsyncEnumerable<TSource> source, Func<TSource, Boolean> predicate, C...
fim
Cysharp/UniTask
csharp
<|fim_prefix|>using Cysharp.Threading.Tasks.Internal; using System; using System.Threading; namespace Cysharp.Threading.Tasks.Linq { public static partial class UniTaskAsyncEnumerable { public static UniTask<Boolean> AnyAsync<TSource>(this IUni<|fim_suffix|>AsyncEnumerator(cancellationToken); ...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>return new AppendPrepend<TSource>(source, element, true); } public static IUniTaskAsyncEnumerable<TSource> Prepend<TSource>(this IUniTaskAsyncEnumerable<TSource> source, TSource element) { Error.ThrowArgumentNullException(source, nameof(source)); return ne...
fim
Cysharp/UniTask
csharp
<|fim_prefix|>namespace Cysharp.Threading.Tasks.Linq { public static partial class UniTaskAsyncEnumerable { public static IUniTaskAsyncEnumerable<TSource> AsUniTaskAsyncEnumerable<TSource>(this IUniTaskAsync<|fim_suffix|> return source; } } } <|fim_middle|>Enumerable<TSource> source) ...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>AsyncEnumeratorBase<TSource, TResult>)state; bool result; try { if (!self.TryMoveNextCore(self.sourceMoveNext.GetResult(), out result)) { self.SourceMoveNext(); return; } ...
fim
Cysharp/UniTask
csharp
<|fim_prefix|>using System; using System.Threading; using Cysharp.Threading.Tasks.Internal; namespace Cysharp.Threading.Tasks.Linq { public static partial class UniTaskAsyncEnumerable { public static UniTask<double> AverageAsync(this IUniTaskAsyncEnumerable<Int32> source, CancellationToken cancellatio...
fim
Cysharp/UniTask
csharp
using Cysharp.Threading.Tasks.Internal; using System; using System.Collections.Generic; using System.Threading; namespace Cysharp.Threading.Tasks.Linq { public static partial class UniTaskAsyncEnumerable { public static IUniTaskAsyncEnumerable<IList<TSource>> Buffer<TSource>(this IUniTaskAsyncEnumerab...
fim
Cysharp/UniTask
csharp
<|fim_suffix|>ncEnumerator<TResult> GetAsyncEnumerator(CancellationToken cancellationToken = default) { return new _Cast(source, cancellationToken); } class _Cast : AsyncEnumeratorBase<object, TResult> { public _Cast(IUniTaskAsyncEnumerable<object> source, Cancel...
fim
Cysharp/UniTask
csharp
using Cysharp.Threading.Tasks.Internal; using System; using System.Threading; namespace Cysharp.Threading.Tasks.Linq { public static partial class UniTaskAsyncEnumerable { public static IUniTaskAsyncEnumerable<TSource> Concat<TSource>(this IUniTaskAsyncEnumerable<TSource> first, IUniTaskAsyncEnumerabl...
fim
Cysharp/UniTask
csharp