public CssController(IOptionsSnapshot <BackgroundSetting> bgSetting, ICompositeViewEngine viewEngine, IActionContextAccessor actionAccessor, ConstantUtil constantUtil) { _bgSetting = bgSetting.Value; _viewEngine = viewEngine; _actionAccessor = actionAccessor; _constantUtil = constantUtil; }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Space)) { BackgroundSetting.SwitchScene(0); } }
public AdminController( IOptions <AppSettingsModel> appSettings, IOptionsSnapshot <RegisterSettingsModel> regSettings, IOptionsSnapshot <BackgroundSetting> bgSettings, IOptionsSnapshot <DataSettingsModel> dataSettings, BlogContext db, UsersContext udb, AdminUtil adminUtil, CategoryUtil catUtil, ExpUtil expUtil, MessageUtil msgUtil, UserManager <UserProfile> userManager, IMemoryCache cache, IWebHostEnvironment env, IServiceProvider serviceProvider) { _db = db; _udb = udb; _adminUtil = adminUtil; _catUtil = catUtil; _expUtil = expUtil; _msgUtil = msgUtil; _appSettings = appSettings.Value; _regSettings = regSettings.Value; _bgSettings = bgSettings.Value; _dataSettings = dataSettings.Value; _userManager = userManager; _cache = cache; _env = env; _serviceProvider = serviceProvider; }
private void SaveCurrentParameters() { File.WriteAllText( GetFilePath(SpecialFileNames.LastVrmLoadedFile), _lastVrmLoadFilePath ); BackgroundSetting.SaveSetting(GetFilePath(SpecialFileNames.Background)); LayoutSetting.SaveSetting(GetFilePath(SpecialFileNames.Layout)); LightSetting.SaveSetting(GetFilePath(SpecialFileNames.Light)); StartupSetting.SaveSetting(GetFilePath(SpecialFileNames.Startup)); }
// Use this for initialization void Awake() { if (Instance == null) { Debug.Log("instance=this"); Instance = this; } else if (Instance != this) { Debug.Log("Destroy(gameObject)"); Destroy(gameObject); } DontDestroyOnLoad(this); grab = GetComponent <AudioSource>(); }
void Fly() { flySpeed.y -= curFallSpeed; curFallSpeed += fallSpeed; bodyRb.velocity = flySpeed; if (bodyRb.velocity.y < 0) { if (transform.position.y - curFallSpeed * Time.deltaTime <= 0.6f) //0.5 is hardcode ground height { Vector3 curPos = transform.position; curPos.y = 0.5f; transform.position = curPos; Collider[] smashTargets = Physics.OverlapSphere(transform.position, transform.localScale.x * 0.6f, smashTargetLayer); foreach (Collider col in smashTargets) { col.transform.GetComponent <humanCtrl>().Death(); } screenShake.shakecoefficient = 0.1f + Mathf.Log10(curFallSpeed); screenShake.StopScreen(0.03f); isDeath = true; Instantiate(bloodParticle, bloodParticlePos.position, bloodParticlePos.rotation); GameObject.Find("Second Camera").GetComponent <followAst>().Dismiss(); GameObject.Find("MouseCtrl").GetComponent <mouseCtrl>().RestartAimming(); BackgroundSetting.SetCurHeight(0); BackgroundSetting.CheckStep(); Destroy(gameObject); return; } } else { //Debug.Log(Mathf.Max(Mathf.RoundToInt(transform.position.y - height), 0)); BackgroundSetting.SetCurHeight(Mathf.Max(Mathf.RoundToInt(transform.position.y - height), 0)); if (!BackgroundSetting.gameEnded && BackgroundSetting.highestHeight > BackgroundSetting.stepStoneTarget[4]) { BackgroundSetting.EndTheGame(gameObject); gameObject.name = "arrivedHuman"; DontDestroyOnLoad(this); isLoaded = false; bodyRb.isKinematic = true; } } }
public ActionResult ManageBackgrounds(BackgroundSetting model) { if (model != null && model.Backgrounds.GroupBy(b => b.Name).Any(g => g.Count() > 1)) { ModelState.AddModelError("", "背景名不能有重复"); } if (ModelState.IsValid) { if (model.Backgrounds.Count() > 0) { model.Backgrounds.Last().Name = "new"; } string result = Newtonsoft.Json.JsonConvert.SerializeObject(model, Newtonsoft.Json.Formatting.Indented); string path = Path.Combine(_env.ContentRootPath, "App_Data/BackgroundSetting.json"); System.IO.File.WriteAllText(path, result); CopyValues(_bgSettings, model); } ViewBag.Context = "Background"; var adminmodel = new AdminViewModel(); adminmodel.backgroundsetting = model; return(View("Manage", adminmodel)); }
// Use this for initialization void Awake() { ground = transform.Find("ground"); wallUp = transform.Find("wallUp"); wallDown = transform.Find("wallDown"); wallRight = transform.Find("wallRight"); wallLeft = transform.Find("wallLeft"); wallUpRb = wallUp.GetComponent <Rigidbody>(); wallDownRb = wallDown.GetComponent <Rigidbody>(); wallRightRb = wallRight.GetComponent <Rigidbody>(); wallLeftRb = wallLeft.GetComponent <Rigidbody>(); wallUpPos = wallUp.localPosition; wallDownPos = wallDown.localPosition; wallRightPos = wallRight.localPosition; wallLeftPos = wallLeft.localPosition; wallUpStartPos = wallUp.localPosition; wallDownStartPos = wallDown.localPosition; wallRightStartPos = wallRight.localPosition; wallLeftStartPos = wallLeft.localPosition; curGroundSize = (int)ground.transform.localScale.x; curWallLength = curGroundSize / 2 - curWallThick; //SetUpTarget(new Vector3(0,0,0)); mouseScript = GameObject.Find("MouseCtrl").GetComponent <mouseCtrl>(); normalHuamn = Resources.Load <Transform>("Human/NormalHuman"); thinHuman = Resources.Load <Transform>("Human/ThinHuman"); fuelTankHuman = Resources.Load <Transform>("Human/FuelTankHuman"); skinCount = skin.Length; clothingCount = clothing.Length; shoeCount = shoe.Length; spawnPos.y = wallUp.localPosition.y + 3f; //humanSpawnScript = GetComponent<humanSpawning>(); StartCoroutine("humanSpawningLoop"); BackgroundSetting.curStep = 0; BackgroundSetting.CheckStep(); audioS = GetComponent <AudioSource>(); }
private void LoadCurrentParameters() { StartupSetting.LoadSetting(GetFilePath(SpecialFileNames.Startup)); if (StartupSetting.LoadVrm) { LoadLastLoadedVrm(); } if (StartupSetting.LoadBackgroundSetting) { BackgroundSetting.LoadSetting(GetFilePath(SpecialFileNames.Background)); } if (StartupSetting.LoadLayoutSetting) { LayoutSetting.LoadSetting(GetFilePath(SpecialFileNames.Layout)); } if (StartupSetting.LoadLightSetting) { LightSetting.LoadSetting(GetFilePath(SpecialFileNames.Light)); } }
public void SwitchScene(int num) { BackgroundSetting.SwitchScene(num); }
public UserBackgroundCssTagHelper(IUrlHelper urlHelper, IOptionsSnapshot <BackgroundSetting> bgSetting) { _urlHelper = urlHelper; _bgSetting = bgSetting.Value; }
public ImgUrlRewriteTagHelper(IOptionsSnapshot <BackgroundSetting> bgSetting, Services.HtmlUtil htmlUtil, ConstantUtil constUtil) { _bgSetting = bgSetting.Value; _htmlUtil = htmlUtil; _constantUtil = constUtil; }