Пример #1
0
 protected override void PickUpEffect(CombatMech mech)
 {
     if (mech.Weapons.Length > (int)upgradeWeaponType)
     {
         mech.Weapons[(int)upgradeWeaponType].Upgrade();
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
    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);
    }
Пример #4
0
 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);
     }
 }
Пример #5
0
 void UpdateHealthDisplay(CombatMech playerScript)
 {
     UpdateHealthDisplay(playerScript.Health);
 }
Пример #6
0
 protected override void PickUpEffect(CombatMech mech)
 {
     mech.Heal(mech.GetMaxHealth());
 }
Пример #7
0
 protected abstract void PickUpEffect(CombatMech mech);