public void GetChosen() { endingTurn = attacking = holdingWeapon = false; regularModeObject.SetActive(false); SetAsPlayer(); LevelFlow.SetTurnPart(LevelFlow.TurnPart.soldierWeaponChoice); canvas.gameObject.SetActive(true); for (int j = weaponSelectionIcons.Count - 1; j >= 0; j--) { Destroy(weaponSelectionIcons[j]); } weaponSelectionIcons.Clear(); soldierInfoPivot.gameObject.SetActive(false); foreach (var weapon in playerInstance.weaponInformations.weapons) { WeaponSelectionIcon icon = Instantiate(weaponSelectionButtonPrefab, weaponSelectionGrid).GetComponent <WeaponSelectionIcon>(); Item item = weapon.weaponPrefab.GetComponent <Item>(); icon.weapon = weapon; icon.soldier = this; icon.iconImage.sprite = item.icon; icon.nameText.text = item.itemName; icon.weaponCountText.text = weapon.usagesForStart.ToString(); icon.uIInteractable.tooltipText.text = item.description; if (weapon.usagesForStart <= 0) { icon.bgImage.color = Color.grey; icon.button.enabled = false; } weaponSelectionIcons.Add(icon.gameObject); } }
public void EndTurn() { endingTurn = true; attacking = false; holdingWeapon = false; Game.Player.timer.TurnOffTimer(); Game.Player.timer.SetTimer(3); LevelFlow.SetTurnPart(LevelFlow.TurnPart.soldierFinish); Game.Player.UnequipItem(); }
private void DoEndTurn() { Game.Player.timer.TurnOffTimer(); soldierInfoPivot.gameObject.SetActive(true); Vector3 lookAtVec = transform.position + Game.Player.mainCamera.transform.forward; lookAtVec.y = transform.position.y; transform.LookAt(lookAtVec); LevelFlow.SetTurnPart(LevelFlow.TurnPart.turnStart); SetAsNotPlayer(); regularModeObject.SetActive(true); }
public void StartAttackMode() { attacking = true; timeOfAttackingStart = Time.timeSinceLevelLoad; spawnedItem.TurnOn(); LevelFlow.SetTurnPart(LevelFlow.TurnPart.soliderAttack); if (LevelFlow.levelSetupInfo.timerGame) { Game.Player.timer.SetTimer(7); StartCoroutine(StartAttackModeCoroutine(7)); } else { StartCoroutine(StartAttackModeCoroutine(Mathf.Infinity)); } }
public void ChooseWeapon(WeaponSelectionIcon icon) { holdingWeapon = true; canvas.gameObject.SetActive(false); GameObject weapon = Instantiate(icon.weapon.weaponPrefab); spawnedItem = weapon.GetComponent <Item>(); spawnedItem.Set(this); Game.Player.EquipItem(spawnedItem); LevelFlow.SetTurnPart(LevelFlow.TurnPart.soldierMovement); if (LevelFlow.levelSetupInfo.timerGame) { Game.Player.timer.SetTimer(10); StartCoroutine(ChooseWeaponCoroutine(10)); } else { StartCoroutine(ChooseWeaponCoroutine(Mathf.Infinity)); } }
public void Button_Ready() { canvas.gameObject.SetActive(false); LevelFlow.SetTurnPart(LevelFlow.TurnPart.characterChoice); }