private void OnLoad(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <TextAsset> handle) { var translateTextData = handle.Result; var translater = new Translater(translateTextData.text); this.text = translater.GetText(textId, Language.Japanese); }
private void OnLoadDone(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <GameObject> obj) { // In a production environment, you should add exception handling to catch scenarios such as a null result. GameObject myGameObject = obj.Result; gameObjects.Add(GameObject.Instantiate(myGameObject)); }
public void OnHandIncrease(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <GameObject> card) { SoundManager.instance.PlaySingle(SoundManager.instance.EvilLaugh); card.Result.transform.SetParent(gameObject.GetComponent <GameLogic>().winnerText.transform, false); StartCoroutine(CardAdded(card.Result, otherPlayerIndex, gameObject.GetComponent <GameLogic>().GetStartPos(), gameObject.GetComponent <GameLogic>().endPos)); gameObject.GetComponent <GameLogic>().PlayerList.GetPlayers()[otherPlayerIndex].DrawnCards.Add(int.Parse(card.Result.transform.GetComponentInChildren <TMP_Text>().text)); GetDrawnCards().Add(int.Parse(card.Result.transform.GetComponentInChildren <TMP_Text>().text)); }
IEnumerator WaitForSpawnComplete(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <GameObject> op, int itemNumber) { while (op.IsDone == false) { yield return(op); } OnSpawnComplete(op, itemNumber); }
private void LocAsset_Completed(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <TextAsset> obj) { var N = JSON.Parse(obj.Result.text); foreach (KeyValuePair <string, JSONNode> kvp in (JSONObject)N) { locDict.Add(kvp.Key, kvp.Value.Value); } translationsSet = true; }
private void QuestionAsset_Completed(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <TextAsset> obj) { var N = JSON.Parse(obj.Result.text); foreach (KeyValuePair <string, JSONNode> kvp in (JSONObject)N) { animalList.Add(new Animal(kvp.Value[0].Value, kvp.Value[1].Value, kvp.Value[2].Value)); } QrShowAnimal.scanCode(animalList); }
private void AnswerAsset_Completed(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <TextAsset> obj) { var N = JSON.Parse(obj.Result.text); foreach (KeyValuePair <string, JSONNode> kvp in (JSONObject)N) { answerList.Add(new Answer(kvp.Value[0], kvp.Value[1].Value, kvp.Value[2])); } answerSet = true; canStartQuiz(); }
void OnLoadDone(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <GameObject> obj) { switch (obj.Result.name) { case "MorphJump": morphJump = Instantiate(obj.Result, transform.position, Quaternion.identity, transform); morphjumpAS = morphJump.GetComponent <AudioSource>(); morphJump.SetActive(false); break; case "NormalJump": nJump = Instantiate(obj.Result, transform.position, Quaternion.identity, transform); nJumpAS = nJump.GetComponent <AudioSource>(); nJump.SetActive(false); break; case "Balled": balled = Instantiate(obj.Result, transform.position, Quaternion.identity, transform); balledAS = balled.GetComponent <AudioSource>(); balled.SetActive(false); break; case "Screw": screw = Instantiate(obj.Result, transform.position, Quaternion.identity, transform); screwAS = screw.GetComponent <AudioSource>(); screw.SetActive(false); break; case "ScrewLoop": screwLoop = Instantiate(obj.Result, transform.position, Quaternion.identity, transform); screwLoopAS = screw.GetComponent <AudioSource>(); screwLoop.SetActive(false); break; case "Steps": steps = Instantiate(obj.Result, transform.position, Quaternion.identity, transform); stepsAS = steps.GetComponent <AudioSource>(); steps.SetActive(false); break; case "RollJump": rollLoop = Instantiate(obj.Result, transform.position, Quaternion.identity, transform); rLoopAS = rollLoop.GetComponent <AudioSource>(); rollLoop.SetActive(false); break; case "HyperJump": hyperJump = Instantiate(obj.Result, transform.position, Quaternion.identity, transform); hyperJumpAS = hyperJump.GetComponent <AudioSource>(); hyperJump.SetActive(false); break; } }
public void LoadScene(object key) { isLoading = true; if (handle.IsValid()) { Addressables.Release(handle); } Fade.Instance().Play(Fade.Mode.Out, Color.black, new Color(0.0f, 0.0f, 0.0f, 0.0f), action: () => { handle = Addressables.LoadSceneAsync(key); handle.Completed += Handle_Completed; }); }
void OnLoadTreeDone(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <GameObject> obj) { try { GameObject createdObj = obj.Result; createdObj.transform.position = transform.position; createdObj.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); } catch (UnityException e) { Debug.Log(e); } }
// Start is called before the first frame update void Start() { var sprite = GetComponent <SpriteRenderer> (); if (sprite != null) { operation = Addressables.LoadAssetAsync <Sprite> (AssetRefImage); operation.Completed += op => { // 読み込み終了時 sprite.sprite = op.Result; }; } }
void OnSpawnComplete(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <GameObject> handle, int itemNumber) { if (spawnedObjects.TryGetValue(itemNumber, out var value)) { value.Add(handle.Result); } else { spawnedObjects.Add(itemNumber, new List <GameObject>() { handle.Result }); } }
public void OnAddLastCard(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <GameObject> card) { SoundManager.instance.PlaySingle(SoundManager.instance.Kaching); card.Result.transform.SetParent(gameObject.GetComponent <GameLogic>().winnerText.transform, false); if (otherPlayerIndex == 0) { card.Result.transform.GetComponentInChildren <TMP_Text>().SetText(gameObject.GetComponent <GameLogic>().PlayerList.GetPlayers()[1].DrawnCards[gameObject.GetComponent <GameLogic>().PlayerList.GetPlayers()[1].DrawnCards.Count - 1].ToString()); } else { card.Result.transform.GetComponentInChildren <TMP_Text>().SetText(gameObject.GetComponent <GameLogic>().PlayerList.GetPlayers()[0].DrawnCards[gameObject.GetComponent <GameLogic>().PlayerList.GetPlayers()[0].DrawnCards.Count - 1].ToString()); } StartCoroutine(CardAdded(card.Result, otherPlayerIndex, gameObject.GetComponent <GameLogic>().GetStartPos(), gameObject.GetComponent <GameLogic>().endPos)); gameObject.GetComponent <GameLogic>().PlayerList.GetPlayers()[otherPlayerIndex].DrawnCards.Add(int.Parse(card.Result.transform.GetComponentInChildren <TMP_Text>().text)); GetDrawnCards().Add(int.Parse(card.Result.transform.GetComponentInChildren <TMP_Text>().text)); }
static int Equals(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <UnityEngine.ResourceManagement.ResourceProviders.SceneInstance> obj = (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>)ToLua.CheckObject(L, 1, typeof(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>)); UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <UnityEngine.ResourceManagement.ResourceProviders.SceneInstance> arg0 = StackTraits <UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <UnityEngine.ResourceManagement.ResourceProviders.SceneInstance> > .Check(L, 2); bool o = obj.Equals(arg0); LuaDLL.lua_pushboolean(L, o); ToLua.SetBack(L, 1, obj); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public void OnLoadDomainMaterial(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <Material> obj) { m_DomainTexture = obj.Result; }
public void Init(AsyncOperationHandle <ResourceManagerRuntimeData> rtdOp, AddressablesImpl addressables) { m_RtdOp = rtdOp; m_Addressables = addressables; m_Addressables.ResourceManager.RegisterForCallbacks(); }
void OnPicLoaded(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <Sprite> obj) { GoodIcon.sprite = obj.Result; }
static int get_DebugName(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <object> obj = (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <object>)o; string ret = obj.DebugName; LuaDLL.lua_pushstring(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index DebugName on a nil value")); } }
public void Init(ResourceManager rm, IResourceProvider provider, IResourceLocation location, AsyncOperationHandle <IList <AsyncOperationHandle> > depOp, bool releaseDependenciesOnFailure) { m_DownloadStatus = default; m_ResourceManager = rm; m_DepOp = depOp; if (m_DepOp.IsValid()) { m_DepOp.Acquire(); } m_Provider = provider; m_Location = location; m_ReleaseDependenciesOnFailure = releaseDependenciesOnFailure; SetWaitForCompletionCallback(WaitForCompletionHandler); }
static int set_Destroyed(IntPtr L) { try { UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <object> obj = (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <object>)ToLua.CheckObject(L, 1, typeof(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <object>)); EventObject arg0 = null; if (LuaDLL.lua_isuserdata(L, 2) != 0) { arg0 = (EventObject)ToLua.ToObject(L, 2); } else { return(LuaDLL.luaL_throw(L, "The event 'UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<object>.Destroyed' can only appear on the left hand side of += or -= when used outside of the type 'UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<object>'")); } if (arg0.op == EventOp.Add) { System.Action <UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle> ev = (System.Action <UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle>)arg0.func; obj.Destroyed += ev; } else if (arg0.op == EventOp.Sub) { System.Action <UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle> ev = (System.Action <UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle>)arg0.func; obj.Destroyed -= ev; } return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int IsValid(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <object> obj = (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <object>)ToLua.CheckObject(L, 1, typeof(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <object>)); bool o = obj.IsValid(); LuaDLL.lua_pushboolean(L, o); ToLua.SetBack(L, 1, obj); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int _CreateUnityEngine_ResourceManagement_AsyncOperations_AsyncOperationHandle_object(IntPtr L) { UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <object> obj = new UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <object>(); ToLua.PushValue(L, obj); return(1); }
static int get_Task(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <object> obj = (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <object>)o; System.Threading.Tasks.Task <object> ret = obj.Task; ToLua.PushObject(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Task on a nil value")); } }
static int GetHashCode(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <UnityEngine.ResourceManagement.ResourceProviders.SceneInstance> obj = (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>)ToLua.CheckObject(L, 1, typeof(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>)); int o = obj.GetHashCode(); LuaDLL.lua_pushinteger(L, o); ToLua.SetBack(L, 1, obj); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void Language_Completed(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <IList <TextAsset> > obj) { Msg = obj.Result[0].ToString(); }
/// <summary> /// Provide equality for this struct. /// </summary> /// <param name="other">The operation to compare to.</param> /// <returns>True if the the operation handles reference the same AsyncOperation and the version is the same.</returns> public bool Equals(AsyncOperationHandle <TObject> other) { return(m_Version == other.m_Version && m_InternalOp == other.m_InternalOp); }
private void OnInstantiateDone(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <GameObject> obj) { obj.Result.transform.parent = ContentPanel.transform; obj.Result.transform.localScale = Vector3.one; }
static int get_PercentComplete(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <object> obj = (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <object>)o; float ret = obj.PercentComplete; LuaDLL.lua_pushnumber(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index PercentComplete on a nil value")); } }
protected void OnLoadDone2(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <GameObject> obj) { explosionPr = obj.Result; explosionPr.SetActive(false); }
static int get_Status(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <object> obj = (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <object>)o; UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationStatus ret = obj.Status; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Status on a nil value")); } }