This commit is contained in:
2026-05-30 09:16:35 +07:00
parent 2f87ce19a7
commit 1c0ee6efb7
4001 changed files with 3363438 additions and 1738 deletions

View File

@@ -0,0 +1,18 @@
using UnityEngine;
namespace Invector.vShooter
{
public class vBotRifleAnimationControl : MonoBehaviour
{
public Animator animator;
public float pulseSpeed;
void Start()
{
animator = GetComponent<Animator>();
animator.SetFloat("PulseSpeed", pulseSpeed);
}
public void OnChangePowerChanger(float value)
{
animator.SetFloat("PowerCharger", value);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8e210168abfb6f04da4d02b8ac9cba3e
timeCreated: 1512581958
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,50 @@
using System.Collections.Generic;
using UnityEngine;
namespace Invector.vShooter
{
[vClassHeader("PowerCharge Projectile", openClose = false)]
public class vPowerChargeProjectileControl : vMonoBehaviour
{
public List<vProjectilePerPower> projectiles;
private vShooterWeapon weapon;
private vProjectilePerPower lastProjectilePerPower;
void Start()
{
weapon = GetComponent<vShooterWeapon>();
if (weapon)
{
weapon.onPowerChargerChanged.AddListener(OnChangerPower);
}
}
public void OnChangerPower(float value)
{
if (value <= 0) return;
if (weapon)
{
var projectilePerPower = projectiles.Find(projectile => value >= projectile.min && value <= projectile.max);
if (projectilePerPower != null && projectilePerPower.projectile && lastProjectilePerPower != projectilePerPower)
{
lastProjectilePerPower = projectilePerPower;
weapon.projectile = projectilePerPower.projectile;
projectilePerPower.OnValidatePower.Invoke();
}
}
}
[System.Serializable]
public class vProjectilePerPower
{
public float min;
public float max;
public GameObject projectile;
[Tooltip("Called when power is between min and max value")]
public UnityEngine.Events.UnityEvent OnValidatePower;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 0789346e3d9498e4eb933da262f9a4f3
timeCreated: 1512583517
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: