Initial commit
This commit is contained in:
30
Assets/Darkmatter/Code/Presentation/Player/Gun.cs
Normal file
30
Assets/Darkmatter/Code/Presentation/Player/Gun.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Darkmatter.Presentation
|
||||
{
|
||||
public class Gun : MonoBehaviour
|
||||
{
|
||||
public LineRenderer lineRenderer;
|
||||
public float LifeTime = 0.05f;
|
||||
|
||||
public void Init(Vector3 start, Vector3 end)
|
||||
{
|
||||
lineRenderer.enabled = true;
|
||||
lineRenderer.SetPosition(0, start);
|
||||
lineRenderer.SetPosition(1, end);
|
||||
Invoke("DisableBullet", LifeTime);
|
||||
}
|
||||
void DisableBullet()
|
||||
{
|
||||
lineRenderer.enabled = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Shoot()
|
||||
{
|
||||
Debug.Log("Shooting");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user