Answers a question: "How to make enemies surround player"
AttackSpotProvider.cs
provides attack positions to attackers.Attacker.cs
simulates an attacker
Shader Graph files to create billboard trees with billboard shadows. Exported from Unity 2023.2 and Shader Graph 16.0.4
Note: Shaders written for default
Quad
meshes in mind.
To make sure shadows are being drawn always behind tree billboards change shadow material’s Sorting Priority to a negative value:
using UnityEngine; | |
public class WeaponSway : MonoBehaviour | |
{ | |
[SerializeField] private Transform weaponTransform; | |
[Header("Sway Properties")] | |
[SerializeField] private float swaySmooth = 8f; | |
[SerializeField] private float swayDamp = 2f; | |
[SerializeField] private float posToRotAmount = 1f; |
using System; | |
using Unity.Burst; | |
using Unity.Collections; | |
using Unity.Jobs; | |
using Unity.Mathematics; | |
using UnityEngine; | |
using UnityEngine.UI; | |
using TMPro; | |
public class OptimalSpatialHashing : MonoBehaviour { |
As quixel is being removed, all items are free to aquire. This script is to automate the process to add items to your account (As of writing, a total of 18874
items)
Note: This script only tested in the latest version of Chrome.
run.js
)using UnityEngine; | |
using UnityEditor; | |
/* | |
Fixes a mesh's rotation after importing it from Blender. In Blender, the Z axis points in the | |
"up" direction, while in Unity, Z points in the "forward" direction. This script rotates the | |
mesh's vertices so that it is upright again. | |
To use this, create an object from a mesh in the hierarchy view, then locate the Mesh Filter | |
in the inspector. There, click on the new "Fix Rotation" button. |
/* Original code[1] Copyright (c) 2022 Shane Celis[2] | |
Licensed under the MIT License[3] | |
[1]: https://gist.github.com/shanecelis/f0e295b12ec1ab09f67ad5980ac9b324 | |
[2]: https://twitter.com/shanecelis | |
[3]: https://opensource.org/licenses/MIT | |
*/ | |
using System; | |
using System.Collections.Generic; |
// Code ported from https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/ | |
// Note this implementation does not support different block types or block normals | |
// The original author describes how to do this here: https://0fps.net/2012/07/07/meshing-minecraft-part-2/ | |
const int CHUNK_SIZE = 32; | |
// These variables store the location of the chunk in the world, e.g. (0,0,0), (32,0,0), (64,0,0) |
using UnityEngine.UI; | |
using System.Collections.Generic; | |
using System; | |
using UnityEngine; | |
public class VertBend : BaseMeshEffect | |
{ | |
public override void ModifyMesh(VertexHelper vh) | |
{ | |
if(!IsActive()) return; |
public static class ExtensionMethods | |
{ | |
public static TaskAwaiter GetAwaiter(this AsyncOperation asyncOp) | |
{ | |
var tcs = new TaskCompletionSource<object>(); | |
asyncOp.completed += obj => { tcs.SetResult(null); }; | |
return ((Task)tcs.Task).GetAwaiter(); | |
} | |
} |