protected override void Start() { base.Start(); // setup weapon weapon = firePoint.gameObject.AddComponent<RayWeapon>(); weapon.range = GetStats().range; weapon.damage = GetStats().directDamage; weapon.cooldown = GetStats().cooldown / 4f; var audioSource = weapon.gameObject.AddComponent<AudioSource>(); audioSource.clip = audio.clip; // var stats = GetStats(); // weapon = firePoint.gameObject.AddComponent<ProjectileWeapon>(); // weapon.range = stats.range; // weapon.damage = stats.directDamage; // weapon.cooldown = stats.cooldown; // weapon.projectileType = ProjectileType.AM39Missile; // weapon.projectileLaunchSpeed = stats.projectileLaunchSpeed; // weapon.projectileAcceleration = stats.projectileAcceleration; // weapon.projectileTopSpeed = stats.projectileTopSpeed; // weapon.projectileDuration = stats.projectileDuration; // var audioSource = weapon.gameObject.AddComponent<AudioSource>(); // audioSource.clip = audio.clip; }
override protected void Start() { base.Start(); // setup weapon weapon = firePoint.gameObject.AddComponent <RayWeapon>(); weapon.range = GetStats().range; weapon.damage = GetStats().directDamage; weapon.cooldown = GetStats().cooldown / 4f; var audioSource = weapon.gameObject.AddComponent <AudioSource>(); audioSource.clip = audio.clip; // var stats = GetStats(); // weapon = firePoint.gameObject.AddComponent<ProjectileWeapon>(); // weapon.range = stats.range; // weapon.damage = stats.directDamage; // weapon.cooldown = stats.cooldown; // weapon.projectileType = ProjectileType.AM39Missile; // weapon.projectileLaunchSpeed = stats.projectileLaunchSpeed; // weapon.projectileAcceleration = stats.projectileAcceleration; // weapon.projectileTopSpeed = stats.projectileTopSpeed; // weapon.projectileDuration = stats.projectileDuration; // var audioSource = weapon.gameObject.AddComponent<AudioSource>(); // audioSource.clip = audio.clip; }
protected override bool OnNoTarget(GameResult gameResult, float dt) { if (source.Target == null || !source.Target.IsTargetable) { return(false); } RayWeapon newWeapon = (RayWeapon)weapon.Clone(); newWeapon.OnCreation(gameResult, source, this); gameResult.AddCollidableArea(newWeapon); newWeapon.WeaponInfo.Target = source.Target; return(true); }