This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.AI; | |
public enum EnemyState | |
{ | |
Chase, | |
Attack | |
} | |
public sealed class EnemyData : MonoBehaviour |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private WaitForSeconds _delay = new WaitForSeconds(5f); | |
private IEnumerator WaitCo() | |
{ | |
while (!animationFinished) | |
{ | |
yield return delay; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private readonly List<Enemies> _enemiesToCheck = new List<Enemies>(); | |
private void Update() | |
{ | |
_enemiesToCheck.Clear(); | |
EnemyLogic(_enemiesToCheck); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Vector3 _prevPos; | |
private void Update() | |
{ | |
if (transform.position != _prevPos) | |
{ | |
VeryExpensiveFunction(transform.Position); | |
_prevPos = transform.postion; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void Update() | |
{ | |
VeryExpensiveGarbageGeneratingFunction(transform.position); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int count = _array.Length; | |
for (int i = 0; i < count; ++i) | |
{ | |
//DO SOME WORK HERE | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private BoxCollider[] _allColliders; | |
private void Start() | |
{ | |
_allColliders = FindObjectsOfType<BoxCollider>(); | |
} | |
private void OnTriggerEnter(Collider other) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void OnTriggerEnter() | |
{ | |
var allColliders = FindObjectsOfType<BoxCollider>(); | |
DoAThing(allColliders); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.Rendering; | |
using UnityEngine.Rendering.LWRP; | |
public class CustomRenderPassFeature : ScriptableRendererFeature | |
{ | |
class CustomRenderPass : ScriptableRenderPass | |
{ | |
// This method is called before executing the render pass. | |
// It can be used to configure render targets and their clear state. Also to create temporary render target textures. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Custom/Sprite_Dithered" | |
{ | |
Properties | |
{ | |
[PerRendererData] | |
_MainTex("Texture", 2D) = "white" {} | |
_Color("Color", Color) = (1, 1, 1, 1) | |
} | |
SubShader |
NewerOlder