public virtual void show(float duration, OnCompleteDelegate completeEvent = null) { // print(name+" show start"); if (canvasGroup == null) { canvasGroup = GetComponent <CanvasGroup>(); } canvasGroup.DOKill(true); canvasGroup.alpha = 0; activate(); if (canvasGroup) { canvasGroup.DOFade(1, duration).OnComplete( () => { // print(name+"show complete"); if (completeEvent != null) { completeEvent(); } else { // print(name+"no complete event"); } }); } else { Debug.LogError("No canvas Group!"); } }
public static void CreateInstant(OnCompleteDelegate onCompleteDelegate = null) { if (Instant == null) { Instant = new SGConfig(onCompleteDelegate); } }
public void Run(ProcessStartInfo processStartInfo, WixFiles theWixFiles, OnCompleteDelegate onComplete) { if (IsBusy) { throw new WixEditException("OutputPanel is already busy."); } wixFiles = theWixFiles; onCompletedOutput = onComplete; invokeClearRTF = new DelegateClearRtf(ClearRtf); invokeOutput = new DelegateOutput(Output); invokeOutputLine = new DelegateOutputLine(OutputLine); invokeOutputStart = new DelegateOutputStart(OutputStart); invokeOutputDone = new DelegateOutputDone(OutputDone); invokeProcessDone = new DelegateProcessDone(ProcessDone); isCancelled = false; buildMenu.MenuItems.Add(cancelMenuItem); outputTextBox.Cursor = Cursors.WaitCursor; currentProcessStartInfo = processStartInfo; currentProcessThread = new Thread(new ThreadStart(InternalThreadRunSingle)); currentProcessThread.Start(); }
public virtual void hide(float duration, OnCompleteDelegate completeEvent = null) { if (!canvasGroup) { canvasGroup = GetComponentsInChildren <CanvasGroup>(true)[0]; } if (canvasGroup) { canvasGroup.alpha = 1; canvasGroup.DOKill(true); canvasGroup.DOFade(0, duration).OnComplete( () => { if (completeEvent != null) { completeEvent(); } gameObject.SetActive(false); // print(name+"hide complete"); }); } else { Debug.LogError(name + "CanvasGroup not exist"); } }
/// <summary> /// Default Constructor /// </summary> public SolverSection() { InitializeComponent(); OnComplete = SolverComplete; solverEvalStatus = EvalStatus.NotStarted; treeViewer.OnVisualisationClick += new EventHandler<VisEventArgs>(OnVisualisationClick_TreeViewer); visualisationContainerLocalNodes.OnVisualisationClick += new EventHandler<VisEventArgs>(OnVisualisationClick_LocalNode); this.Disposed += new EventHandler(SolverSection_Disposed); }
public void Reset() { if (OnComplete != null) { OnComplete(this); } OnComplete = null; played = false; thing = null; cue = null; }
/// <summary> /// Tear down totally. /// </summary> public void Reset() { if (OnComplete != null) OnComplete(this); DetachSound(); OnComplete = null; thing = null; spatial = false; BokuGame.Release(ref cue); cue = null; }
public ItemBlueprint( int id, string name, string desc, float buildCost, OnCompleteDelegate completionFunc ) { this.ID = id; this.Name = name; this.Description = desc; this.BuildCost = buildCost; this.OnCompleteFunc = completionFunc; this.TechRequirement = 0; }
/// <summary> /// This method initiates the asynchronous service call. /// </summary> /// <param name="handlerMethod"> /// The on complete" callback that will be invoked after the service call completes. /// </param> public void ProcessRequest(OnCompleteDelegate handlerMethod) { try { if (handlerMethod != null) { this.OnComplete = handlerMethod; } // Create the Http request. HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(this.Uri); // Set http method. request.Method = this.RequestMethod.ToString().ToUpper(); string identityToken = null; if (this.ClientIdentity != null) { // In case of valid identity provided by the client, // get the identity token identityToken = this.ClientIdentity.GetEncodedToken(); } if (!string.IsNullOrEmpty(identityToken)) { // if the identity token is not null, set the authorization header. request.Headers[HttpRequestHeader.Authorization] = identityToken; } if (this.RequestMethod == HttpMethod.Post) { request.BeginGetRequestStream(new AsyncCallback(this.RequestCallback), request); } else { request.BeginGetResponse(new AsyncCallback(this.ResponseCallback), request); } } catch (Exception ex) { this.Result.Status = Status.Error; this.Result.Exception = ex; // In case any error exception at UI thread context, OnCompleteRequest should be // called by UI thread. this.OnCompleteRequest(); } }
public Technology( int id, string name, int[] requiredTechs, string desc, float cost, OnCompleteDelegate completeFunc ) { this.ID = id; this.Name = name; this.Description = desc; this.RequiredTechs = new int[] { 0, 1, 3 }; // = requiredTechs; // example this.IsResearched = false; }
private SGConfig(OnCompleteDelegate onCompleteDelegate = null) : base() { #if UNITY_IOS configInitPath = "Cogfig_init_IOS.plist"; #else configInitPath = "Cogfig_init_Android.plist"; #endif this.onCompleteDelegate = onCompleteDelegate; TextAsset textAsset = Resources.Load(configInitPath, typeof(TextAsset)) as TextAsset; if (textAsset.bytes != null) { Dictionary <string, object> plist = Plist.readPlist(DESUtil.Decrypt(textAsset.bytes, FileUtil.sKey)) as Dictionary <string, object>; _data = (Dictionary <string, object>)plist ["Data"]; remoteUrl = GetStringValue("", "ConfigPath", "RemoteConfig"); localPath = GetStringValue("", "ConfigPath", "LocalConfig"); extendLocalPath = Application.persistentDataPath + "//" + localPath; } }
public void Run(ProcessStartInfo[] processStartInfos, WixFiles theWixFiles, OnCompleteDelegate onComplete) { if (IsBusy) { throw new WixEditException("OutputPanel is already busy."); } wixFiles = theWixFiles; onCompletedOutput = onComplete; isCancelled = false; buildMenu.MenuItems.Add(cancelMenuItem); outputTextBox.Cursor = Cursors.WaitCursor; currentProcessStartInfos = processStartInfos; currentProcessThread = new Thread(new ThreadStart(InternalThreadRunMultiple)); currentProcessThread.Start(); }
public void OnComplete(string keyName, OnCompleteDelegate action, ref Dictionary <string, ConverterDefinition> masterLookup) { lock (_lock) { //if (_isComplete) throw new InvalidOperationException("Already marked complete"); if (_onCompleteActions == null) { _onCompleteActions = new List <dynamic>(); } if (!_isComplete) { _onCompleteActions.Add(new { KeyName = keyName, Action = action }); } else // already complete so fire immediately { action(ref masterLookup, keyName, this.Lookup); } } }
public FindChangesWorker(PerforceConnection Perforce, OnCompleteDelegate OnComplete) { this.Perforce = Perforce; this.MainThreadSyncContext = SynchronizationContext.Current; this.OnComplete = OnComplete; }
public Quest RegisterCompleteCallback(OnCompleteDelegate callback) { this.OnComplete = callback; return(this); }
public void Run(ProcessStartInfo processStartInfo, OnCompleteDelegate onComplete) { Run(processStartInfo, null, onComplete); }
public virtual void hide(OnCompleteDelegate completeEvent = null) { hide(duration); }
public void SetOnTimeOutDelegate(OnCompleteDelegate onCompleteDelegate) { this.onCompleteDelegate = onCompleteDelegate; }
/// <summary> /// Sets the delegate to run on completion /// </summary> /// <param name="del">delegate to set</param> public void SetOnComplete(OnCompleteDelegate del) { this.del = del; }
private SGConfig(string remoteUrl, string localPath = "", OnCompleteDelegate onCompleteDelegate = null) : base(remoteUrl, localPath) { this.onCompleteDelegate = onCompleteDelegate; }
public virtual void show(OnCompleteDelegate completeEvent = null) { show(duration, completeEvent); }
public void SetCompleteHandle(OnCompleteDelegate handler) { completeHandler = handler; }
public static IEnumerator FadeCanvas(CanvasGroup canvas, float startAlpha, float endAlpha, float duration, OnCompleteDelegate onComplete) { // keep track of when the fading started, when it should finish, and how long it has been running</p> <p>&a var startTime = Time.time; var endTime = Time.time + duration; var elapsedTime = 0f; // set the canvas to the start alpha – this ensures that the canvas is ‘reset’ if you fade it multiple times canvas.alpha = startAlpha; // loop repeatedly until the previously calculated end time while (Time.time <= endTime) { elapsedTime = Time.time - startTime; // update the elapsed time var percentage = 1 / (duration / elapsedTime); // calculate how far along the timeline we are if (startAlpha > endAlpha) // if we are fading out/down { canvas.alpha = startAlpha - percentage; // calculate the new alpha } else // if we are fading in/up { canvas.alpha = startAlpha + percentage; // calculate the new alpha } yield return(new WaitForEndOfFrame()); // wait for the next frame before continuing the loop } canvas.alpha = endAlpha; // force the alpha to the end alpha before finishing – this is here to mitigate any rounding errors, e.g. leaving the alpha at 0.01 instead of 0 onComplete(); }
public virtual void hide(OnCompleteDelegate completeEvent) { hide(duration, completeEvent); }