Beispiel #1
0
        public async Task <IActionResult> PutSceneTool([FromRoute] int id, [FromBody] SceneTool sceneTool)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != sceneTool.SceneId)
            {
                return(BadRequest());
            }

            _context.Entry(sceneTool).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SceneToolExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Beispiel #2
0
        public async Task <IActionResult> PostSceneTool([FromBody] SceneTool sceneTool)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.SceneTool.Add(sceneTool);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (SceneToolExists(sceneTool.SceneId))
                {
                    return(new StatusCodeResult(StatusCodes.Status409Conflict));
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetSceneTool", new { id = sceneTool.SceneId }, sceneTool));
        }
Beispiel #3
0
    IEnumerator LoadScene(string scene, int timeWait)
    {
        yield return(new WaitForSeconds(timeWait));

        if (!SwitchManually)
        {
            StartCoroutine(SceneTool.LoadSceneAsyncSwitch(scene));
        }
        else
        {
            StartCoroutine(SceneTool.LoadSceneAsync(scene, UnityEngine.SceneManagement.LoadSceneMode.Single));

            yield return(new WaitUntil(() => SceneTool.LoadingDone));

            SpinnerGO.SetActive(false);

            manuallySwitchText.SetActive(true);

            if (tipsManager)
            {
                tipsManager.TipsText.gameObject.SetActive(false);
            }

            yield return(new WaitUntil(() => Input.anyKey));

            if (!fadeController)
            {
                if (MainCamera != null)
                {
                    Destroy(MainCamera);
                }

                SceneTool.AllowSceneActivation();
            }
            else
            {
                fadeController.FadeInPanel();
                yield return(new WaitUntil(() => !fadeController.isFading()));

                if (MainCamera != null)
                {
                    Destroy(MainCamera);
                }

                SceneTool.AllowSceneActivation();
            }
        }
    }
        public async Task <ActionResult <SceneTool> > PostSceneTool(SceneTool sceneTool)
        {
            _context.SceneTool.Add(sceneTool);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (SceneExists(sceneTool.Id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetSceneTool", new { id = sceneTool.Id }, sceneTool));
        }
Beispiel #5
0
    IEnumerator LoadScene(string scene, int timeWait)
    {
        yield return(new WaitForSeconds(timeWait));

        if (!SwitchManually)
        {
            StartCoroutine(SceneTool.LoadSceneAsyncSwitch(scene));
        }
        else
        {
            StartCoroutine(SceneTool.LoadSceneAsync(scene));

            yield return(new WaitUntil(() => SceneTool.LoadingDone));

            SpinnerGO.transform.parent.gameObject.SetActive(false);

            manuallySwitchText.SetActive(true);

            if (tipsManager)
            {
                tipsManager.TipsText.gameObject.SetActive(false);
            }

            yield return(new WaitUntil(() => Input.anyKey));

            if (!fadeControler)
            {
                SceneTool.AllowSceneActivation();
            }
            else
            {
                fadeControler.FadeInPanel();
                yield return(new WaitUntil(() => !fadeControler.isFading()));

                SceneTool.AllowSceneActivation();
            }
        }
    }
 public static void SceneRefreshSettingList()
 {
     SceneTool.RefreshSettingList(false);
 }
 void OnEnable()
 {
     mTarget = (SceneTool)target;
 }
Beispiel #8
0
 public void GameInit()
 {
     StartCoroutine(SceneTool.LoadScene("scene/game"));
 }
Beispiel #9
0
 void Awake()
 {
     Instance = this;
 }
Beispiel #10
0
 private void CreateRole()
 {
     //StartCoroutine(SceneTool.LoadScene("scene/create_role"));
     StartCoroutine(SceneTool.LoadScene("scene/create_role"));
 }
Beispiel #11
0
 private void LoginSuccess()
 {
     SaveUser();
     PopupManager.ShowTimerPopUp(GameTipsDic.GetTips(GameEnum.LOGIN_SUCCESS));
     StartCoroutine(SceneTool.LoadScene("scene/main"));
 }