ELElias Lessainedevjogos.hashnode.dev·Nov 4, 2021 · 1 min readUnity - Check if point is inside the camera view.First we will get the x, y coordinates of the camera relative to the Viewport this will ensure that we'll have the edges of the camera view no matter the aspect ratio of it. Ps. I use this Range struct just because i prefer to read min, max instead o...00
ELElias Lessainedevjogos.hashnode.dev·Sep 26, 2021 · 1 min readUnity Clamp CircleA very simple method that i find quite useful to have: Returns min if value is over the max returns max if value is bellow min. public static int ClampCircle(int p_value, int p_min, int p_max) { if (p_value > p_max) { ...00
ELElias Lessainedevjogos.hashnode.dev·Sep 26, 2021 · 2 min readUnity Random Point Outside CameraFirst we will get the x, y coordinates of the camera relative to the Viewport this will ensure that we'll have the edges of the camera view no matter the aspect ratio of it. Ps. I use this Range struct just because i prefer to read min, max instead o...00
ELElias Lessainedevjogos.hashnode.dev·Sep 26, 2021 · 1 min readUnity Camera ShakeWell a resource that i use frequently in my games to get a better game feel of some events is camera shake. using UnityEngine; public class CameraManager : MonoBehaviour { private static bool _CameraShake; private static float _Strength; ...00
ELElias Lessainedevjogos.hashnode.dev·Sep 25, 2021 · 1 min readUnity SetAlphaIt bothered me to have to create a new Color() just to change the alpha of a spriteRenderer or Image, so i made this simple extesion to set the alpha of anything that inherit the UnityEngine.UI.Graphic class, that includes spriteRenderer, Image, Text...00