adding in some needed packages
This commit is contained in:
parent
9e739f5dc8
commit
aba5310742
1012 changed files with 494191 additions and 1 deletions
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3fbdc66fe608e5d4ba166146e459d79e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Player Flash Invisible
|
||||
m_Shader: {fileID: -6465566751694194690, guid: e511e2e0844051c4a918bac3f8ab93a3, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _Opacity: 0
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 0.09411765}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
--- !u!114 &3048803497091867637
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: cc83e78036234e54589b443288084464
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e511e2e0844051c4a918bac3f8ab93a3
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Bremsengine
|
||||
{
|
||||
public class SpriteFlashMaterial : MonoBehaviour
|
||||
{
|
||||
[SerializeField] SpriteMaterialQueue materialQueue;
|
||||
|
||||
[ContextMenu("Activate Flash")]
|
||||
public void TriggerFlashMaterial(float duration)
|
||||
{
|
||||
materialQueue.RunMaterialQueue(duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f054696af98e4da439b7c4fea1628eaa
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Bremsengine
|
||||
{
|
||||
public class SpriteMaterialQueue : MonoBehaviour
|
||||
{
|
||||
[field: SerializeField] public SpriteRenderer SR { get; private set; }
|
||||
[SerializeField] List<SpriteRenderer> renderers = new();
|
||||
public Material StandardMaterial { get; private set; }
|
||||
static Coroutine activeroutine;
|
||||
[SerializeField] Material flashMaterial;
|
||||
[SerializeField] float flashInterval;
|
||||
private void Awake()
|
||||
{
|
||||
StandardMaterial = SR.sharedMaterial;
|
||||
}
|
||||
public void RunMaterialQueue(float duration)
|
||||
{
|
||||
SR.sharedMaterial = StandardMaterial;
|
||||
if (activeroutine != null)
|
||||
{
|
||||
SetRendererMaterial(StandardMaterial);
|
||||
StopCoroutine(activeroutine);
|
||||
}
|
||||
activeroutine = StartCoroutine(CO_FlashMaterial(flashMaterial, duration, flashInterval));
|
||||
}
|
||||
void SetRendererMaterial(Material m)
|
||||
{
|
||||
if (SR != null)
|
||||
{
|
||||
SR.sharedMaterial = m;
|
||||
}
|
||||
foreach (var r in renderers)
|
||||
{
|
||||
if (r == null)
|
||||
continue;
|
||||
r.sharedMaterial = m;
|
||||
}
|
||||
}
|
||||
public IEnumerator CO_FlashMaterial(Material flashMaterial, float duration, float flashInterval)
|
||||
{
|
||||
SetRendererMaterial(StandardMaterial);
|
||||
float endTime = Time.time + duration;
|
||||
while (Time.time < endTime)
|
||||
{
|
||||
Material determinedMaterial = SR.sharedMaterial != flashMaterial ? flashMaterial : StandardMaterial;
|
||||
SetRendererMaterial(determinedMaterial);
|
||||
yield return new WaitForSeconds(flashInterval);
|
||||
}
|
||||
SetRendererMaterial(StandardMaterial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8b89b1a78f7445d4caf03b0f613bd71f
|
||||
Loading…
Add table
Add a link
Reference in a new issue