FX
This commit is contained in:
39
Assets/Epic Toon FX/Scripts/ETFXLightFade.cs
Normal file
39
Assets/Epic Toon FX/Scripts/ETFXLightFade.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace EpicToonFX
|
||||
{
|
||||
public class ETFXLightFade : MonoBehaviour
|
||||
{
|
||||
[Header("Seconds to dim the light")]
|
||||
public float life = 0.2f;
|
||||
public bool killAfterLife = true;
|
||||
|
||||
private Light li;
|
||||
private float initIntensity;
|
||||
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
{
|
||||
if (gameObject.GetComponent<Light>())
|
||||
{
|
||||
li = gameObject.GetComponent<Light>();
|
||||
initIntensity = li.intensity;
|
||||
}
|
||||
else
|
||||
print("No light object found on " + gameObject.name);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (gameObject.GetComponent<Light>())
|
||||
{
|
||||
li.intensity -= initIntensity * (Time.deltaTime / life);
|
||||
if (killAfterLife && li.intensity <= 0)
|
||||
//Destroy(gameObject);
|
||||
Destroy(gameObject.GetComponent<Light>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/Epic Toon FX/Scripts/ETFXLightFade.cs.meta
Normal file
12
Assets/Epic Toon FX/Scripts/ETFXLightFade.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2f54e17d705a2894d88787e24190ebfa
|
||||
timeCreated: 1499439792
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
17
Assets/Epic Toon FX/Scripts/ETFXPitchRandomizer.cs
Normal file
17
Assets/Epic Toon FX/Scripts/ETFXPitchRandomizer.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace EpicToonFX
|
||||
{
|
||||
|
||||
public class ETFXPitchRandomizer : MonoBehaviour
|
||||
{
|
||||
|
||||
public float randomPercent = 10;
|
||||
|
||||
void Start ()
|
||||
{
|
||||
transform.GetComponent<AudioSource>().pitch *= 1 + Random.Range(-randomPercent / 100, randomPercent / 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/Epic Toon FX/Scripts/ETFXPitchRandomizer.cs.meta
Normal file
12
Assets/Epic Toon FX/Scripts/ETFXPitchRandomizer.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 628ef9b0c7e4fd24db54868035e11237
|
||||
timeCreated: 1499558257
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
30
Assets/Epic Toon FX/Scripts/ETFXRotation.cs
Normal file
30
Assets/Epic Toon FX/Scripts/ETFXRotation.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace EpicToonFX
|
||||
{
|
||||
public class ETFXRotation : MonoBehaviour
|
||||
{
|
||||
|
||||
[Header("Rotate axises by degrees per second")]
|
||||
public Vector3 rotateVector = Vector3.zero;
|
||||
|
||||
public enum spaceEnum { Local, World };
|
||||
public spaceEnum rotateSpace;
|
||||
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (rotateSpace == spaceEnum.Local)
|
||||
transform.Rotate(rotateVector * Time.deltaTime);
|
||||
if (rotateSpace == spaceEnum.World)
|
||||
transform.Rotate(rotateVector * Time.deltaTime, Space.World);
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/Epic Toon FX/Scripts/ETFXRotation.cs.meta
Normal file
12
Assets/Epic Toon FX/Scripts/ETFXRotation.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7faa64a828219b44cb0eb5bfbfa83524
|
||||
timeCreated: 1494264015
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user