edit: attempted polish but failed
This commit is contained in:
parent
d59a00fdd3
commit
0001809418
58 changed files with 11705 additions and 140 deletions
|
@ -207,6 +207,7 @@ namespace Lemon.GenericLib.VFX {
|
|||
public void ApplyScreenShake(float duration, float newShakePower, bool isSmall = false)
|
||||
{
|
||||
//cb.enabled = false;
|
||||
Debug.Log("shake man!!!'");
|
||||
StopCoroutine("Screenshake");
|
||||
StartCoroutine(Screenshake(duration, newShakePower, isSmall));
|
||||
|
||||
|
|
57
Assets/Scripts/LemonGenericLib/Visual Effects/HitFlash.cs
Normal file
57
Assets/Scripts/LemonGenericLib/Visual Effects/HitFlash.cs
Normal file
|
@ -0,0 +1,57 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Lemon.GenericLib.VFX {
|
||||
public class HitFlash : MonoBehaviour
|
||||
{
|
||||
public float flashDuration = 0.1f;
|
||||
public SpriteRenderer sr;
|
||||
public Material flashMaterial;
|
||||
private Material defaultMaterial;
|
||||
public bool getSR = false;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (getSR) sr = GetComponent<SpriteRenderer>();
|
||||
|
||||
defaultMaterial = sr.material;
|
||||
}
|
||||
|
||||
public void SetFlash(bool isFlashing = true)
|
||||
{
|
||||
if (isFlashing) sr.material = flashMaterial;
|
||||
else sr.material = defaultMaterial;
|
||||
}
|
||||
|
||||
public void Flash()
|
||||
{
|
||||
StartCoroutine(FlashRoutine());
|
||||
|
||||
}
|
||||
|
||||
public void Flash(float duration)
|
||||
{
|
||||
StartCoroutine(FlashRoutine(duration));
|
||||
|
||||
}
|
||||
|
||||
IEnumerator FlashRoutine()
|
||||
{
|
||||
sr.material = flashMaterial;
|
||||
yield return new WaitForSeconds(flashDuration);
|
||||
sr.material = defaultMaterial;
|
||||
|
||||
}
|
||||
|
||||
IEnumerator FlashRoutine(float duration)
|
||||
{
|
||||
sr.material = flashMaterial;
|
||||
yield return new WaitForSeconds(duration);
|
||||
sr.material = defaultMaterial;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 48efeb9de946548478eb2727ae3f55eb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue