Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class BeamProjectile : BaseProjectile {
- GameObject m_launcher;
- public float range;
- // Update is called once per frame
- void Update()
- {
- if (m_launcher)
- {
- GetComponent<LineRenderer>().SetPosition(0, m_launcher.transform.position);
- GetComponent<LineRenderer>().SetPosition(1, m_launcher.transform.position + (m_launcher.transform.forward * range));
- }
- }
- public override void FireProjectile(GameObject launcher, GameObject target, int damage, float attackSpeed)
- {
- if (launcher)
- {
- m_launcher = launcher;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment