// Use this for initialization void Awake() { StartBASE(); nameText = GetComponentsInChildren <Text>()[0]; numText = GetComponentsInChildren <Text>()[1]; release = gameObject.AddComponent <ReleaseFunction>(); release.StartFunction(gameObject, x => Sync(ref main.SR.released_resource[(int)kind], x), x => Sync(ref main.SR.completed_resource[(int)kind], x), x => Requires()); }
// Use this for initialization protected void AwakeInstantAction(ActionEnum.Instant Kind) { StartBASE(); text = GetComponentInChildren <Text>(); this.kind = Kind; need = gameObject.AddComponent <NeedFunciton>(); popUp = main.ActionPopUpPre.StartPopUp(gameObject, main.windowShowCanvas); release = gameObject.AddComponent <ReleaseFunction>(); release.StartFunction(gameObject, x => Sync(ref main.SR.released_instant[(int)kind], x), x => Sync(ref main.SR.completed_instant[(int)kind], x), x => Requires()); instant = gameObject.AddComponent <InstantFunction>(); instant.StartInstant(gameObject, Need); }
// Use this for initialization protected void AwakeLoopAction(ActionEnum.Loop Kind, double maxValue = 60, double plusValue = 1) { StartBASE(); text = GetComponentInChildren <Text>(); if (GetComponentInChildren <Slider>() != null) { slider = GetComponentInChildren <Slider>(); } this.kind = Kind; MaxValue = maxValue; PlusValue = plusValue; popUp = main.ActionPopUpPre.StartPopUp(gameObject, main.windowShowCanvas); need = gameObject.AddComponent <NeedFunciton>(); release = gameObject.AddComponent <ReleaseFunction>(); release.StartFunction(gameObject, x => Sync(ref main.SR.released_loop[(int)kind], x), x => Sync(ref main.SR.completed_loop[(int)kind], x), x => Requires()); progress = gameObject.AddComponent <ProgressFunction>(); progress.StartProgress(gameObject, Need, slider, x => Sync(ref main.SR.paid_loop[(int)kind], x), x => Sync(ref main.SR.currentValue_loop[(int)kind], x)); }
/// <summary> /// This function will only update the local player, not all players. Set the release function to be executed upon this object's release (when claim switches to false) /// </summary> /// <param name="_releaseFunction">The user provided release function</param> public void _LocallySetReleaseFunction(ReleaseFunction _releaseFunction) { m_ReleaseFunction = _releaseFunction; }
public Task <TransactionReceipt> ReleaseRequestAndWaitForReceiptAsync(ReleaseFunction releaseFunction, CancellationTokenSource cancellationToken = null) { return(ContractHandler.SendRequestAndWaitForReceiptAsync(releaseFunction, cancellationToken)); }
public Task <string> ReleaseRequestAsync(ReleaseFunction releaseFunction) { return(ContractHandler.SendRequestAsync(releaseFunction)); }