public void Load(string save_id) { //(pos_x, pos_y, pos_z, form_id, hp) string value = PlayerPrefs.GetString(save_id.ToString()); value = value.Trim(new char[] { '(', ')' }); value = value.Replace(" ", ""); string[] values = value.Split(','); //Position Vector3 pos = new Vector3(float.Parse(values[0]), float.Parse(values[1]), float.Parse(values[2])); transform.position = pos; //Hero Data HeroForm form = HeroSpawner.Instance.FindHeroForm(values[3]); ApplyForm(form); m_status.hp = float.Parse(values[4]); if (m_status.hp <= 0) { StartCoroutine(thr_dead()); } //Content Object Floor floor = FloorHandler.Instance.FindFloorByPosition(pos); if (floor != null) { transform.SetParent(floor.transform.Find("Heroes")); } }
public override void OnInitialized() { base.OnInitialized(); switch (m_ShowObjectType) { case SHOW_OBJECT_TYPE.FORM: // データの設定 int index = Array.FindIndex(UserDataAdmin.Instance.m_StructHeroList, v => v.unique_id == UserDataAdmin.Instance.m_StructPlayer.current_hero_id); m_HeroForm.SetFormDatas(HeroForm.CreateFormDatas(null, null, null), index); m_HeroForm.OnClickNextButtonAction = OnClickFormPreviousButton; m_HeroForm.OnClickPreviousButtonAction = OnClickFormNextButton; break; case SHOW_OBJECT_TYPE.DETAIL: m_HeroDetail.SetDetail(null, OnClickStoryItem); break; case SHOW_OBJECT_TYPE.PREVIEW: break; default: break; } m_ButtonPanel.SetBottomPositionY(82); }
internal static SuperHero ToSuperHero(this HeroForm form) { return(new SuperHero() { Name = form.Name, Strength = form.Strength, Stamina = form.Stamina, Intellect = form.Intellect, Charisma = form.Charisma }); }
void Spawn(HeroForm form) { Hero hero = Instantiate(heroPrefab); hero.transform.position = spawnPoint.bounds.center; hero.transform.SetParent(spawnPoint.transform.parent.transform.Find("Heroes").transform); hero.ApplyForm(form); heroes.Add(hero); }
// PUT: api/Hero/5 public HttpResponseMessage Put(int id, [FromBody] HeroForm form) { if (!ModelState.IsValid) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } _superHeroesRepository.Update(id, form.ToSuperHero(), this.GetUserId()); return(Request.CreateResponse(HttpStatusCode.NoContent)); }
public GamePlayScreen(int x, int y, int width, int height, char renderChar) { _rnd = new Random(); _cars = new Cars(_listOfCars); _showCar = new CarRenderer(_listOfForms); _lane = new Lane(_startingLevelNumber, _cars, Direction.Left); _hero = new Hero(_startingPosition = new Position(_heroStartingXPosition, _heroStartingYPosition)); _heroForm = new HeroForm(_hero, '@'); _heroRenderer = new HeroRenderer(_heroForm); _showLanes = new LaneRenderer(); _frame = new Frame(x, y, width, height, renderChar); _scoreData = new GameData(_hero); _textLine = new TextLine(35, 1, 3, _scoreData.GiveScore()); }
protected override void PageSwitchSetting(bool initalize) { base.PageSwitchSetting(initalize); //-------------------------------- // オブジェクトの取得 //-------------------------------- m_HeroForm = m_CanvasObj.GetComponentInChildren <HeroForm>(); m_HeroForm.SetPositionAjustStatusBar(new Vector2(0, -20), new Vector2(0, -240)); m_HeroSelectButtonPanel = m_CanvasObj.GetComponentInChildren <HeroSelectButtonPanel>(); m_HeroSelectButtonPanel.SetSizeParfect(new Vector2(0, 78)); m_HeroSelectButtonPanel.NextAction = OnClickNextButton; m_HeroSelectButtonPanel.IsActiveReturn = false; UnityUtil.SetObjectEnabledOnce(m_HeroSelectButtonPanel.gameObject, false); // データの設定 int index; if (MainMenuParam.m_HeroSelectReturn) { index = MainMenuParam.m_HeroCurrentInex; MainMenuParam.m_HeroSelectReturn = false; } else { index = Array.FindIndex(UserDataAdmin.Instance.m_StructHeroList, v => v.unique_id == UserDataAdmin.Instance.m_StructPlayer.current_hero_id); } HeroForm.CreateFormDatas(OnClickFaceImage, (v) => { UnityUtil.SetObjectLayer(gameObject, LayerMask.NameToLayer("DRAW_CLIP")); m_HeroForm.SetFormDatas(v, index); }, () => { UnityUtil.SetObjectLayer(gameObject, LayerMask.NameToLayer("GUI")); UnityUtil.SetObjectEnabledOnce(m_HeroSelectButtonPanel.gameObject, true); }); m_HeroForm.OnClickNextButtonAction = OnClickFormNextButton; m_HeroForm.OnClickPreviousButtonAction = OnClickFormPreviousButton; m_HeroForm.OnClickDecisionButtonAction = OnClickDecisionButton; MainMenuManager.Instance.currentCategory = MAINMENU_CATEGORY.HOME; }
// Use this for initialization void Start() { // ページ切り替え用トグルの設定 Context.Toggle = GetComponent <Toggle>(); ToggleGroup toggleGroup = GetComponentInParent <ToggleGroup>(); if (toggleGroup != null) { Context.Toggle.group = toggleGroup; } // コールバック設定 HeroForm heroForm = GetComponentInParent <HeroForm>(); if (heroForm != null) { Context.Toggle.onValueChanged.AddListener(heroForm.OnChangedForm); } }
public void Load(HeroForm form) { hp = form.hp * HeroSpawner.EnhancedRate; damage = form.damage * HeroSpawner.EnhancedRate; moveSpeed = form.moveSpeed; }
//=== public void ApplyForm(HeroForm form) { this.form = form; renderer.sprite = form.sprite; m_status.Load(form); }
public HeroRenderer(HeroForm heroForm) { _heroForm = heroForm; }