SHE'S PULLING HER SPARK OUT
This commit is contained in:
parent
b968ed3060
commit
11d1cbb543
7 changed files with 2912 additions and 6 deletions
File diff suppressed because it is too large
Load diff
16
Assets/Scripts/AbilityUIHandler.cs
Normal file
16
Assets/Scripts/AbilityUIHandler.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class AbilityUIHandler : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/AbilityUIHandler.cs.meta
Normal file
2
Assets/Scripts/AbilityUIHandler.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e7a1d413a4177c296860fb5599a53a0b
|
||||||
31
Assets/Scripts/AbilityUIObject.cs
Normal file
31
Assets/Scripts/AbilityUIObject.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using TMPro;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class AbilityUIObject : MonoBehaviour
|
||||||
|
{
|
||||||
|
[Header("Ability Identification")]
|
||||||
|
[SerializeField] private Image abilityIcon;
|
||||||
|
[SerializeField] private TextMeshProUGUI abilityName;
|
||||||
|
[Header("Ability Stats")]
|
||||||
|
[SerializeField] private TextMeshProUGUI damage;
|
||||||
|
[SerializeField] private TextMeshProUGUI fireRate;
|
||||||
|
[SerializeField] private TextMeshProUGUI piercing;
|
||||||
|
[SerializeField] private TextMeshProUGUI projectileCount;
|
||||||
|
[Header("Upgrades")]
|
||||||
|
[SerializeField] private List<Transform> upgradeBoxes = new();
|
||||||
|
|
||||||
|
public void UpdateUI(PlayerAbility ability)
|
||||||
|
{
|
||||||
|
abilityIcon.sprite = ability.abilityIcon;
|
||||||
|
abilityName.text = ability.abilityName;
|
||||||
|
damage.text = $"Damage: {ability.power}";
|
||||||
|
fireRate.text = $"Fire rate: {ability.cooldown}s";
|
||||||
|
if (ability.TryGetComponent(out FireBullet isBullet))
|
||||||
|
{
|
||||||
|
piercing.text = $"Piercing: {isBullet.pierceAmount}";
|
||||||
|
projectileCount.text = $"Projectiles: {isBullet.projectileCount}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/AbilityUIObject.cs.meta
Normal file
2
Assets/Scripts/AbilityUIObject.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a75a4c92b7f4707cb82c77fef57ae2b3
|
||||||
|
|
@ -2,10 +2,10 @@ using UnityEngine;
|
||||||
|
|
||||||
public class FireBullet : PlayerAbility
|
public class FireBullet : PlayerAbility
|
||||||
{
|
{
|
||||||
[Header("Stats")]
|
[Header("Projectile Stats")]
|
||||||
|
public int pierceAmount;
|
||||||
public float accuracy;
|
public float accuracy;
|
||||||
public float bulletLifetime;
|
public float bulletLifetime;
|
||||||
public float damage;
|
|
||||||
public float projectileSpeed;
|
public float projectileSpeed;
|
||||||
|
|
||||||
public enum FireMode {Angled, Offset};
|
public enum FireMode {Angled, Offset};
|
||||||
|
|
@ -26,7 +26,8 @@ public class FireBullet : PlayerAbility
|
||||||
{
|
{
|
||||||
newProjectile.transform.position += new Vector3(Random.Range(-offset.x, offset.x), Random.Range(-offset.y, offset.y));
|
newProjectile.transform.position += new Vector3(Random.Range(-offset.x, offset.x), Random.Range(-offset.y, offset.y));
|
||||||
}
|
}
|
||||||
newProjectile.damage = damage;
|
newProjectile.pierceAmount = pierceAmount;
|
||||||
|
newProjectile.damage = power;
|
||||||
newProjectile.speed = projectileSpeed;
|
newProjectile.speed = projectileSpeed;
|
||||||
newProjectile.lifetime = bulletLifetime;
|
newProjectile.lifetime = bulletLifetime;
|
||||||
newProjectile.transform.Rotate(0, 0, Random.Range(-accuracy, accuracy));
|
newProjectile.transform.Rotate(0, 0, Random.Range(-accuracy, accuracy));
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,14 @@ public class PlayerAbility : MonoBehaviour
|
||||||
{
|
{
|
||||||
[Header("Identification")]
|
[Header("Identification")]
|
||||||
public string abilityName;
|
public string abilityName;
|
||||||
|
public Sprite abilityIcon;
|
||||||
public Marisa thisPlayer;
|
public Marisa thisPlayer;
|
||||||
[Header("Cooldown")]
|
[Header("Cooldown")]
|
||||||
public bool canCooldown = true;
|
public bool canCooldown = true;
|
||||||
public float cooldown;
|
public float cooldown;
|
||||||
private float currentCooldown;
|
private float currentCooldown;
|
||||||
|
[Header("Stats")]
|
||||||
|
public float power;
|
||||||
|
|
||||||
public void TryAbility()
|
public void TryAbility()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue