示例#1
0
    IEnumerator DelayStart(float delay, GameObject target, RestartCallback onRestart)
    {
        yield return(new WaitForSeconds(delay));

        target.SetActive(true);
        onRestart();
    }
示例#2
0
 public void Start(Box bilBoard, RestartCallback callback)
 {
     this.callback   = callback;
     winHeroBilBoard = bilBoard;
     winHeroBilBoard.SetDrawBoxSize(200, 60);
     winHeroBilBoard.SetDrawBoxPos(ContentManager.SCREEN_WIDTH / 2 - 100, ContentManager.SCREEN_HEIGHT / 2 + 130);
     music = ContentManager.GetSound("win").CreateInstance();
     music.Play();
     SetState(State.FADE_IN);
 }
示例#3
0
 private void Restart_Threadsafe()
 {
     if (this.InvokeRequired)
     {
         RestartCallback d = new RestartCallback(Restart_Threadsafe);
         this.Invoke(d, new object[] { });
     }
     else
     {
         MessageBox.Show(Parent, "Failed to create bitmap - dimensions too large.\nPlease specify a smaller image width/height.");
         isPlaying  = false;
         isComplete = true;
         SetStates();
     }
 }
示例#4
0
        public Client(ClientSettings settings, ClientVariables variables, RestartCallback restartCb, WebApiOptions?webOptions = null, CancellationToken cancel = default) : base(cancel)
        {
            settings.Validate();

            // 設定とデータをコピーする
            this.Settings  = settings._CloneDeep();
            this.Variables = variables._CloneDeep();

            this.StartupParams = new OneLineParams(variables.CurrentInstanceArguments._NonNull());

            this.Report_ForceGc = this.StartupParams._HasKey(Consts.DaemonArgKeys.ForceGc);

            // Web オプションを設定する
            if (webOptions == null)
            {
                webOptions = new WebApiOptions();
            }

            if (settings.ServerCertSha._IsEmpty())
            {
                webOptions.Settings.SslAcceptAnyCerts = true;
            }
            else
            {
                webOptions.Settings.SslAcceptCertSHAHashList.Clear();
                webOptions.Settings.SslAcceptCertSHAHashList.Add(settings.ServerCertSha);
                webOptions.Settings.SslAcceptAnyCerts = false;
            }

            // Proxy の利用設定
            webOptions.Settings.UseProxy = settings.UseProxy;

            // RPC Client を作成する
            this.RpcClient = new JsonRpcHttpClient(this.Settings.ServerUrl._NullCheck(), webOptions);

            // RPC インターフェイスを作成する
            this.Rpc = this.RpcClient.GenerateRpcInterface <IRpc>();

            this.RestartCb = restartCb;

            // メインループを開始する
            this.StartMainLoop(MainLoopAsync);
        }
示例#5
0
 public void DelayMyStart(GameObject target, float delayTime, RestartCallback onRestart)
 {
     target.SetActive(false);
     StartCoroutine(DelayStart(delayTime, target, onRestart));
 }