private void UpdateEquip(Wardrobe type, int cat, int id, int count, bool isShow = true) { switch (type) { case Wardrobe.Armor: UpdateGear(2, cat, id, count, isShow, true); break; case Wardrobe.Bag: UpdateGear(3, cat, id, count, isShow, false); break; case Wardrobe.Cap: UpdateGear(1, cat, id, count, isShow, true); break; case Wardrobe.Waist: UpdateGear(4, cat, id, count, isShow, false); break; case Wardrobe.PendantFace: UpdateWear(1, cat, id, count, isShow); break; case Wardrobe.Inner: UpdateWear(2, cat, id, count, isShow); break; case Wardrobe.Outer: UpdateWear(3, cat, id, count, isShow); break; case Wardrobe.Glove: UpdateWear(4, cat, id, count, isShow); break; case Wardrobe.Trouser: UpdateWear(5, cat, id, count, isShow); break; case Wardrobe.Foot: UpdateWear(6, cat, id, count, isShow); break; } }
public void HandleSingleWardrobe(Wardrobe type, Action <UnityObject> act) { if (_wardrobeController != null) { _wardrobeController.HandleSignleWardrobe(type, act); } }
//穿 private void DressImpl(int id) { Wardrobe pos = SingletonManager.Get <AvatarAssetConfigManager>().GetAvatarType(id); SetLatestWardrobeValue(pos, id); Logger.InfoFormat("CharacterLog-- Dress {0}", id); }
private void RewindWardrobeHairColor(int id, Wardrobe pos) { var hairHandle = _mountWardrobeHandlers[(int)Wardrobe.CharacterHair, ValidP3Index]; if (hairHandle == null) { return; } if (id < 0) { hairHandle.UnRegister(); //Logger.InfoFormat("unregister id:{0}, pos:{1}", id, pos); } if (id > 0) { var assetData = SingletonManager.Get <AvatarAssetConfigManager>().GetAvatarAssetItemById(id); if (assetData == null) { return; } if (ThirdPersonIncluded) { hairHandle.Register(delegate(WardrobeParam param) { param.ApplySkin(assetData.Id); }); _p3Avatar.UpdateAvatarSkin(Wardrobe.CharacterHair, assetData.Id); } } }
public async Task <ActionResult <Wardrobe> > PostWardrobe(Wardrobe wardrobe) { _context.Wardrobe.Add(wardrobe); await _context.SaveChangesAsync(); return(CreatedAtAction("GetWardrobe", new { id = wardrobe.Id }, wardrobe)); }
public async Task <IActionResult> PutWardrobe(int id, Wardrobe wardrobe) { if (id != wardrobe.Id) { return(BadRequest()); } _context.Entry(wardrobe).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WardrobeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
protected override void OnNavigatedTo(NavigationEventArgs e) { wardrobe = e?.Parameter as Wardrobe; // Populate available type list var types = wardrobe.Garments.Select(g => g.Type.ToString()) .Distinct() .Select(t => new TypeWrapper { TypeName = t, TypeSelectCommand = new TypeSelectCommand(this), TypeUnselectCommand = new TypeUnselectCommand(this) }); UnselectedList.ItemsSource = types; // Populate weather info, if available DataContext = new WeatherWrapper(); // Populate weather advice var advices = WeatherUtil.GenerateAdvice() .Select(a => new CodeToLocalizedWeatherAdviceConverter().Convert(a)) .ToList(); WeatherAdvice.ItemsSource = advices.Select(a => (WeatherAdviceWrapper)a); }
// void Awake() { _wardrobe = Manager.Instance.Object.MainCharacter.Wardrobe; if (null != PrefBackButton) { GameObject o = Instantiate(PrefBackButton); o.transform.SetParent(transform, false); Button BackButton = o.GetComponent <Button>(); BackButton.onClick.AddListener(onClickBackButton); } else { Log.Error("not found prefab back button"); } setText(Def.CMD_WARDROBE_NAME); if (null == ContentRect) { Log.Error("not found scroll view's content in wardrobe panel"); return; } if (null == PrefCostumePanel) { Log.Error("not found prefab costume panel"); return; } createCostumePanel(); }
private void ShowEquipmentTip(Wardrobe key, Transform root) { //int count; //var id = _adapter.GetEquipmentIdByWardrobeType(key, out count); //var data = new TipShowData(); //data.CategoryId = (int) ECategory.Avatar; //data.TemID = id; //if (count > 0) data.Num = count; //ShowTip(data, root); ShowTip(() => { int count; var id = _adapter.GetEquipmentIdByWardrobeType(key, out count); if (id <= 0) { return(null); } var data = new TipShowData(); data.CategoryId = (int)ECategory.Avatar; data.TemID = id; if (count > 0) { data.Num = count; } return(data); }, root); }
private void OnTriggerStay2D(Collider2D collision) { if (collision.tag == "Wardrobe" && !lockedInput) { collision.gameObject.GetComponent <ShowUIElement>().EnableUI(); if (Input.GetAxis("Vertical") > 0) { hiddenWardrobe = collision.gameObject.GetComponent <Wardrobe>(); hiddenWardrobe.PlayOpenAnim(); Hide(); } } if (collision.tag == "Door") { if (Input.GetAxis("Vertical") > 0 && !isOpening) { isOpening = true; collision.gameObject.GetComponent <Door>().PlayOpenAnim(); } } if (collision.tag == "LadderBegin") { if (isClimbingDown) { isClimbingDown = false; lockedInput = false; GetComponent <Animator>().SetInteger("Climb", 0); } collision.gameObject.GetComponent <ShowUIElement>().EnableUI(); if (Input.GetAxis("Vertical") > 0) { if (isClimbing == false) { ClimbLadder(); } } } if (collision.tag == "LadderEnd") { if (isClimbing) { isClimbing = false; lockedInput = false; GetComponent <Animator>().SetInteger("Climb", 0); } collision.gameObject.GetComponent <ShowUIElement>().EnableUI(); if (Input.GetAxis("Vertical") < 0) { if (isClimbingDown == false) { StartCoroutine("DisableCollider"); ClimbLadderDown(); } } } }
protected void SetLatestWardrobeValue(Wardrobe type, int value) { var index = (int)type; _rewindFlag = (_latestWardrobeRewindFlag[index] = _latestWardrobeRewindFlag[index] || !CompareUtility.IsApproximatelyEqual(_latestWardrobeValue[index], value)) || _rewindFlag; _latestWardrobeValue[index] = value; }
private void UndressInitAvatar(Wardrobe pos) { if ((int)pos >= _initAvatars.Length) { return; } _initAvatars[(int)pos] = -1; }
public ActionResult DeleteConfirmed(int id) { Wardrobe wardrobe = db.Wardrobes.Find(id); db.Wardrobes.Remove(wardrobe); db.SaveChanges(); return(RedirectToAction("Index")); }
public int GetEquipmentIdByWardrobeType(Wardrobe type, out int count) { var list = _contexts.ui.uI.EquipIdList; var pair = list[(int)type]; count = pair.Value; return(pair.Key); }
private void RewindWardrobeInBody(int id, Wardrobe pos) { if (id < 0) //脱 { if (FirstPersonIncluded) { _p1Avatar.RemoveWardrobe(pos); _mountWardrobeHandlers[(int)pos, ValidP1Index].SetInfo(null); UpdateRenderBelowAnimatorP1(); } if (ThirdPersonIncluded) { _p3Avatar.RemoveWardrobe(pos); _mountWardrobeHandlers[(int)pos, ValidP3Index].SetInfo(null); UpdateRenderBelowAnimatorP3(); } if (!P3HaveInit) { UndressInitAvatar(pos); } } else //穿 { if (!P3HaveInit) { DressInitAvatar(id); return; } var assetData = SingletonManager.Get <AvatarAssetConfigManager>().GetAvatarAssetItemById(id); if (assetData == null) { return; } if (FirstPersonIncluded) { var param = new WardrobeParam(assetData); if (!param.HaveP1Avatar) // 当前部位没有一人称换装,脱掉之前的部位换装 { _p1Avatar.RemoveWardrobe(pos); _mountWardrobeHandlers[(int)pos, ValidP1Index].SetInfo(null); } else { LoadResource(_p1Index, param); } } if (ThirdPersonIncluded) { LoadResource(_p3Index, new WardrobeParam(assetData)); } } Logger.DebugFormat("rewindWardrobe: pos {0} id {1}", pos, id); }
private void ClearWardrobe(Wardrobe wardrobe) { if (wardrobe.EmptySlotsCount >= AppCore.BotvaSettings.Wardrobe.MinEmptySlots) { return; } var smallTicketAction = AppCore.MinerSettings.GetTicketAction(Ticket.Small); var bigTicketAction = AppCore.MinerSettings.GetTicketAction(Ticket.Big); var bigTicketUrl = automaton.Controller.ItemBuilder.GetItemSmallImageUrl(Ticket.Big); var smallTicketUrl = automaton.Controller.ItemBuilder.GetItemSmallImageUrl(Ticket.Small); //Use tickets if (smallTicketAction.ActionType == TicketActionType.Use) { UseTicket(true); } if (bigTicketAction.ActionType == TicketActionType.Use) { UseTicket(false); } //Move tickets to bag automaton.Controller.ClearWardrobe(delegate(string url) { if (smallTicketAction.ActionType != TicketActionType.Use) { return(string.Compare(url, smallTicketUrl, true) == 0); } if (bigTicketAction.ActionType != TicketActionType.Use) { return(string.Compare(url, bigTicketUrl, true) == 0); } return(false); }); //Sell tickets if (smallTicketAction.ActionType == TicketActionType.Sale) { automaton.Controller.Sell(Ticket.Small, Price.Crystals(smallTicketAction.Price)); } if (bigTicketAction.ActionType == TicketActionType.Sale) { automaton.Controller.Sell(Ticket.Big, Price.Crystals(bigTicketAction.Price)); } automaton.Player.UpdateItems(); if (!automaton.Player.WardrobeHasEmtySlots) { AppCore.LogFights.Suggestion("Освободите одевалку.", "При полной одевалке бот не ходит в дозоры и неинвестирует в шмот."); } }
public void ToggleRecramier() { Close_all_anim_icons(); Sofa.SetActive(false); Wardrobe.SetActive(false); Recamier.SetActive(true); Coffeetable.SetActive(false); }
public void UpdateAvatarSkin(Wardrobe pos, int skinId) { var param = _wardrobes[(int)pos]; if (param != null) { param.ApplySkin(skinId); } }
static void Main(string[] args) { Furniture shelf = new Furniture(25, "shelf", true); Wardrobe ward = new Wardrobe(); ward.GetCapacity(); }
public bool TestUse(Wardrobe obj) { if (!TestRepaired(obj)) { return(false); } return(obj.UseCount == 0 && obj.InWorld); }
protected override bool Satisfies(Sim a, Sim target, Wardrobe obj, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (!base.Satisfies(a, target, obj, isAutonomous, ref greyedOutTooltipCallback)) { return(false); } return(CommonPregnancy.SatisfiesTryForBaby(a, target, "WardrobeTryForBaby", isAutonomous, true, ref greyedOutTooltipCallback)); }
protected override bool Satisfies(Sim actor, Sim target, Wardrobe obj, bool isAutonomous, ref GreyedOutTooltipCallback callback) { if (!base.Satisfies(actor, target, obj, isAutonomous, ref callback)) { return(false); } return(CommonWoohoo.SatisfiesWoohoo(actor, target, "WardrobeWoohoo", isAutonomous, true, true, ref callback)); }
public bool IsModelPart(Wardrobe pos) { return(Wardrobe.CharacterFoot == pos || Wardrobe.CharacterGlove == pos || Wardrobe.CharacterHair == pos || Wardrobe.CharacterHairContainer == pos || Wardrobe.CharacterHead == pos || Wardrobe.CharacterInner == pos || Wardrobe.CharacterTrouser == pos); }
public Wardrobe[] GetHideAvatars(int id) { List <int> avatars = _avatarAssetConfigs[id].HideAvatars; Wardrobe[] arr = new Wardrobe[avatars.Count]; for (int i = 0; i < avatars.Count; i++) { arr[i] = (Wardrobe)avatars[i]; } return(arr); }
private void RemoveBag(Wardrobe position) { if (position == Wardrobe.Bag && _bagChanged != null) { _attachment6Parent = null; _attachment7Parent = null; _attachment6ParentInChar = null; _attachment7ParentInChar = null; _bagChanged.Invoke(); } }
public void Unregister(Wardrobe type) { if (_entry[(int)type] == 0) { Logger.Warn("Invalid Unregister"); return; } _entry[(int)type] = 0; --RegisteredCount; }
public void Register(Wardrobe type) { if (_entry[(int)type] != 0) { Logger.Warn("Duplicated Register"); return; } _entry[(int)type] = 1; ++RegisteredCount; }
public Clone() { int numberOfWardrobeTypes = System.Enum.GetValues(typeof(WardrobeManager.WardrobeType)).Length; sex = Wardrobe.GenerateRandomSex(); seed = Wardrobe.GenerateRandomSeed(); nameId = IdentityManager.GetRandomNameID(sex); int typeNo = UnityEngine.Random.Range(0, numberOfWardrobeTypes); wType = (WardrobeManager.WardrobeType)typeNo; }
public void ToggleWardrobe() { Close_all_anim_icons(); icon_anim_door_empty.SetActive(true); icon_anim_door_items.SetActive(true); Sofa.SetActive(false); Wardrobe.SetActive(true); Recamier.SetActive(false); Coffeetable.SetActive(false); }
public void HandleSignleWardrobe(Wardrobe type, Action <UnityObject> act) { if (_p1Avatar != null) { _p1Avatar.HandleSingleAvatar(type, act); } if (_animatorP3 != null) { _p3Avatar.HandleSingleAvatar(type, act); } }
public void SetWardrobeTexture(Wardrobe thePieceType, string theTexture) { if (string.Compare(theTexture, "none", true) == 0 || string.IsNullOrEmpty(theTexture)) return; // gather information about wardrobe if (ModelEntity.GetMesh().NumSubMeshes > 0) { bool needsReload = false; foreach (var subMesh in ModelEntity.GetMesh().GetSubMeshIterator()) { var matPtr = (MaterialPtr)MaterialManager.Singleton.GetByName(subMesh.MaterialName); string suitStr = thePieceType.ToString(); if (subMesh.MaterialName.IndexOf(suitStr, StringComparison.OrdinalIgnoreCase) >= 0) { foreach (var mtrPass in matPtr.GetTechnique(0).GetPassIterator()) { mtrPass.RemoveAllTextureUnitStates(); TextureUnitState baseTex = null; if (WardrobeTextures[(int)Wardrobe.Face] != null) { baseTex = new TextureUnitState(mtrPass, WardrobeTextures[(int)Wardrobe.Face]); } TextureUnitState wardTex = new TextureUnitState(mtrPass, theTexture); wardTex.SetColourOperation(LayerBlendOperation.LBO_ALPHA_BLEND); needsReload = true; if (baseTex!=null) mtrPass.AddTextureUnitState(baseTex); mtrPass.AddTextureUnitState(wardTex); } WardrobeTextures[(int)thePieceType] = theTexture; break; } if (needsReload) matPtr.Reload(); } } }
public ClothingItem Get(Wardrobe.Models.ClothingType type) { return wardRobe.Get(type); }