void Awake() { _pointManager = GameObject.Find("Point Manager").GetComponent<PointManager>(); _equipmentManager = GameObject.Find("Equipment Manager").GetComponent<EquipmentManager>(); _weaponText = GameObject.Find("Weapon Upgrade Level Text").GetComponent<Text>(); _timerText = GameObject.Find("Beard Upgrade Level Text").GetComponent<Text>(); _healthText = GameObject.Find("Helmet Upgrade Level Text").GetComponent<Text>(); UpdateText(); }
public void SetItemInfo(ShopGui owner, Item item, EquipmentManager.ItemCategory itemCategory) { this.NameLabel.text = item.ItemName; this.PriceLabel.text = item.Cost.ToString("N0"); if (itemCategory == EquipmentManager.ItemCategory.Weapon) { this.InfoLabel.text = (item as Weapon).Damage.ToString("N0"); this.InfoIcon.spriteName = "DamageIcon"; } else { this.InfoLabel.text = (item as Armor).ArmorValue.ToString("N0"); this.InfoIcon.spriteName = "ArmorIcon"; } this.owner = owner; this.item = item; this.itemCategory = itemCategory; }
private void Start() { uiManager = UIManager.Instance; rt = GetComponent <RectTransform>(); equipmentManager = EquipmentManager.Instance; }
void Awake() { this.Ammunition = new Dictionary <AmmoTypes, int>(); this.equipmentManager = this.GetComponent <EquipmentManager>(); }
/// <summary> /// ボタンがハイライトされているときの処理を設定 /// </summary> void settingSelectButton(Button button, EquipmentManager.Equipment selectEquipment) { string[] paramStr = new string[8]; paramStr[0] = "HP"; paramStr[1] = "MP"; paramStr[2] = "Atk"; paramStr[3] = "Def"; paramStr[4] = "Int"; paramStr[5] = "Mgr"; paramStr[6] = "Agl"; paramStr[7] = "Luc"; int[] currentParams = new int[8]; currentParams[0] = PlayerManager.selectPlayer.HP; currentParams[1] = PlayerManager.selectPlayer.MP; currentParams[2] = PlayerManager.selectPlayer.Atk; currentParams[3] = PlayerManager.selectPlayer.Def; currentParams[4] = PlayerManager.selectPlayer.Int; currentParams[5] = PlayerManager.selectPlayer.Mgr; currentParams[6] = PlayerManager.selectPlayer.Agl; currentParams[7] = PlayerManager.selectPlayer.Luc; button.OnDisableAsObservable() .Where(_ => !firstSelect) .Subscribe(_ => { firstSelect = true; }) .AddTo(this); button.OnUpdateSelectedAsObservable() //.Where(_ => firstSelect) .Subscribe(_ => { var selectPlayer = PlayerManager.selectPlayer; var currentEquipmentID = selectPlayer.BaseParam.currentEquipment[(int)part]; var currentEquipment = EquipmentManager.getEquipment(currentEquipmentID); int[] deltaParams = new int[8]; deltaParams[0] = selectEquipment.HP - currentEquipment.HP; deltaParams[1] = selectEquipment.MP - currentEquipment.MP; deltaParams[2] = selectEquipment.Atk - currentEquipment.Atk; deltaParams[3] = selectEquipment.Def - currentEquipment.Def; deltaParams[4] = selectEquipment.Int - currentEquipment.Int; deltaParams[5] = selectEquipment.Mgr - currentEquipment.Mgr; deltaParams[6] = selectEquipment.Agl - currentEquipment.Agl; deltaParams[7] = selectEquipment.Luc - currentEquipment.Luc; for (int i = 0; i < deltaParams.Length; ++i) { if (deltaParams[i] == 0) { paramTexts[i].text = currentParams[i].ToString(); paramTexts[i].color = Color.black; continue; } paramTexts[i].text = currentParams[i].ToString() + " -> " + (currentParams[i] + deltaParams[i]).ToString(); if (deltaParams[i] < 0) { paramTexts[i].color = Color.red; continue; } paramTexts[i].color = Color.blue; } firstSelect = false; }) .AddTo(this); }
void Start() { eqManager = EquipmentManager.instance; inventory = Inventory.instance; }
void Start() { inventoryManagerScript = GameObject.Find("InventoryManager").GetComponent<InventoryManager>(); shopManagerScript = inventoryManagerScript.GetComponent<ShopManager>(); equipmentManagerScript = inventoryManagerScript.GetComponent<EquipmentManager>(); }
private void Awake() { instance = this; }
private void buyMemoryCard(EquipmentManager.Equipment<EquipmentManager.MemCardData> memCard) { // If it's not already owned and the player has enough money if (memCard.data.owned == false && PlayerProfile.profile.money >= memCard.data.cost) { PlayerProfile.profile.money -= memCard.data.cost; memCard.data.owned = true; if (PlayerProfile.profile.memoryCardCapacity < memCard.data.capacity) { PlayerProfile.profile.memoryCardCapacity = memCard.data.capacity; } // Check to see if this should unlock the "Memento" achievement if (memCard.data.capacity == 32) { achievementManager.SetProgressToAchievement ("Memento", 1f); } PlayerProfile.profile.save (); equipManager.saveEquipment (); // Refresh the buttons to ensure they look correct after purchase configureMemoryCardButtons (); } }
/// <summary> /// /// </summary> public abstract void MainRelease(EquipmentManager manager);
/// <summary> /// Off hand action. Right Click /// </summary> public abstract void SecondaryAction(EquipmentManager manager);
public void UpdateItem(Item item, EquipmentManager.ItemCategory category) { if (category == EquipmentManager.ItemCategory.Weapon) { this.CurrentWeapon = (item as Weapon); this.weaponRenderer.sprite = this.CurrentWeapon.Sprite; } else if (category == EquipmentManager.ItemCategory.Armor) { this.CurrentArmor = (item as Armor); this.armorRenderer.sprite = this.CurrentArmor.Sprite; } else if (category == EquipmentManager.ItemCategory.Boots) { this.CurrentBoots = (item as Armor); this.bootsRenderer.sprite = this.CurrentBoots.Sprite; } else if (category == EquipmentManager.ItemCategory.Helmet) { this.CurrentHelmet = (item as Armor); this.helmetRenderer.sprite = this.CurrentHelmet.Sprite; } this.totalArmorValue = this.CurrentArmor.ArmorValue + this.CurrentBoots.ArmorValue + this.CurrentHelmet.ArmorValue; PlayerInfoGui.Instance.UpdateDamageLabel(this.CurrentWeapon.Damage); PlayerInfoGui.Instance.UpdateArmorLabel(this.totalArmorValue); }
/// <summary> /// Main hand action. Left click /// </summary> public abstract void MainAction(EquipmentManager manager);
private void SwitchItemCategory(EquipmentManager.ItemCategory newCategory) { if (this.currentCategory == newCategory) { return; } this.currentCategory = newCategory; this.Scrollbar.value = 0f; for (int i = 0; i < this.listOfWeapons.Count; i++) { this.listOfWeapons[i].SetActive(this.currentCategory == EquipmentManager.ItemCategory.Weapon); } for (int i = 0; i < this.listOfArmors.Count; i++) { this.listOfArmors[i].SetActive(this.currentCategory == EquipmentManager.ItemCategory.Armor); } for (int i = 0; i < this.listOfBoots.Count; i++) { this.listOfBoots[i].SetActive(this.currentCategory == EquipmentManager.ItemCategory.Boots); } for (int i = 0; i < this.listOfBoots.Count; i++) { this.listOfHelmets[i].SetActive(this.currentCategory == EquipmentManager.ItemCategory.Helmet); } }
private GameObject SpawnItem(int counter, Item item, EquipmentManager.ItemCategory itemCategory) { Vector3 spawnPos = Vector3.up * ((counter * -49) - 25f); GameObject go = Instantiate(this.ItemObj, Vector3.zero, Quaternion.identity) as GameObject; go.GetComponent<ItemShopGui>().SetItemInfo(this, item, itemCategory); go.transform.parent = this.ItemContainer; go.transform.localPosition = spawnPos; go.transform.localScale = Vector3.one; return go; }
void Awake() { _equipmentManager = GameObject.Find("Equipment Manager").GetComponent<EquipmentManager>(); _sprites = Resources.LoadAll<Sprite>(_loadPath); _spriteRenderer = GetComponent<SpriteRenderer>(); }
void Awake() { instance = this; inventory = InventoryManager.instance; }
void Start() { m_PostProcessVolume = GetComponent <PostProcessVolume>(); equipmentManager = gameManager.GetComponent <EquipmentManager>(); playerStats = GetComponent <PlayerStats>(); }
private void Awake() { manager = gameManager.GetComponent <EquipmentManager>(); temp = icon.sprite; }
public override void MainRelease(EquipmentManager manager) { reloading = false; }
/// <summary> /// /// </summary> public abstract void SecondaryRelease(EquipmentManager manager);
void Awake() { _equipmentManager = GameObject.Find("Equipment Manager").GetComponent<EquipmentManager>(); }
public override void SecondaryRelease(EquipmentManager manager) { //no release action }
// Start is called before the first frame update void Start() { equipmentManager = GetComponent <EquipmentManager>(); }
protected override void SlotClicked() { Debug.Log("Equipment Slot Clicked"); EquipmentManager.GetInstance().Unequip((Equipment)item); }
public async Task <ActionResult> DeleteEquipment(long equipmentId) { await EquipmentManager.DeleteEquipment(equipmentId); return(RedirectToAction("ManageEquipment")); }
public void SetEquipmentManager(EquipmentManager playerEquipmentManager) { equipmentManager = playerEquipmentManager; Initialize(); }
public async Task <ActionResult> ManageEquipment() { var model = new ManageEquipmentViewModel(await EquipmentManager.GetAllEquipment()); return(View(model)); }
private void Start() { equipmentManager = EquipmentManager.instance; playerInput = GetComponent <PlayerInput>(); }
void Awake() { instance = this; }
private void Start() { //Sets equipmentManager to the EquipmentManager instance. equipmentManager = EquipmentManager.instance; }
void OnDestroy() { instance = null; }
// Start is called before the first frame update void Start() { equipmentManager = EquipmentManager.instance; }
public void UpdateImageURL(string uuid, string type, string imageURL) { switch (type.ToUpper()) { case "EVENT": EventManager evtManager = new EventManager(Globals.DBConnectionKey, this.GetAuthToken(Request)); var eres = evtManager.Get(uuid); if (eres.Code != 200) { return; } Event e = (Event)eres.Result; if (e != null) { e.Image = imageURL; evtManager.Update(e); } break; case "PROFILEMEMBER": break; case "PROFILE": ProfileManager profileManager = new ProfileManager(Globals.DBConnectionKey, Request.Headers.Authorization?.Parameter); var res2 = profileManager.Get(uuid); if (res2.Code != 200) { return; } var tmp = (Profile)res2.Result; tmp.Image = imageURL; profileManager.UpdateProfile(tmp); break; case "ACCOUNT": AccountManager am = new AccountManager(Globals.DBConnectionKey, this.GetAuthToken(Request)); var res = am.Get(uuid); if (res.Code != 200) { return; } Account a = (Account)res.Result; if (a != null) { a.Image = imageURL; am.Update(a); } break; case "USER": UserManager um = new UserManager(Globals.DBConnectionKey, this.GetAuthToken(Request)); var res52 = um.Get(uuid); if (res52.Code != 200) { return; } User u = (User)res52.Result; u.Image = imageURL; um.UpdateUser(u, true); break; case "ITEM": InventoryManager im = new InventoryManager(Globals.DBConnectionKey, this.GetAuthToken(Request)); var res3 = im.Get(uuid); if (res3.Code != 200) { return; } InventoryItem i = (InventoryItem)res3.Result; i.Image = imageURL; im.Update(i); break; case "PLANT": case "BALLAST": case "BULB": case "CUSTOM": case "FAN": case "FILTER": case "PUMP": case "VEHICLE": Debug.Assert(false, "TODO MAKE SURE CORRECT TABLE IS UPDATED"); EquipmentManager em = new EquipmentManager(Globals.DBConnectionKey, this.GetAuthToken(Request)); dynamic d = em.GetAll(type)?.FirstOrDefault(w => w.UUID == uuid); if (d != null) { d.Image = imageURL; em.Update(d); } break; } }
private void Update() { //if (Time.timeScale > 0f) { if (!animator.GetBool("isAttacking") && !animator.GetBool("isPushing") && !animator.GetBool("isThrowing")) // && !isDashing) { walkInput = new Vector2(Input.GetAxisRaw(walkHorizontalInput + inputExtensionString), Input.GetAxisRaw(walkVerticalInput + inputExtensionString)); /* * if (GameManager.singleGame) * { * if(walkInput.x == 0f) * walkInput.x = Input.GetAxisRaw(walkHorizontalInput + "2"); * if(walkInput.y == 0f) * walkInput.y = Input.GetAxisRaw(walkVerticalInput + "2"); * } */ if (walkInput.x != 0 && walkInput.y != 0) { walkInput /= 1.5f; } if (walkInput != Vector2.zero) { if (!isDashing) { speed = walkSpeed * (1 + (4 * timeSlowMoEffectValue)); } animator.SetBool("isWalking", true); if (walkInput.y < 0) { animator.SetInteger("direction", 2); if (prevWalkState == 0) { comboKeys += "D"; } } else if (walkInput.y > 0) { animator.SetInteger("direction", 0); if (prevWalkState == 0) { comboKeys += "U"; } } else if (walkInput.x > 0) { animator.SetInteger("direction", 1); if (prevWalkState == 0) { comboKeys += "R"; } } else if (walkInput.x < 0) { animator.SetInteger("direction", 3); if (prevWalkState == 0) { comboKeys += "L"; } } if (walkInput.x > 0) { sprRenderer.flipX = true; } else { sprRenderer.flipX = false; } } else { speed = 0f; animator.SetBool("isWalking", false); } } //Potion if (Input.GetButtonDown(attackInput + inputExtensionString)) { potionTimer = potionAttackButtonPressMinTime; } if (Input.GetButtonUp(attackInput + inputExtensionString)) { potionTimer = -1000f; } if (potionTimer <= 0 && potionTimer > -900f) { EquipmentManager eqMan = GetComponent <EquipmentManager>(); if (eqMan != null && eqMan.GetCurrentEquipment() != null && eqMan.GetCurrentEquipment().Length > 1 && eqMan.GetCurrentEquipment()[1] != null) { eqMan.UsePotion(GetComponent <EquipmentManager>().GetCurrentEquipment()[1]); if (playerNo == 1) { Subtitles.AddPlayer1Subtitle("Potion Used"); } else if (playerNo == 2) { Subtitles.AddPlayer2Subtitle("Potion Used"); } } else { if (playerNo == 1) { Subtitles.AddPlayer1Subtitle("Potion not equipped"); } else if (playerNo == 2) { Subtitles.AddPlayer2Subtitle("Potion not equipped"); } } potionTimer = -1000f; potionUsed = true; } else if (potionTimer > 0f && potionTimer > -900f) { potionTimer -= Time.deltaTime; } //Attack if (actionPoints >= attackActionDeplete && !animator.GetBool("isAttacking") && !animator.GetBool("isPushing") && !animator.GetBool("isThrowing") && !isDashing && (Input.GetButtonUp(attackInput + inputExtensionString) /*|| GameManager.singleGame && Input.GetButtonDown(attackInput + "2")*/)) { if (!potionUsed) { comboKeys += "A"; if (comboKeys != "UA" && comboKeys != "RA" && comboKeys != "DA" && comboKeys != "LA") { animator.SetBool("isAttacking", true); speed = attackSpeed * (1 + (4 * timeSlowMoEffectValue)); /* * if (playerNo == 1) * Subtitles.AddPlayer1Subtitle("TEST_Player 1 Attacking"); * else if (playerNo == 2) * Subtitles.AddPlayer2Subtitle("TEST_Player 2 Attacking"); */ if (animator.GetBool("isWalking")) { attackSpeedTimer = attackSpeedTime; } else { int dir = animator.GetInteger("direction"); if (dir == 0) { walkInput.x = 0; walkInput.y = 1; } else if (dir == 1) { walkInput.x = 1; walkInput.y = 0; } else if (dir == 2) { walkInput.x = 0; walkInput.y = -1; } else if (dir == 3) { walkInput.x = -1; walkInput.y = 0; } attackSpeedTimer = attackSpeedTime / 2f; } actionPoints -= attackActionDeplete; if (aud != null && TogglesValues.sound) { aud.PlayOneShot(weaponSounds[weaponPossession.weaponID + 1], weaponSoundVolumes[weaponPossession.weaponID + 1]); } } } potionUsed = false; } //Push if (pushPossible != null && !animator.GetBool("isPushing") && !animator.GetBool("isAttacking") && !animator.GetBool("isThrowing") && !isDashing && (comboKeys == "UU" || comboKeys == "RR" || comboKeys == "DD" || comboKeys == "LL")) { animator.SetBool("isPushing", true); speed = 0f; if (playerNo == 1) { Subtitles.AddPlayer1Subtitle("TEST_Player 1 Pushing"); } else if (playerNo == 2) { Subtitles.AddPlayer2Subtitle("TEST_Player 2 Pushing"); } actionPoints -= pushActionDeplete; pushPossible = null; comboKeys = ""; } //Dash if (actionPoints >= dashActionDeplete && !isDashing && !animator.GetBool("isAttacking") && !animator.GetBool("isPushing") && !animator.GetBool("isThrowing") && (comboKeys == "UU" || comboKeys == "RR" || comboKeys == "DD" || comboKeys == "LL" || comboKeys == "UR" || comboKeys == "UL" || comboKeys == "DR" || comboKeys == "DL" || comboKeys == "RU" || comboKeys == "RD" || comboKeys == "LU" || comboKeys == "LD") && hitCheck.knockback == Vector2.zero) { isDashing = true; dashTimer = dashTime / (1 + (4 * timeSlowMoEffectValue)); speed = dashSpeed * (1 + (4 * timeSlowMoEffectValue)); gameObject.layer = 10; actionPoints -= dashActionDeplete; if (aud != null && TogglesValues.sound) { aud.PlayOneShot(dashSound); } comboKeys = ""; } //Throw if (!animator.GetBool("isThrowing") && !animator.GetBool("isAttacking") && !animator.GetBool("isPushing") && !isDashing && (((keyComboTimer <= keyComboMaxTimeGap / 3.8f) && (comboKeys == "UA" || comboKeys == "RA" || comboKeys == "DA" || comboKeys == "LA")) || ((Input.GetButtonDown(attackInput + inputExtensionString)) && (Input.GetButtonDown(walkHorizontalInput + inputExtensionString) || Input.GetButtonDown(walkVerticalInput + inputExtensionString)))) ) { animator.SetBool("isThrowing", true); speed = attackSpeed * (1 + (4 * timeSlowMoEffectValue)); attackSpeedTimer = attackSpeedTime / 2f; actionPoints -= throwActionDeplete; if (throwFXObject && nextFXdelay < 0f) { GameObject FX = Instantiate(throwFXObject, transform.position, Quaternion.Euler(0f, 0f, 0f)); nextFXdelay = MINIMUM_TIME_BETWEEN_FX; } comboKeys = ""; } if (actionPoints < 1f) { actionPoints += regenerateActionPointsPerSec * Time.deltaTime * (1 + (4 * timeSlowMoEffectValue)); } if (isDashing && dashTimer <= 0f) { isDashing = false; speed = walkSpeed * (1 + (4 * timeSlowMoEffectValue)); gameObject.layer = 8; } else if (dashTimer > 0f || (attackSpeedTimer > 0f && attackSpeedTimer < attackSpeedTime / 3f)) { GameObject ghostSpriteFX = Instantiate(dashFXObject, transform.position, Quaternion.Euler(0f, 0f, 0f)); SpriteRenderer GSFX_sprRend = ghostSpriteFX.GetComponent <SpriteRenderer>(); if (dashFXObject && nextFXdelay < 0f) { GameObject FX = Instantiate(dashFXObject, transform.position, Quaternion.Euler(0f, 0f, 0f)); FX.GetComponent <SpriteRenderer>().sprite = sprRenderer.sprite; nextFXdelay = MINIMUM_TIME_BETWEEN_FX; } GSFX_sprRend.sprite = sprRenderer.sprite; if (name == "Player1") { GSFX_sprRend.color = Color.red; GSFX_sprRend.material.color = Color.red; } else { GSFX_sprRend.color = Color.green; GSFX_sprRend.material.color = Color.green; } } if ((animator.GetBool("isAttacking") || animator.GetBool("isThrowing")) && attackSpeedTimer <= 0f) { speed = 0f; } if (keyComboTimer >= keyComboMaxTimeGap) { comboKeys = ""; } if (comboKeys != "") { keyComboTimer += Time.deltaTime; } else { keyComboTimer = 0f; } if (hitComboTimer <= 0f) { hitComboCount = 0; } else { hitComboTimer -= Time.deltaTime; } if (criticalHitTimePauseTimer <= 0f) { if (Time.timeScale >= 0.05f && Time.timeScale <= 0.1f) { Time.timeScale = 1f; } else if (timeSlowMoTimer > 0f) { timeSlowMoTimer -= Time.unscaledDeltaTime; Time.timeScale = Mathf.Lerp(Time.timeScale, 0.5f, 0.025f); ImageEffect.SetImageEffectMaterialIndex(2); timeSlowMoEffectValue = Mathf.Lerp(timeSlowMoEffectValue, 0.25f, 0.025f); ImageEffect.SetImageEffectValue(timeSlowMoEffectValue); } else if (timeSlowMoTimer <= 0f) { if (Time.timeScale >= 0.5f && Time.timeScale != 1f) { if (Time.timeScale <= 0.505f && aud != null && TogglesValues.sound) { aud.PlayOneShot(slowMoToNormalSound); } Time.timeScale = Mathf.Lerp(Time.timeScale, 1f, 0.05f); if (Time.timeScale >= 0.98f) { Time.timeScale = 1f; } } if (timeSlowMoEffectValue <= 0f) { ImageEffect.SetImageEffectMaterialIndex(0); ImageEffect.SetImageEffectValue(0.04f); timeSlowMoEffectValue = 0f; } else { timeSlowMoEffectValue -= Time.unscaledDeltaTime / 5f; ImageEffect.SetImageEffectValue(timeSlowMoEffectValue); } } } else { Time.timeScale = 0.06f; criticalHitTimePauseTimer -= Time.unscaledDeltaTime; } animator.speed = 1f * (1 + (4 * timeSlowMoEffectValue)); attackSpeedTimer -= Time.deltaTime; dashTimer -= Time.deltaTime; nextFXdelay -= Time.deltaTime; // don't spam FX every frame prevWalkState = walkInput == Vector2.zero ? 0 : 1; } }
private void SetInstance() { instance = this; }
public void InitBodywork(int bodyworkID, TankComponent tank, MoveComponent move, GameobjectComponent gameobjectComponent) { gameobjectComponent.animator.SetInteger("state", 0); // enter the idle animation EquipBodywork(EquipmentManager.GetInstance().GetBodywork(bodyworkID), tank, move, gameobjectComponent); }
protected InventoryManager inventory; //needed for the Item at the itemarray position public void Start() { equipmentManager = GameObject.Find("Equipment").GetComponent <EquipmentManager>(); //needed for adding ITems to the slots of the UI and the PLayer GO inventory = GameObject.Find("Inventory").GetComponent <InventoryUIConnection>().inventory; //needed for adding ITems to the slots of the UI and the PLayer GO }
// ============================================================================= // ============================================================================= // METHODS UNITY --------------------------------------------------------------- void Awake() { base.Awake (); PlayerMov = Player.GetComponent<PlayerMovement> (); //dan //PlayerRot = Player.GetComponent<PlayerRotation> (); Layer = gameObject.GetComponent<LayerSetterElement> (); EquipManager = GameObject.FindObjectOfType ( typeof(EquipmentManager) ) as EquipmentManager; // = NULL !!! Da "Equiptment" vom Player aus dem ISS-Projekt nicht übernommen wurde. }
public void Awake() { equipmentManager = GetComponent <EquipmentManager>(); }
void Awake() { instance = this; manager = EquipmentManager.instance; }