gun dev
This commit is contained in:
37
Assets/Scripts/DynamicLine.cs
Normal file
37
Assets/Scripts/DynamicLine.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[ExecuteAlways]
|
||||
[RequireComponent(typeof(LineRenderer))]
|
||||
public class DynamicLine : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private float length = 5f;
|
||||
[SerializeField]
|
||||
private int count = 2;
|
||||
|
||||
private float pLength;
|
||||
private int pCount;
|
||||
|
||||
private LineRenderer lineRenderer;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
lineRenderer= GetComponent<LineRenderer>();
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void FixedUpdate()
|
||||
{
|
||||
if (pLength != length||pCount!=count)
|
||||
{
|
||||
lineRenderer.positionCount = count;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
11
Assets/Scripts/DynamicLine.cs.meta
Normal file
11
Assets/Scripts/DynamicLine.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c4f6ccca2e0e4c40b0fe4a0c7ab98f3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Scripts/Interactable.meta
Normal file
8
Assets/Scripts/Interactable.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7fcd41ca09dce3743acbd03713e9db60
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
18
Assets/Scripts/Interactable/Insertable.cs
Normal file
18
Assets/Scripts/Interactable/Insertable.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Insertable : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
11
Assets/Scripts/Interactable/Insertable.cs.meta
Normal file
11
Assets/Scripts/Interactable/Insertable.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7406a2a2283cc074dba144678253dfee
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
20
Assets/Scripts/Interactable/Interactable.cs
Normal file
20
Assets/Scripts/Interactable/Interactable.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Interactable : MonoBehaviour
|
||||
{
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
11
Assets/Scripts/Interactable/Interactable.cs.meta
Normal file
11
Assets/Scripts/Interactable/Interactable.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0b461df434f407d4e9a24104595ac3c3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user