private void Awake() { Instance = this; singleList = new List <Single>(); meshParticleSystem = GetComponent <MeshParticleSystem>(); meshRenderer = GetComponent <MeshRenderer>(); meshRenderer.sortingLayerName = sortingLayer; meshRenderer.sortingOrder = sortingOrder; // meshRenderer.material.SetColor("_alphaColor", new Color(105, 0, 0, 90)); }
private void Awake() { Instance = this; singleList = new List <Single>(); meshParticleSystem = GetComponent <MeshParticleSystem>(); if (!moveVelocity) { moveVelocity = GameObject.Find("Player").GetComponent <MoveVelocity>(); } }
public Single(Vector3 position, Vector3 direction, MeshParticleSystem meshParticleSystem) { this.position = position; this.direction = direction; this.meshParticleSystem = meshParticleSystem; quadSize = new Vector3(.04f, .08f); rotation = Random.Range(0, 360f); moveSpeed = Random.Range(6f, 14f); quadIndex = meshParticleSystem.AddQuad(position, rotation, quadSize, true, 0); }
public Single(Vector3 position, Vector3 direction, MeshParticleSystem meshParticleSystem) { this.position = position; this.direction = direction; this.meshParticleSystem = meshParticleSystem; quadSize = new Vector3(2.5f, 2.5f); moveSpeed = Random.Range(20f, 30f); uvIndex = 0; uvIndexTimerMax = 1f / 10; quadIndex = meshParticleSystem.AddQuad(position, 0f, quadSize, false, uvIndex); }
public Single(Vector3 position, Vector3 direction, MeshParticleSystem meshParticleSystem) { this.position = position; this.direction = direction; this.meshParticleSystem = meshParticleSystem; quadSize = new Vector3(2.5f, 2.5f); rotation = Random.Range(0, 360f); moveSpeed = Random.Range(50f, 70f); uvIndex = Random.Range(0, 8); quadIndex = meshParticleSystem.AddQuad(position, rotation, quadSize, false, uvIndex); }
public Single(Vector3 position, Vector3 direction, float distanceMax, MeshParticleSystem mesh) { this.position = position; this.direction = direction; this.meshParticleSystem = mesh; quadSize = new Vector3(.3f, .3f); rotation = Random.Range(0, 360f); moveSpeed = Random.Range(1f, distanceMax); uvIndex = Random.Range(0, 8); quadIndex = meshParticleSystem.AddQuad(position, rotation, quadSize, false, uvIndex); }
public Single(Vector3 position, Vector3 direction, MeshParticleSystem meshParticleSystem, LayerMask hitLayerMask) { this.position = position; this.direction = direction; this.meshParticleSystem = meshParticleSystem; this.hitLayerMask = hitLayerMask; quadSize = new Vector3(.4f, .8f); rotation = Random.Range(0, 360f); moveSpeed = Random.Range(30f, 50f); quadIndex = meshParticleSystem.AddQuad(position, rotation, quadSize, true, 0); }
public Single(Vector3 position, Vector3 direction, Vector3 quadSize, bool isPooling, float moveSpeed, float rotation, int uvIndex, MeshParticleSystem meshParticleSystem) { // quadSize = new Vector3(.4f, .4f); // moveSpeed = Random.Range(10f, 20f); // rotation = Random.Range(0, 360f); // uvIndex = Random.Range(0, 8); this.position = position; this.direction = direction; this.quadSize = quadSize; this.moveSpeed = moveSpeed; this.rotation = rotation; this.uvIndex = uvIndex; this.meshParticleSystem = meshParticleSystem; quadIndex = meshParticleSystem.AddQuad(position, rotation, quadSize, true, uvIndex); }
/*------------------------------------------------------------------*\ |* HOOKS \*------------------------------------------------------------------*/ private void Awake() { Instance = this; mesh = new Mesh(); vertices = new Vector3[4 * MAX_QUAD_AMOUNT]; uv = new Vector2[4 * MAX_QUAD_AMOUNT]; triangles = new int[6 * MAX_QUAD_AMOUNT]; mesh.vertices = vertices; mesh.uv = uv; mesh.triangles = triangles; mesh.bounds = new Bounds(Vector3.zero, Vector3.one * 10000f); GetComponent <MeshFilter>().mesh = mesh; // Set up internal UV Normalized Array Material material = GetComponent <MeshRenderer>().material; Texture mainTexture = material.mainTexture; int textureWidth = mainTexture.width; int textureHeight = mainTexture.height; List <UVCoords> uvCoordsList = new List <UVCoords>(); foreach (ParticleUVPixels particleUVPixels in particleUVPixelsArray) { UVCoords uvCoords = new UVCoords { uv00 = new Vector2( (float)particleUVPixels.uv00Pixels.x / textureWidth, (float)particleUVPixels.uv00Pixels.y / textureHeight ), uv11 = new Vector2( (float)particleUVPixels.uv11Pixels.x / textureWidth, (float)particleUVPixels.uv11Pixels.y / textureHeight ), }; uvCoordsList.Add(uvCoords); } uvCoordsArray = uvCoordsList.ToArray(); }
public Single(Vector3 position, Vector3 direction, MeshParticleSystem meshParticleSystem, MoveVelocity moveVelocity) { this.position = position; this.direction = direction; this.meshParticleSystem = meshParticleSystem; if (moveVelocity.velocityVector.y == 0) { quadSize = new Vector3(.3f, .2f); } else { quadSize = new Vector3(.5f, .4f); } moveSpeed = Random.Range(3f, 4f); uvIndex = 0; uvIndexTimerMax = 1f / 20; quadIndex = meshParticleSystem.AddQuad(position, 0f, quadSize, true, uvIndex); }
private void Awake() { Instance = this; meshParticleSystem = GetComponent <MeshParticleSystem>(); singleList = new List <Single>(); }
private void Awake() { Instance = this; meshParticleSystem = GetComponent <MeshParticleSystem>(); }