protected override void PickUpEffect(CombatMech mech) { if (mech.Weapons.Length > (int)upgradeWeaponType) { mech.Weapons[(int)upgradeWeaponType].Upgrade(); } }
private void OnDrawGizmosSelected() { if (!script) { script = GetComponent <CombatMech>(); } if (script.mechConfig) { Gizmos.color = Color.green; Gizmos.DrawWireCube(transform.position + transform.forward * (script.mechConfig.LockOnDistrance / 2 + 1f), Vector3.one * script.mechConfig.LockOnDistrance); } }
void Initialisation() { playerIn = GetComponent <PlayerInput>(); playerMech = GetComponent <CombatMech>(); AddListenToMechEvents(); playerIn.actions.FindAction("PrimaryFire").performed += FirePrimaryWeapon; playerIn.actions.FindAction("PrimaryFire").canceled += FirePrimaryWeapon; playerIn.actions.FindAction("SecondaryFire").performed += FireSecondaryWeapon; playerIn.actions.FindAction("SecondaryFire").canceled += FireSecondaryWeapon; playerIn.actions.FindAction("ArtilleryFire").performed += FireArtilleryWeapon; playerIn.actions.FindAction("ArtilleryFire").canceled += FireArtilleryWeapon; OnPlayerInitialisation?.Invoke(playerMech); }
private void OnDrawGizmos() { if (!script) { script = GetComponent <CombatMech>(); } if (script.mechConfig) { Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(transform.position + transform.TransformDirection(script.mechConfig.GunLocation), 0.1f); Gizmos.color = Color.red; Gizmos.DrawWireSphere(transform.position + transform.TransformDirection(script.mechConfig.HeavyLocation), 0.2f); Gizmos.color = Color.blue; Gizmos.DrawWireSphere(transform.position + transform.TransformDirection(script.mechConfig.ArtilleryLocation), 0.5f); } }
void UpdateHealthDisplay(CombatMech playerScript) { UpdateHealthDisplay(playerScript.Health); }
protected override void PickUpEffect(CombatMech mech) { mech.Heal(mech.GetMaxHealth()); }
protected abstract void PickUpEffect(CombatMech mech);