Commit 6aac8dec authored by Parsa Rahmaty's avatar Parsa Rahmaty

Significant improvements in visuals and lighting, Some bug fixes

parent 642ebc8d
fileFormatVersion: 2
guid: eb224ad5cd866c74589b88da7f6e1fd8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 179b209fe6be1784f8848087b1c991ab
folderAsset: yes
timeCreated: 1481101745
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 770687206f9760e478ad40c510367a44
folderAsset: yes
timeCreated: 1487687930
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ColorizeGrid : MonoBehaviour {
[Tooltip("The image used for coloring. Must be set toRead/Write Enabled must be true in the advanced section of the texture import settings")]
public Texture2D ColorMap;
[Tooltip("An Array of textures that the colorize script can use as an animation. Must be set toRead/Write Enabled must be true in the advanced section of the texture import settings")]
public Texture2D[] AnimatableMaps;
public enum Axis {X,Y};
[Tooltip("Choose the Axis you want the colored image to be applied to")]
public Axis DeformAxis = Axis.X;
[Tooltip("offset the image texture (kind of like repeat UV")]
public float StretchXB= 1.01f,StretchZB = 1.01f;
public bool AnimateThroughMaps = false;
[Tooltip("Loop Through the animation")]
public bool AnimLoop = false;
[Tooltip("time to change the image")]
public float AnimFrameChangeInSec = 1.0f;
[Tooltip("calculte every frame or just at start")]
public bool IsStatic = false;
private float[] OriginalY,OriginalX,OriginalZ;
float smallestX,largestX,smallestZ,largestZ,smallestY,largestY = 0;
private float tempAnimVal = 1.0f;
private float startTime = 0.0f;
private int startval = 0;
Transform[] originalObjects;
float StretchX= 1.0f,StretchZ= 1.0f;
void Start ()
{
tempAnimVal = AnimFrameChangeInSec;
originalObjects = new Transform[transform.childCount];
OriginalY = new float[originalObjects.Length];
OriginalX = new float[originalObjects.Length];
OriginalZ = new float[originalObjects.Length];
for (int i = 0; i < transform.childCount; i++)
{
originalObjects [i] = transform.GetChild (i);
}
if (originalObjects.Length != 0) //check if the array is empty
{
smallestX = originalObjects [0].transform.position.x;//set an initial relevant value
largestX = smallestX;//set an initial relevant value
smallestZ = originalObjects [0].transform.position.z;//set an initial relevant value
largestZ = smallestZ;//set an initial relevant value
for (int i = 0; i < originalObjects.Length; i++) //find the smallest and largest values of x and z to be able to normalize later on
{
OriginalY [i] = originalObjects [i].transform.position.y;
OriginalX [i] = originalObjects [i].transform.position.x;
OriginalZ [i] = originalObjects [i].transform.position.z;
if (originalObjects [i].transform.position.x < smallestX) {
smallestX = originalObjects [i].transform.position.x;
}
if (originalObjects [i].transform.position.x > largestX) {
largestX = originalObjects [i].transform.position.x;
}
if (originalObjects [i].transform.position.y < smallestY) {
smallestY = originalObjects [i].transform.position.y;
}
if (originalObjects [i].transform.position.y > largestY) {
largestY = originalObjects [i].transform.position.y;
}
if (originalObjects [i].transform.position.z < smallestZ) {
smallestZ = originalObjects [i].transform.position.z;
}
if (originalObjects [i].transform.position.z > largestZ) {
largestZ = originalObjects [i].transform.position.z;
}
}
}
if (IsStatic) {
ColorObjects ();
}
}
void FixedUpdate()
{
if(!IsStatic){
if (AnimateThroughMaps == true && AnimatableMaps.Length != 0) {
ColorMap = AnimatableMaps [startval];
startTime += Time.deltaTime;
if(startTime >= tempAnimVal)
{
startval++;
if (startval >= AnimatableMaps.Length&& AnimLoop == true) {
startval = 0;
}
else if(startval >= AnimatableMaps.Length && AnimLoop == false)
{
startval = AnimatableMaps.Length - 1;
}
tempAnimVal += AnimFrameChangeInSec;
}
}
ColorObjects ();
}
}
void ColorObjects()
{
switch (DeformAxis)
{
case Axis.X:
ColorX ();
break;
case Axis.Y:
ColorY ();
break;
}
}
void ColorX()
{
for (int i = 0; i < originalObjects.Length; i++)
{
float normalizedX = (OriginalX[i] - smallestX*StretchX) / (largestX*StretchXB - smallestX*StretchX);
float normalizedZ = (OriginalZ [i] - smallestZ*StretchZ) / (largestZ*StretchZB - smallestZ*StretchZ);
int x = Mathf.FloorToInt(normalizedX * ColorMap.width);
int z = Mathf.FloorToInt(normalizedZ * ColorMap.height);
float red = ColorMap.GetPixel (x, z).r;
float green = ColorMap.GetPixel (x, z).g;
float blue = ColorMap.GetPixel (x, z).b;
Color color = new Color (red, green, blue, 1.0f);
originalObjects [i].GetComponent<Renderer> ().material.color = color;
}
}
void ColorY()
{
for (int i = 0; i < originalObjects.Length; i++)
{
float normalizedY = (OriginalY [i] - smallestY*StretchX) / (largestY*StretchXB - smallestY*StretchX);
float normalizedZ = (OriginalZ [i]- smallestZ*StretchZ) / (largestZ*StretchZB - smallestZ*StretchZ);
int y = Mathf.FloorToInt(normalizedY * ColorMap.width);
int z = Mathf.FloorToInt(normalizedZ * ColorMap.height);
float red = ColorMap.GetPixel (y, z).r;
float green = ColorMap.GetPixel (y, z).g;
float blue = ColorMap.GetPixel (y, z).b;
Color color = new Color (red, green, blue, 1.0f);
originalObjects [i].GetComponent<Renderer> ().material.color = color;
}
}
}
fileFormatVersion: 2
guid: edf0958e02fa8684a8d0da158f785372
timeCreated: 1487685512
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EffectorVal : MonoBehaviour
{
public float EffectorDistance = 3.0f;
public float EffectorRecoverySpeed = 10.0f;
public bool Inverted = false;
public AnimationCurve FallOffCurve;
void Start()
{
if (FallOffCurve.length == 0) {
FallOffCurve = new AnimationCurve (new Keyframe (0, 1), new Keyframe (1, 1));
}
}
}
fileFormatVersion: 2
guid: 462b82ad11d18a749a2a3fa6f49fcc5d
timeCreated: 1487924024
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 2ad5080854991804e908f94698e44e73
folderAsset: yes
timeCreated: 1481101769
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// ///////////////////////////////////////PLEASE READ THIS///////////////////////////////////////////////////////
///
/// this script is not optimized and still beta, it is a super performance hog, so don't use it in your projects,
/// it's here for educational purposes only, use the simpleblendshapes deformer for that purpose only
/// you can edit this script as you please to make it perform well for your project
///
/// /////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// </summary>
public class BETABlendShapeDeformer : MonoBehaviour {
public bool isStatic = false;
public GameObject objectToDeform;
public GameObject [] targetMeshObjects;
[Range(0.0f,1.0f)]
public float[] Weight;
Mesh deformingMesh;
Mesh[] targetsMesh;
float new_x,new_y,new_z,newnorx,newnory,newnorz;
float distx = 0, disty = 0, distz = 0, norx = 0,nory = 0,norz = 0;
float divider = 1;
float averageWeights =0;
Vector3[] originalVertices, displacedVertices,originalnormals,diplacednormals;
bool execute = false;
void Start ()
{
deformingMesh = objectToDeform.GetComponent<MeshFilter>().mesh;
originalVertices = deformingMesh.vertices;
originalnormals = deformingMesh.normals;
displacedVertices = new Vector3[originalVertices.Length];
diplacednormals = new Vector3[originalVertices.Length];
targetsMesh = new Mesh[targetMeshObjects.Length];
if (targetMeshObjects.Length != Weight.Length)
{
Weight = new float[targetMeshObjects.Length];
}
for (int m =0; m<targetMeshObjects.Length;m++)
{
targetsMesh[m] = targetMeshObjects[m].GetComponent<MeshFilter>().mesh;
}
for (int i = 0; i < originalVertices.Length; i++)
{
displacedVertices[i] = originalVertices[i];
}
if(isStatic)
{
blendshapes();
}
}
void Update ()
{
if(!isStatic && execute == false)
{
execute = true;
StartCoroutine(orchestrate());
}
}
IEnumerator orchestrate()
{
yield return new WaitForSeconds (0.02f);
blendshapes();
}
void blendshapes()
{
for (int i = 0; i < originalVertices.Length; i++)
{
for (int m = 0; m < targetMeshObjects.Length; m++)
{
distx += (targetsMesh[m].vertices[i].x - originalVertices [i].x)*Weight[m];
disty += (targetsMesh[m].vertices[i].y - originalVertices [i].y)*Weight[m];
distz += (targetsMesh[m].vertices[i].z - originalVertices [i].z)*Weight[m];
norx += targetsMesh [m].normals [i].x * Weight [m];
nory += targetsMesh [m].normals [i].y * Weight [m];
norz += targetsMesh [m].normals [i].z * Weight [m];
if (Weight [m] != 0) {
divider++;
averageWeights += Weight [m];
}
}
new_x = originalVertices [i].x + distx;
new_y = originalVertices [i].y + disty;
new_z = originalVertices [i].z + distz;
Vector3 newvertPos = new Vector3 (new_x, new_y, new_z);
Vector3 newnorms = new Vector3(norx, nory, norz);
averageWeights = averageWeights / divider;
displacedVertices [i] = newvertPos;
diplacednormals [i] = newnorms + originalnormals[i]*(1-averageWeights);
distx = 0;
disty = 0;
distz = 0;
norx = 0;
nory = 0;
norz = 0;
divider = 1;
}
deformingMesh.vertices = displacedVertices;
deformingMesh.normals = diplacednormals;
execute = false;
}
}
fileFormatVersion: 2
guid: d003267f1ccc6574f82dbe7ce2f65fa0
timeCreated: 1493365204
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(MeshFilter))]
public class CurveShapeDeformer : MonoBehaviour {
public enum Axis {X,Y,Z};
[Tooltip("Choose the Axis you want the deformer to work on")]
public Axis DeformAxis = Axis.Y;
[Tooltip("Use this curve to define the deformation")]
public AnimationCurve Refinecurve ;
[Tooltip("Deformation Multiplier")]
public float Multiplier = 1.0f;
[Tooltip("Allow unity to re-calculate the normals, sometimes its needed, others no")]
public bool RecalculateNormals = false;
[Tooltip("Defines whether the Deformer is static or Dynamic, if true, the deformer will only be calculated once at Start")]
public bool isStatic = false;
Mesh deformingMesh;
Vector3[] originalVertices, displacedVertices;
float smallestY =0;
float largestY = 0;
void Start ()
{
if (Refinecurve.length == 0) {
Refinecurve = new AnimationCurve (new Keyframe (0, 0), new Keyframe (1, 0.5f));
}
deformingMesh = GetComponent<MeshFilter>().mesh;
originalVertices = deformingMesh.vertices;
displacedVertices = new Vector3[originalVertices.Length];
for (int i = 0; i < originalVertices.Length; i++)
{
displacedVertices[i] = originalVertices[i];
if(displacedVertices[i].y < smallestY)
{
smallestY = displacedVertices [i].y;
}
if(displacedVertices[i].y > largestY)
{
largestY = displacedVertices[i].y ;
}
}
CurveUP ();
}
void FixedUpdate()
{
if (!isStatic) {
CurveUP ();
}
}
void CurveUP ()
{
for (int i = 0; i < originalVertices.Length; i++)
{
float x, y, z;
x = originalVertices [i].x;
y = originalVertices [i].y;
z = originalVertices [i].z;
float normalized = (y - smallestY) / (largestY - smallestY);
float curveValue = Refinecurve.Evaluate (normalized);
float new_x = x;
float new_y = y;
float new_z = z;
switch (DeformAxis)
{
case Axis.X:
new_x = x + curveValue * Multiplier;
break;
case Axis.Y:
new_y = y + curveValue * Multiplier;
break;
case Axis.Z:
new_z = z + curveValue * Multiplier;
break;
}
Vector3 newvertPos = new Vector3 (new_x, new_y, new_z);
displacedVertices [i] = newvertPos;
}
deformingMesh.vertices = displacedVertices;
if(RecalculateNormals){
deformingMesh.RecalculateNormals();
}
}
}
fileFormatVersion: 2
guid: ef13d1c3dd7754a4c88fc01dc43ee494
timeCreated: 1481097193
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(MeshFilter))]
public class FlareDeformer : MonoBehaviour {
[Tooltip("Defines whether the Deformer is static or Dynamic, if true, the deformer will only be calculated once at Start, Iportant if you want to create a script to stack deformers")]
public bool isStatic = false;
public enum Axis {X,Y,Z};
[Tooltip("Choose the Axis you want the deformer to work on")]
public Axis DeformAxis = Axis.Y;
[Tooltip("Use the curve to determin the influence of the deformer over the chosen Axis")]
public AnimationCurve Refinecurve ;
[Tooltip("Multiply the over-all effect of the deformer")]
public float Multiplier = 1.0f;
[Tooltip("Enable/Disable the use of the effector")]
public bool UseEffector = false;
[Tooltip("The effector Object (must have the effector script attached to it)")]
public GameObject Effector;
private EffectorVal theEffector;
private float EffectorDistance = 3.0f;
private bool InvertedEffector = false;
private AnimationCurve ERefinecurve;
private float EnormalizedCurve,EcurveValue;
Mesh deformingMesh;
Vector3[] originalVertices, displacedVertices;
Vector3 []normalVerts;
float smallestY,largestY,smallestX,largestX,smallestZ,largestZ,normalized,curveValue =0;
void Start ()
{
if (UseEffector != false) {
if (Effector != null) {
theEffector = Effector.GetComponent<EffectorVal> ();
} else {
Debug.LogWarning ("Please assign an effector to the effector Value, to create an effector go to: Mesh Deformer -> createEffector");
}
}
if (Refinecurve.length == 0) {
Refinecurve = new AnimationCurve (new Keyframe (0, 0), new Keyframe (1, 1));
}
deformingMesh = GetComponent<MeshFilter>().mesh;
originalVertices = deformingMesh.vertices;
normalVerts = new Vector3[originalVertices.Length];
displacedVertices = new Vector3[originalVertices.Length];
for (int i = 0; i < originalVertices.Length; i++)
{
normalVerts [i] = Vector3.Normalize( deformingMesh.normals[i]);
displacedVertices[i] = originalVertices[i];
if(displacedVertices[i].y < smallestY)
{
smallestY = displacedVertices [i].y;
}
if(displacedVertices[i].y > largestY)
{
largestY = displacedVertices[i].y ;
}
if(displacedVertices[i].x < smallestX)
{
smallestX = displacedVertices [i].x;
}
if(displacedVertices[i].x > largestX)
{
largestX = displacedVertices[i].x ;
}
if(displacedVertices[i].z < smallestZ)
{
smallestZ = displacedVertices [i].z;
}
if(displacedVertices[i].z > largestZ)
{
largestZ = displacedVertices[i].z ;
}
}
if (!UseEffector) {
flareUP ();
} else {
flareUPEffector ();
}
}
void FixedUpdate()
{
if (!isStatic) {
if (!UseEffector) {
flareUP ();
} else {
flareUPEffector ();
}
}
}
void flareUP ()
{
for (int i = 0; i < originalVertices.Length; i++)
{
float x, y, z;
x = originalVertices [i].x;
y = originalVertices [i].y;
z = originalVertices [i].z;
float new_x = x;
float new_y = y;
float new_z = z;
switch (DeformAxis)
{
case Axis.X:
normalized = (x - smallestX) / (largestX - smallestX);
curveValue = Refinecurve.Evaluate (normalized);
new_y = (y + normalVerts [i].y/100000.0f)* Multiplier * curveValue;
new_z = (z + normalVerts[i].z/100000.0f)* Multiplier* curveValue;
break;
case Axis.Y:
normalized = (y - smallestY) / (largestY - smallestY);
curveValue = Refinecurve.Evaluate (normalized);
new_x = (x + normalVerts [i].x/100000.0f)* Multiplier * curveValue;
new_z = (z + normalVerts[i].z/100000.0f)* Multiplier* curveValue;
break;
case Axis.Z:
normalized = (z - smallestZ) / (largestZ - smallestZ);
curveValue = Refinecurve.Evaluate (normalized);
new_x = (x + normalVerts [i].x/100000.0f)* Multiplier * curveValue;
new_y = (y + normalVerts[i].y/100000.0f)* Multiplier* curveValue;
break;
}
Vector3 newvertPos = new Vector3 (new_x, new_y, new_z);
displacedVertices [i] = newvertPos;
}
deformingMesh.vertices = displacedVertices;
//deformingMesh.RecalculateNormals();
}
void flareUPEffector ()
{
InvertedEffector = theEffector.Inverted;
ERefinecurve = theEffector.FallOffCurve;
EffectorDistance = theEffector.EffectorDistance;
if (!InvertedEffector) {
for (int i = 0; i < originalVertices.Length; i++) {
if (Vector3.Distance (transform.TransformPoint (originalVertices [i]), Effector.transform.position) <= EffectorDistance) {
float dist = Vector3.Distance (transform.TransformPoint (originalVertices [i]), Effector.transform.position);
EnormalizedCurve = dist / EffectorDistance;
EcurveValue = ERefinecurve.Evaluate (EnormalizedCurve);
float x, y, z;
x = originalVertices [i].x;
y = originalVertices [i].y;
z = originalVertices [i].z;
float new_x = x;
float new_y = y;
float new_z = z;
switch (DeformAxis) {
case Axis.X:
normalized = (x - smallestX) / (largestX - smallestX);
curveValue = Refinecurve.Evaluate (normalized);
new_y = ((y + normalVerts [i].y / 100000.0f) * Multiplier * curveValue) * EcurveValue;
new_z = ((z + normalVerts [i].z / 100000.0f) * Multiplier * curveValue) * EcurveValue;
break;
case Axis.Y:
normalized = (y - smallestY) / (largestY - smallestY);
curveValue = Refinecurve.Evaluate (normalized);
new_x = ((x + normalVerts [i].x / 100000.0f) * Multiplier * curveValue) * EcurveValue;
new_z = ((z + normalVerts [i].z / 100000.0f) * Multiplier * curveValue) * EcurveValue;
break;
case Axis.Z:
normalized = (z - smallestZ) / (largestZ - smallestZ);
curveValue = Refinecurve.Evaluate (normalized);
new_x = ((x + normalVerts [i].x / 100000.0f) * Multiplier * curveValue) * EcurveValue;
new_y = ((y + normalVerts [i].y / 100000.0f) * Multiplier * curveValue) * EcurveValue;
break;
}
Vector3 newvertPos = new Vector3 (new_x, new_y, new_z);
displacedVertices [i] = newvertPos;
} else {
displacedVertices [i] = originalVertices [i];
}
}
deformingMesh.vertices = displacedVertices;
} else
{
for (int i = 0; i < originalVertices.Length; i++) {
if (Vector3.Distance (transform.TransformPoint (originalVertices [i]), Effector.transform.position) <= EffectorDistance) {
float dist = Vector3.Distance (transform.TransformPoint (originalVertices [i]), Effector.transform.position);
EnormalizedCurve = (dist - EffectorDistance) / EffectorDistance;
EcurveValue = ERefinecurve.Evaluate (EnormalizedCurve);
float x, y, z;
x = originalVertices [i].x;
y = originalVertices [i].y;
z = originalVertices [i].z;
float new_x = x;
float new_y = y;
float new_z = z;
switch (DeformAxis) {
case Axis.X:
normalized = (x - smallestX) / (largestX - smallestX);
curveValue = Refinecurve.Evaluate (normalized);
new_y = ((y + normalVerts [i].y / 100000.0f) * Multiplier * curveValue) * EcurveValue;
new_z = ((z + normalVerts [i].z / 100000.0f) * Multiplier * curveValue) * EcurveValue;
break;
case Axis.Y:
normalized = (y - smallestY) / (largestY - smallestY);
curveValue = Refinecurve.Evaluate (normalized);
new_x = ((x + normalVerts [i].x / 100000.0f) * Multiplier * curveValue) * EcurveValue;
new_z = ((z + normalVerts [i].z / 100000.0f) * Multiplier * curveValue) * EcurveValue;
break;
case Axis.Z:
normalized = (z - smallestZ) / (largestZ - smallestZ);
curveValue = Refinecurve.Evaluate (normalized);
new_x = ((x + normalVerts [i].x / 100000.0f) * Multiplier * curveValue) * EcurveValue;
new_y = ((y + normalVerts [i].y / 100000.0f) * Multiplier * curveValue) * EcurveValue;
break;
}
Vector3 newvertPos = new Vector3 (new_x, new_y, new_z);
displacedVertices [i] = newvertPos;
} else {
displacedVertices [i] = originalVertices [i];
}
}
deformingMesh.vertices = displacedVertices;
}
}
}
fileFormatVersion: 2
guid: c2e4942c58c31a74397411e2abd06b67
timeCreated: 1481095014
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(MeshFilter))]
public class ImageDeformer : MonoBehaviour {
[Tooltip("The image used for the deformation. Must be set to Advanced, and Read/Write Enabled must be true in the texture import settings")]
public Texture2D heightmap;
[Tooltip("Height Multiplier of the deformer")]
public float Height = 1.0f;
[Tooltip("calculate the deformation once at Start or keep it dynamic")]
public bool isStatic = false;
[Tooltip("offset the image texture (kind of like repeat UV")]
public float stretchX = 1.0f, stretchZ = 1.0f;
[Tooltip("An Array of textures that the deformer cas use as an animation. Must be set to Advanced, and Read/Write Enabled must be true in the texture import settings")]
public Texture2D[] AnimatableMaps;
[Tooltip("enable the Animation through the array of images")]
public bool AnimateThroughMaps = false;
[Tooltip("Loop Through the animation")]
public bool AnimLoop = false;
[Tooltip("time to change the image")]
public float AnimFrameChangeInSec = 1.0f;
[Tooltip("Allow unity to re-calculate the normals, sometimes its needed, others no, must be set before hitting play")]
public bool RecalculateNormals = false;
[Tooltip("Enable/Disable the use of the effector")]
public bool UseEffector = false;
[Tooltip("The effector Object (must have the effector script attached to it)")]
public GameObject Effector;
private EffectorVal theEffector;
private float EffectorDistance = 3.0f;
private bool InvertedEffector = false;
private AnimationCurve Refinecurve;
private float normalizedCurve,curveValue;
private float tempAnimVal = 1.0f;
private float startTime = 0.0f;
private int startval = 0;
Mesh deformingMesh;
Vector3[] originalVertices, displacedVertices;
Vector3 []normalVerts;
Vector2[] uvs;
void Start ()
{
if (UseEffector != false) {
if (Effector != null) {
theEffector = Effector.GetComponent<EffectorVal> ();
} else {
Debug.LogWarning ("Please assign an effector to the effector Value, to create an effector go to: Mesh Deformer -> createEffector");
}
}
tempAnimVal = AnimFrameChangeInSec;
deformingMesh = GetComponent<MeshFilter>().mesh;
uvs = deformingMesh.uv;
originalVertices = deformingMesh.vertices;
displacedVertices = new Vector3[originalVertices.Length];
normalVerts = new Vector3[originalVertices.Length];
for (int i = 0; i < originalVertices.Length; i++)
{
normalVerts [i] = Vector3.Normalize( deformingMesh.normals[i]);
}
if (isStatic)
{
if (!UseEffector) {
MoveVerts ();
} else {
MoveVertsEffector ();
}
}
}
void FixedUpdate()
{
if (!isStatic) {
if (AnimateThroughMaps == true && AnimatableMaps.Length != 0) {
heightmap = AnimatableMaps [startval];
startTime += Time.deltaTime;
if(startTime >= tempAnimVal)
{
startval++;
if (startval >= AnimatableMaps.Length && AnimLoop == true) {
startval = 0;
} else if(startval >= AnimatableMaps.Length && AnimLoop == false)
{
startval = AnimatableMaps.Length - 1;
}
tempAnimVal += AnimFrameChangeInSec;
}
}
if (!UseEffector) {
MoveVerts ();
} else {
MoveVertsEffector ();
}
}
}
void MoveVerts()
{
for (int i = 0; i < originalVertices.Length; i++) {
int u = Mathf.FloorToInt (uvs [i].x * heightmap.width * stretchX);
int v = Mathf.FloorToInt (uvs [i].y * heightmap.height * stretchZ);
float multiplier = heightmap.GetPixel (u, v).grayscale * Height;
float newx = originalVertices [i].x + normalVerts [i].x * multiplier;
float newy = originalVertices [i].y + normalVerts [i].y * multiplier;
float newz = originalVertices [i].z + normalVerts [i].z * multiplier;
Vector3 pos = new Vector3 (newx, newy, newz);
displacedVertices [i] = pos;
}
deformingMesh.vertices = displacedVertices;
if (RecalculateNormals) {
deformingMesh.RecalculateNormals ();
}
}
void MoveVertsEffector ()
{
InvertedEffector = theEffector.Inverted;
Refinecurve = theEffector.FallOffCurve;
EffectorDistance = theEffector.EffectorDistance;
if (!InvertedEffector) {
for (int i = 0; i < originalVertices.Length; i++) {
if (Vector3.Distance (transform.TransformPoint (originalVertices [i]), Effector.transform.position) <= EffectorDistance) {
float dist = Vector3.Distance (transform.TransformPoint (originalVertices [i]), Effector.transform.position);
normalizedCurve = dist / EffectorDistance;
curveValue = Refinecurve.Evaluate (normalizedCurve);
int u = Mathf.FloorToInt (uvs [i].x * heightmap.width * stretchX);
int v = Mathf.FloorToInt (uvs [i].y * heightmap.height * stretchZ);
float multiplier = heightmap.GetPixel (u, v).grayscale * Height;
float newx = originalVertices [i].x + normalVerts [i].x * multiplier * curveValue;
float newy = originalVertices [i].y + normalVerts [i].y * multiplier * curveValue;
float newz = originalVertices [i].z + normalVerts [i].z * multiplier * curveValue;
Vector3 pos = new Vector3 (newx, newy, newz);
displacedVertices [i] = pos;
} else {
displacedVertices [i] = originalVertices [i];
}
}
deformingMesh.vertices = displacedVertices;
if (RecalculateNormals) {
deformingMesh.RecalculateNormals ();
}
} else
{
for (int i = 0; i < originalVertices.Length; i++) {
if (Vector3.Distance (transform.TransformPoint (originalVertices [i]), Effector.transform.position) >= EffectorDistance) {
float dist = Vector3.Distance (transform.TransformPoint (originalVertices [i]), Effector.transform.position);
normalizedCurve = (dist - EffectorDistance) / EffectorDistance;
curveValue = Refinecurve.Evaluate (normalizedCurve);
int u = Mathf.FloorToInt (uvs [i].x * heightmap.width * stretchX);
int v = Mathf.FloorToInt (uvs [i].y * heightmap.height * stretchZ);
float multiplier = heightmap.GetPixel (u, v).grayscale * Height;
float newx = originalVertices [i].x + normalVerts [i].x * multiplier * curveValue;
float newy = originalVertices [i].y + normalVerts [i].y * multiplier * curveValue;
float newz = originalVertices [i].z + normalVerts [i].z * multiplier * curveValue;
Vector3 pos = new Vector3 (newx, newy, newz);
displacedVertices [i] = pos;
} else {
displacedVertices [i] = originalVertices [i];
}
}
deformingMesh.vertices = displacedVertices;
if (RecalculateNormals) {
deformingMesh.RecalculateNormals ();
}
}
}
}
fileFormatVersion: 2
guid: 16fa3889cc9be494dbe561aac1326a0d
timeCreated: 1481810774
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(MeshFilter))]
public class RippleDeformer : MonoBehaviour {
public enum Axis {X,Y,Z};
[Tooltip("Choose the Axis you want the deformer to work on")]
public Axis DeformAxis = Axis.Y;
[Tooltip("increase or decrease Ripples")]
public float Frequency =2.0f;
[Tooltip("Cycle through the Ripples")]
public float Phaze = 1.0f;
[Tooltip("Height of the Ripples")]
public float PeakMultiplier=1.0f;
[Tooltip("Enable the animation of the Ripples, PS. animates the phase value")]
public bool AnimatePhaze = false;
[Tooltip("The speed for animating the ripples")]
public float AnimationSpeed = 10.0f;
[Tooltip("Offset the Ripple center")]
public float OffsetA,OffsetB = 0.0f;
[Tooltip("Defines whether the Deformer is static or Dynamic, if true, the deformer will only be calculated once at Start")]
public bool isStatic = false;
[Tooltip("Enable/Disable the use of the effector")]
public bool UseEffector = false;
[Tooltip("The effector Object (must have the effector script attached to it)")]
public GameObject Effector;
float new_y, new_x, new_z,xsquared,ysquared,zsquared = 0;
Mesh deformingMesh;
Vector3[] originalVertices, displacedVertices;
float normalized,curveValue,normalized2,curveValue2;
private EffectorVal theEffector;
private float EffectorDistance = 3.0f;
private bool InvertedEffector = false;
private AnimationCurve Refinecurve;
private float normalizedCurve;
void Start ()
{
if (UseEffector != false) {
if (Effector != null) {
theEffector = Effector.GetComponent<EffectorVal> ();
} else {
Debug.LogWarning ("Please assign an effector to the effector Value, to create an effector go to: Mesh Deformer -> createEffector");
}
}
deformingMesh = GetComponent<MeshFilter>().mesh;
originalVertices = deformingMesh.vertices;
displacedVertices = new Vector3[originalVertices.Length];
if (isStatic)
{
if (!UseEffector) {
Ripple ();
} else {
RippleEffector ();
}
}
}
void FixedUpdate()
{
if (!isStatic) {
if (!UseEffector) {
Ripple ();
} else {
RippleEffector ();
}
if (AnimatePhaze) {
animateRipple ();
}
}
}
void RippleEffector()
{
InvertedEffector = theEffector.Inverted;
Refinecurve = theEffector.FallOffCurve;
EffectorDistance = theEffector.EffectorDistance;
if (!InvertedEffector) {
for (int i = 0; i < originalVertices.Length; i++) {
if (Vector3.Distance (transform.TransformPoint (originalVertices [i]), Effector.transform.position) <= EffectorDistance) {
float dist = Vector3.Distance (transform.TransformPoint (originalVertices [i]), Effector.transform.position);
normalizedCurve = dist / EffectorDistance;
curveValue = Refinecurve.Evaluate (normalizedCurve);
float x, y, z;
x = originalVertices [i].x;
y = originalVertices [i].y;
z = originalVertices [i].z;
switch (DeformAxis) {
case Axis.X:
new_y = y;
ysquared = Mathf.Pow (y + OffsetA, 2);
zsquared = Mathf.Pow (z + OffsetB, 2);
new_x = x + Mathf.Sin (Frequency * Mathf.Sqrt (ysquared + zsquared) + Phaze) * PeakMultiplier * curveValue;
new_z = z;
break;
case Axis.Y:
new_x = x;
xsquared = Mathf.Pow (x + OffsetA, 2);
zsquared = Mathf.Pow (z + OffsetB, 2);
new_y = y + Mathf.Sin (Frequency * Mathf.Sqrt (xsquared + zsquared) + Phaze) * PeakMultiplier * curveValue;
new_z = z;
break;
case Axis.Z:
new_x = x;
xsquared = Mathf.Pow (x + OffsetA, 2);
ysquared = Mathf.Pow (y + OffsetB, 2);
new_z = z + Mathf.Sin (Frequency * Mathf.Sqrt (xsquared + ysquared) + Phaze) * PeakMultiplier * curveValue;
new_y = y;
break;
}
Vector3 newvertPos = new Vector3 (new_x, new_y, new_z);
displacedVertices [i] = newvertPos;
} else {
displacedVertices [i] = originalVertices [i];
}
}
} else {
for (int i = 0; i < originalVertices.Length; i++) {
if (Vector3.Distance (transform.TransformPoint (originalVertices [i]), Effector.transform.position) >= EffectorDistance) {
float dist = Vector3.Distance (transform.TransformPoint (originalVertices [i]), Effector.transform.position);
normalizedCurve = (dist - EffectorDistance) / EffectorDistance;
curveValue = Refinecurve.Evaluate (normalizedCurve);
float x, y, z;
x = originalVertices [i].x;
y = originalVertices [i].y;
z = originalVertices [i].z;
switch (DeformAxis) {
case Axis.X:
new_y = y;
ysquared = Mathf.Pow (y + OffsetA, 2);
zsquared = Mathf.Pow (z + OffsetB, 2);
new_x = x + Mathf.Sin (Frequency * Mathf.Sqrt (ysquared + zsquared) + Phaze) * PeakMultiplier * curveValue;
new_z = z;
break;
case Axis.Y:
new_x = x;
xsquared = Mathf.Pow (x + OffsetA, 2);
zsquared = Mathf.Pow (z + OffsetB, 2);
new_y = y + Mathf.Sin (Frequency * Mathf.Sqrt (xsquared + zsquared) + Phaze) * PeakMultiplier * curveValue;
new_z = z;
break;
case Axis.Z:
new_x = x;
xsquared = Mathf.Pow (x + OffsetA, 2);
ysquared = Mathf.Pow (y + OffsetB, 2);
new_z = z + Mathf.Sin (Frequency * Mathf.Sqrt (xsquared + ysquared) + Phaze) * PeakMultiplier * curveValue;
new_y = y;
break;
}
Vector3 newvertPos = new Vector3 (new_x, new_y, new_z);
displacedVertices [i] = newvertPos;
} else {
displacedVertices [i] = originalVertices [i];
}
}
}
deformingMesh.vertices = displacedVertices;
deformingMesh.RecalculateNormals();
}
public void animateRipple()
{
Phaze += Time.deltaTime * AnimationSpeed;
}
void Ripple()
{
for (int i = 0; i < originalVertices.Length; i++) {
float x, y, z;
x = originalVertices [i].x;
y = originalVertices [i].y;
z = originalVertices [i].z;
switch (DeformAxis)
{
case Axis.X:
new_y = y;
ysquared = Mathf.Pow (y+OffsetA, 2);
zsquared = Mathf.Pow (z+OffsetB, 2);
new_x = x + Mathf.Sin (Frequency * Mathf.Sqrt (ysquared +zsquared) + Phaze)*PeakMultiplier;
new_z = z;
break;
case Axis.Y:
new_x = x;
xsquared = Mathf.Pow (x+OffsetA,2);
zsquared = Mathf.Pow (z+OffsetB,2);
new_y =y + Mathf.Sin (Frequency * Mathf.Sqrt (xsquared +zsquared) + Phaze)*PeakMultiplier;
new_z = z;
break;
case Axis.Z:
new_x = x;
xsquared = Mathf.Pow (x+OffsetA, 2);
ysquared = Mathf.Pow (y+OffsetB, 2);
new_z = z + Mathf.Sin (Frequency * Mathf.Sqrt (xsquared +ysquared) + Phaze)*PeakMultiplier;
new_y = y;
break;
}
Vector3 newvertPos = new Vector3 (new_x, new_y, new_z);
displacedVertices [i] = newvertPos;
}
deformingMesh.vertices = displacedVertices;
deformingMesh.RecalculateNormals();
}
}
fileFormatVersion: 2
guid: 5fbb70b48805cd04083940578d45f997
timeCreated: 1480949819
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SimpleBlendShape : MonoBehaviour {
[Tooltip("calculte every frame or just at start")]
public bool isStatic = false;
[Tooltip("the shape you want this mesh to transform into (must be a variation of the original mesh)")]
public GameObject targetMeshObject;
[Tooltip("how much do u want to blent (0 no blend, 1 full blend, < 0 under blend, > 1 over blend")]
[Range(-1.0f,2.0f)]
public float Weight;
Mesh deformingMesh;
Mesh targetsMesh;
float new_x,new_y,new_z,newnorx,newnory,newnorz;
float distx = 0, disty = 0, distz = 0, norx = 0,nory = 0,norz = 0;
Vector3[] originalVertices, displacedVertices,originalnormals,diplacednormals,targetVetricies,targetNormals;
Vector3 newvertPos=Vector3.zero;
Vector3 newnorms=Vector3.zero;
void Start ()
{
deformingMesh = GetComponent<MeshFilter>().mesh;
originalVertices = deformingMesh.vertices;
originalnormals = deformingMesh.normals;
displacedVertices = new Vector3[originalVertices.Length];
diplacednormals = new Vector3[originalVertices.Length];
targetsMesh = targetMeshObject.GetComponent<MeshFilter> ().mesh;
targetVetricies = targetsMesh.vertices;
targetNormals = targetsMesh.normals;
for (int i = 0; i < originalVertices.Length; i++)
{
displacedVertices[i] = originalVertices[i];
}
if(isStatic)
{
blendshapes();
}
}
void Update ()
{
if(!isStatic )
{
blendshapes();
}
}
void blendshapes()
{
for (int i = 0; i < originalVertices.Length; i++)
{
distx = (targetVetricies[i].x - originalVertices [i].x)*Weight;
disty = (targetVetricies[i].y - originalVertices [i].y)*Weight;
distz = (targetVetricies[i].z - originalVertices [i].z)*Weight;
norx = targetNormals [i].x * Weight;
nory = targetNormals [i].y * Weight;
norz= targetNormals [i].z * Weight;
new_x = originalVertices [i].x + distx;
new_y = originalVertices [i].y + disty;
new_z = originalVertices [i].z + distz;
newvertPos.Set(new_x, new_y, new_z);
newnorms.Set(norx, nory, norz);
displacedVertices [i] = newvertPos;
diplacednormals [i] = newnorms + originalnormals[i]*(1-Weight);
}
deformingMesh.vertices = displacedVertices;
deformingMesh.normals = diplacednormals;
}
}
fileFormatVersion: 2
guid: eb83819b79f7eff4593a808f2e64dd82
timeCreated: 1493709089
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8b8571080928a5444983304707af9998
timeCreated: 1481192521
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 600e7f42fe515174d86fbe3cd82a5c13
timeCreated: 1480927961
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: eeba62c939e60fd4ca9008c092da689d
folderAsset: yes
timeCreated: 1481717325
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectRotateEffectorDeformer : MonoBehaviour {
public float RotateX = 0.0f,RotateY = 60.0f,RotateZ = 0.0f;
Transform[] originalObjects, movedObjects;
Vector3 [] displacedObjects, originalPositions;
Vector3 newObjectPos;
public GameObject Effector;
private float EffectorDistance = 3.0f;
private float EffectorRecoverySpeed = 10.0f;
private bool InvertedEffector = false;
private float[] OriginalY,OriginalX,OriginalZ;
private float[] oriRotX, oriRotY, oriRotZ;
private Vector3 originalsLerper,OriginalsPos;
private Vector3 RotationVector = Vector3.zero;
private EffectorVal theEffector;
private float normalizedCurve, curveValue = 1f;
private AnimationCurve Refinecurve;
private float rangeSmallest = 0f;
void Start ()
{
if (Effector == null) {
Debug.LogWarning ("Please assign an effector to the effector Value, to create an effector go to: Mesh Deformer -> createEffector");
} else
{
theEffector = Effector.GetComponent<EffectorVal> ();
}
originalObjects = new Transform[transform.childCount];
movedObjects = new Transform[originalObjects.Length];
displacedObjects = new Vector3[originalObjects.Length];
OriginalY = new float[originalObjects.Length];
OriginalX = new float[originalObjects.Length];
OriginalZ = new float[originalObjects.Length];
oriRotX = new float[originalObjects.Length];
oriRotY = new float[originalObjects.Length];
oriRotZ = new float[originalObjects.Length];
originalPositions = new Vector3[originalObjects.Length];
for (int i = 0; i < transform.childCount; i++)
{
originalObjects [i] = transform.GetChild (i);
displacedObjects [i] = originalObjects [i].position;
originalPositions[i] = originalObjects [i].position;
}
movedObjects = originalObjects;
for (int i = 0; i < originalObjects.Length; i++)
{
OriginalY [i] = originalObjects [i].transform.position.y;
OriginalX [i] = originalObjects [i].transform.position.x;
OriginalZ [i] = originalObjects [i].transform.position.z;
oriRotY [i] = originalObjects [i].transform.eulerAngles.y;
oriRotX [i] = originalObjects [i].transform.eulerAngles.x;
oriRotZ [i] = originalObjects [i].transform.eulerAngles.z;
}
}
void FixedUpdate()
{
if (Effector != null) {
TransformChanger ();
}
}
void TransformChanger ()
{
InvertedEffector = theEffector.Inverted;
Refinecurve = theEffector.FallOffCurve;
EffectorDistance = theEffector.EffectorDistance;
EffectorRecoverySpeed = theEffector.EffectorRecoverySpeed;
for (int i = 0; i < originalObjects.Length; i++) {
float x, y, z;
Vector3 posstatic = new Vector3 (OriginalX [i], OriginalY [i], OriginalZ [i]);
float dist = Vector3.Distance (posstatic, Effector.transform.position);
normalizedCurve = (dist - rangeSmallest) / (EffectorDistance - rangeSmallest);
curveValue = Refinecurve.Evaluate (normalizedCurve);
x = oriRotX [i] + RotateX*curveValue;
y = oriRotY [i] + RotateY*curveValue;
z = oriRotZ [i] + RotateZ*curveValue;
float new_x = x;
float new_y = y;
float new_z = z;
newObjectPos = new Vector3 (new_x, new_y, new_z);
displacedObjects [i] = newObjectPos;
}
if (!InvertedEffector) {
for (int x = 0; x < originalObjects.Length; x++) {
OriginalsPos.Set (OriginalX [x], OriginalY [x], OriginalZ [x]);
if (Vector3.Distance (OriginalsPos, Effector.transform.position) <= EffectorDistance) {
float xLerp = Mathf.LerpAngle(movedObjects [x].transform.eulerAngles.x, displacedObjects [x].x, EffectorRecoverySpeed * Time.deltaTime);
float yLerp = Mathf.LerpAngle(movedObjects [x].transform.eulerAngles.y, displacedObjects [x].y, EffectorRecoverySpeed * Time.deltaTime);
float zLerp = Mathf.LerpAngle(movedObjects [x].transform.eulerAngles.z, displacedObjects [x].z, EffectorRecoverySpeed * Time.deltaTime);
RotationVector.Set (xLerp, yLerp, zLerp);
movedObjects [x].eulerAngles = RotationVector;
} else {
originalsLerper.Set (oriRotX [x], oriRotY [x], oriRotZ [x]);
float xLerp = Mathf.LerpAngle(movedObjects [x].transform.eulerAngles.x, originalsLerper.x, EffectorRecoverySpeed * Time.deltaTime);
float yLerp = Mathf.LerpAngle(movedObjects [x].transform.eulerAngles.y, originalsLerper.y, EffectorRecoverySpeed * Time.deltaTime);
float zLerp = Mathf.LerpAngle(movedObjects [x].transform.eulerAngles.z, originalsLerper.z, EffectorRecoverySpeed * Time.deltaTime);
RotationVector.Set (xLerp, yLerp, zLerp);
movedObjects [x].eulerAngles = RotationVector;
}
}
} else {
for (int x = 0; x < originalObjects.Length; x++) {
OriginalsPos.Set (OriginalX [x], OriginalY [x], OriginalZ [x]);
if (Vector3.Distance (OriginalsPos, Effector.transform.position) > EffectorDistance) {
float xLerp = Mathf.LerpAngle(movedObjects [x].transform.eulerAngles.x, displacedObjects [x].x, EffectorRecoverySpeed * Time.deltaTime);
float yLerp = Mathf.LerpAngle(movedObjects [x].transform.eulerAngles.y, displacedObjects [x].y, EffectorRecoverySpeed * Time.deltaTime);
float zLerp = Mathf.LerpAngle(movedObjects [x].transform.eulerAngles.z, displacedObjects [x].z, EffectorRecoverySpeed * Time.deltaTime);
RotationVector.Set (xLerp, yLerp, zLerp);
movedObjects [x].eulerAngles = RotationVector;
} else {
originalsLerper.Set (oriRotX [x], oriRotY [x], oriRotZ [x]);
float xLerp = Mathf.LerpAngle(movedObjects [x].transform.eulerAngles.x, originalsLerper.x, EffectorRecoverySpeed * Time.deltaTime);
float yLerp = Mathf.LerpAngle(movedObjects [x].transform.eulerAngles.y, originalsLerper.y, EffectorRecoverySpeed * Time.deltaTime);
float zLerp = Mathf.LerpAngle(movedObjects [x].transform.eulerAngles.z, originalsLerper.z, EffectorRecoverySpeed * Time.deltaTime);
RotationVector.Set (xLerp, yLerp, zLerp);
movedObjects [x].eulerAngles = RotationVector;
}
}
}
}
}
fileFormatVersion: 2
guid: 84a71ed04f62b6646b2dc6f300c7db89
timeCreated: 1487931449
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectScaleEffectorDeformer : MonoBehaviour {
public float ScaleX = 0.0f,ScaleY = 1.0f,ScaleZ = 0.0f;
Transform[] originalObjects, movedObjects;
Vector3 [] displacedObjects, originalPositions;
Vector3 newObjectPos;
public GameObject Effector;
private float EffectorDistance = 3.0f;
private float EffectorRecoverySpeed = 10.0f;
private float[] OriginalY,OriginalX,OriginalZ;
private float[] oriScaleX, oriScaleY, oriScaleZ;
private Vector3 originalsLerper,OriginalsPos;
public bool UseAsMultiplier = false;
private bool InvertedEffector = false;
private EffectorVal theEffector;
private float normalizedCurve, curveValue = 1f;
private AnimationCurve Refinecurve;
private float rangeSmallest = 0f;
void Start ()
{
if (Effector == null) {
Debug.LogWarning ("Please assign an effector to the effector Value, to create an effector go to: Mesh Deformer -> createEffector");
} else
{
theEffector = Effector.GetComponent<EffectorVal> ();
}
originalObjects = new Transform[transform.childCount];
movedObjects = new Transform[originalObjects.Length];
displacedObjects = new Vector3[originalObjects.Length];
OriginalY = new float[originalObjects.Length];
OriginalX = new float[originalObjects.Length];
OriginalZ = new float[originalObjects.Length];
oriScaleX = new float[originalObjects.Length];
oriScaleY = new float[originalObjects.Length];
oriScaleZ = new float[originalObjects.Length];
originalPositions = new Vector3[originalObjects.Length];
for (int i = 0; i < transform.childCount; i++)
{
originalObjects [i] = transform.GetChild (i);
displacedObjects [i] = originalObjects [i].position;
originalPositions[i] = originalObjects [i].position;
}
movedObjects = originalObjects;
for (int i = 0; i < originalObjects.Length; i++)
{
OriginalY [i] = originalObjects [i].transform.position.y;
OriginalX [i] = originalObjects [i].transform.position.x;
OriginalZ [i] = originalObjects [i].transform.position.z;
oriScaleY [i] = originalObjects [i].transform.localScale.y;
oriScaleX [i] = originalObjects [i].transform.localScale.x;
oriScaleZ [i] = originalObjects [i].transform.localScale.z;
}
}
void FixedUpdate()
{
if (Effector != null) {
TransformChanger ();
}
}
void TransformChanger ()
{
InvertedEffector = theEffector.Inverted;
Refinecurve = theEffector.FallOffCurve;
EffectorDistance = theEffector.EffectorDistance;
EffectorRecoverySpeed = theEffector.EffectorRecoverySpeed;
for (int i = 0; i < originalObjects.Length; i++) {
float x, y, z;
Vector3 posstatic = new Vector3 (OriginalX [i], OriginalY [i], OriginalZ [i]);
float dist = Vector3.Distance (posstatic, Effector.transform.position);
normalizedCurve = (dist - rangeSmallest) / (EffectorDistance - rangeSmallest);
curveValue = Refinecurve.Evaluate (normalizedCurve);
if (!UseAsMultiplier) {
x = oriScaleX [i] + ScaleX*curveValue;
y = oriScaleY [i] + ScaleY*curveValue;
z = oriScaleZ [i] + ScaleZ*curveValue;
} else {
x = oriScaleX [i] * ScaleX*curveValue;
y = oriScaleY [i] * ScaleY*curveValue;
z = oriScaleZ [i] * ScaleZ*curveValue;
}
float new_x = x;
float new_y = y;
float new_z = z;
newObjectPos = new Vector3 (new_x, new_y, new_z);
displacedObjects [i] = newObjectPos;
}
if (!InvertedEffector) {
for (int x = 0; x < originalObjects.Length; x++) {
OriginalsPos.Set (OriginalX [x], OriginalY [x], OriginalZ [x]);
if (Vector3.Distance (OriginalsPos, Effector.transform.position) <= EffectorDistance) {
movedObjects [x].localScale = Vector3.Lerp (movedObjects [x].transform.localScale, displacedObjects [x], EffectorRecoverySpeed * Time.deltaTime);
} else {
originalsLerper.Set (oriScaleX [x], oriScaleX [x], oriScaleX [x]);
movedObjects [x].localScale = Vector3.Lerp (movedObjects [x].transform.localScale, originalsLerper, EffectorRecoverySpeed * Time.deltaTime);
}
}
} else {
for (int x = 0; x < originalObjects.Length; x++) {
OriginalsPos.Set (OriginalX [x], OriginalY [x], OriginalZ [x]);
if (Vector3.Distance (OriginalsPos, Effector.transform.position) > EffectorDistance) {
movedObjects [x].localScale = Vector3.Lerp (movedObjects [x].transform.localScale, displacedObjects [x], EffectorRecoverySpeed * Time.deltaTime);
} else {
originalsLerper.Set (oriScaleX [x], oriScaleX [x], oriScaleX [x]);
movedObjects [x].localScale = Vector3.Lerp (movedObjects [x].transform.localScale, originalsLerper, EffectorRecoverySpeed * Time.deltaTime);
}
}
}
}
}
fileFormatVersion: 2
guid: c262c3156e0c53f4dbce2cb629181ce1
timeCreated: 1487929289
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectTransformEffectorDeformer : MonoBehaviour {
public float TranslateX = 0.0f,TranslateY = 1.0f,TranslateZ = 0.0f;
Transform[] originalObjects, movedObjects;
Vector3 [] displacedObjects, originalPositions;
Vector3 newObjectPos;
public GameObject Effector;
private float EffectorDistance = 3.0f;
private float EffectorRecoverySpeed = 10.0f;
private bool InvertedEffector = false;
private float[] OriginalY,OriginalX,OriginalZ;
private Vector3 originalsLerper,OriginalsPos;
private AnimationCurve Refinecurve;
private float rangeSmallest = 0f;
private float normalizedCurve, curveValue = 1f;
private EffectorVal theEffector;
void Start ()
{
if (Effector == null) {
Debug.LogWarning ("Please assign an effector to the effector Value, to create an effector go to: Mesh Deformer -> createEffector");
} else
{
theEffector = Effector.GetComponent<EffectorVal> ();
}
originalObjects = new Transform[transform.childCount];
movedObjects = new Transform[originalObjects.Length];
displacedObjects = new Vector3[originalObjects.Length];
OriginalY = new float[originalObjects.Length];
OriginalX = new float[originalObjects.Length];
OriginalZ = new float[originalObjects.Length];
originalPositions = new Vector3[originalObjects.Length];
for (int i = 0; i < transform.childCount; i++)
{
originalObjects [i] = transform.GetChild (i);
displacedObjects [i] = originalObjects [i].position;
originalPositions[i] = originalObjects [i].position;
}
movedObjects = originalObjects;
for (int i = 0; i < originalObjects.Length; i++)
{
OriginalY [i] = originalObjects [i].transform.position.y;
OriginalX [i] = originalObjects [i].transform.position.x;
OriginalZ [i] = originalObjects [i].transform.position.z;
}
}
void FixedUpdate()
{if (Effector != null) {
TransformChanger ();
}
}
void TransformChanger ()
{
InvertedEffector = theEffector.Inverted;
Refinecurve = theEffector.FallOffCurve;
EffectorDistance = theEffector.EffectorDistance;
EffectorRecoverySpeed = theEffector.EffectorRecoverySpeed;
for (int i = 0; i < originalObjects.Length; i++) {
float x, y, z;
Vector3 posstatic = new Vector3 (OriginalX [i], OriginalY [i], OriginalZ [i]);
float dist = Vector3.Distance (posstatic, Effector.transform.position);
normalizedCurve = (dist - rangeSmallest) / (EffectorDistance - rangeSmallest);
curveValue = Refinecurve.Evaluate (normalizedCurve);
x = OriginalX [i] + TranslateX*curveValue;
y = OriginalY [i] + TranslateY*curveValue;
z = OriginalZ [i] + TranslateZ*curveValue;
float new_x = x;
float new_y = y;
float new_z = z;
newObjectPos = new Vector3 (new_x, new_y, new_z);
displacedObjects [i] = newObjectPos;
}
if (!InvertedEffector) {
for (int x = 0; x < originalObjects.Length; x++) {
OriginalsPos.Set (OriginalX [x], OriginalY [x], OriginalZ [x]);
if (Vector3.Distance (OriginalsPos, Effector.transform.position) <= EffectorDistance) {
movedObjects [x].position = Vector3.Lerp (movedObjects [x].position, displacedObjects [x], EffectorRecoverySpeed * Time.deltaTime);
} else {
originalsLerper.Set (OriginalX [x], OriginalY [x], OriginalZ [x]);
movedObjects [x].position = Vector3.Lerp (movedObjects [x].transform.position, originalsLerper, EffectorRecoverySpeed * Time.deltaTime);
}
}
}
else {
for (int x = 0; x < originalObjects.Length; x++) {
OriginalsPos.Set (OriginalX [x], OriginalY [x], OriginalZ [x]);
if (Vector3.Distance (OriginalsPos, Effector.transform.position) > EffectorDistance) {
movedObjects [x].position = Vector3.Lerp (movedObjects [x].position, displacedObjects [x], EffectorRecoverySpeed * Time.deltaTime);
} else {
originalsLerper.Set (OriginalX [x], OriginalY [x], OriginalZ [x]);
movedObjects [x].position = Vector3.Lerp (movedObjects [x].transform.position, originalsLerper, EffectorRecoverySpeed * Time.deltaTime);
}
}
}
}
}
fileFormatVersion: 2
guid: 72a9f33b4d1020249b07a42e08110453
timeCreated: 1487926364
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class ObjectsImageDeformer : MonoBehaviour {
[Tooltip("The image used for the deformation. Must be set to Advanced, and Read/Write Enabled must be true in the texture import settings")]
public Texture2D heightmap;
public enum Axis {X,Y,Z};
[Tooltip("Choose the Axis you want the deformer to work on, set this value before hitting play")]
public Axis DeformAxis = Axis.Y;
[Tooltip("calculate the deformation once at Start or keep it dynamic")]
public bool IsStaic = false;
[Tooltip("Height Multiplier of the deformer")]
public float Height = 5.0f;
[Tooltip("offset the image texture (kind of like repeat UV")]
public float StretchX= 1.01f,StretchXB= 1.01f,StretchZ= 1.01f,StretchZB = 1.01f;
[Tooltip("An Array of textures that the deformer can use as an animation. Must be set to Advanced, and Read/Write Enabled must be true in the texture import settings")]
public Texture2D[] AnimatableMaps;
[Tooltip("enable the Animation through the array of images")]
public bool AnimateThroughMaps = false;
[Tooltip("Loop Through the animation")]
public bool AnimLoop = false;
[Tooltip("time to change the image")]
public float AnimFrameChangeInSec = 1.0f;
private float tempAnimVal = 1.0f;
private float startTime = 0.0f;
private int startval = 0;
private float[] OriginalY,OriginalX,OriginalZ;
Transform[] originalObjects, movedObjects;
Vector3 [] displacedObjects, originalPositions;
float smallestX,largestX,smallestZ,largestZ,smallestY,largestY = 0;
void Start ()
{
tempAnimVal = AnimFrameChangeInSec;
originalObjects = new Transform[transform.childCount];
movedObjects = new Transform[originalObjects.Length];
OriginalY = new float[originalObjects.Length];
OriginalX = new float[originalObjects.Length];
OriginalZ = new float[originalObjects.Length];
for (int i = 0; i < transform.childCount; i++)
{
originalObjects [i] = transform.GetChild (i);
}
movedObjects = originalObjects;
if (originalObjects.Length != 0) //check if the array is empty
{
smallestX = originalObjects [0].transform.position.x;//set an initial relevant value
largestX = smallestX;//set an initial relevant value
smallestZ = originalObjects [0].transform.position.z;//set an initial relevant value
largestZ = smallestZ;//set an initial relevant value
for (int i = 0; i < originalObjects.Length; i++) //find the smallest and largest values of x and z to be able to normalize later on
{
OriginalY [i] = originalObjects [i].transform.position.y;
OriginalX [i] = originalObjects [i].transform.position.x;
OriginalZ [i] = originalObjects [i].transform.position.z;
if (originalObjects [i].transform.position.x < smallestX) {
smallestX = originalObjects [i].transform.position.x;
}
if (originalObjects [i].transform.position.x > largestX) {
largestX = originalObjects [i].transform.position.x;
}
if (originalObjects [i].transform.position.y < smallestY) {
smallestY = originalObjects [i].transform.position.y;
}
if (originalObjects [i].transform.position.y > largestY) {
largestY = originalObjects [i].transform.position.y;
}
if (originalObjects [i].transform.position.z < smallestZ) {
smallestZ = originalObjects [i].transform.position.z;
}
if (originalObjects [i].transform.position.z > largestZ) {
largestZ = originalObjects [i].transform.position.z;
}
}
}
else
{
Debug.Log ("Add children to the object with this script");
}
if (IsStaic)
{
moveObjects ();
}
}
void FixedUpdate()
{
if (!IsStaic)
{
if (AnimateThroughMaps == true && AnimatableMaps.Length != 0) {
heightmap = AnimatableMaps [startval];
startTime += Time.deltaTime;
if(startTime >= tempAnimVal)
{
startval++;
if (startval >= AnimatableMaps.Length&& AnimLoop == true) {
startval = 0;
}
else if(startval >= AnimatableMaps.Length && AnimLoop == false)
{
startval = AnimatableMaps.Length - 1;
}
tempAnimVal += AnimFrameChangeInSec;
}
}
moveObjects ();
}
}
void moveObjects()
{
switch (DeformAxis)
{
case Axis.X:
DeformX ();
break;
case Axis.Y:
DeformY ();
break;
case Axis.Z:
DeformZ ();
break;
}
}
void DeformX()
{
for (int i = 0; i < originalObjects.Length; i++)
{
float normalizedY = (OriginalY [i] - smallestY*StretchX) / (largestY*StretchXB - smallestY*StretchX);
float normalizedZ = (OriginalZ [i]- smallestZ*StretchZ) / (largestZ*StretchZB - smallestZ*StretchZ);
int y = Mathf.FloorToInt(normalizedY * heightmap.width);
int z = Mathf.FloorToInt(normalizedZ * heightmap.height);
Vector3 pos = originalObjects [i].position;
float HeightValue = heightmap.GetPixel (y, z).grayscale * Height;
pos.x = OriginalX[i] + HeightValue;
movedObjects[i].position = pos;
}
}
void DeformY()
{
for (int i = 0; i < originalObjects.Length; i++)
{
float normalizedX = (OriginalX [i] - smallestX*StretchX) / (largestX*StretchXB - smallestX*StretchX);
float normalizedZ = (OriginalZ [i] - smallestZ*StretchZ) / (largestZ*StretchZB - smallestZ*StretchZ);
int x = Mathf.FloorToInt(normalizedX * heightmap.width);
int z = Mathf.FloorToInt(normalizedZ * heightmap.height);
Vector3 pos = originalObjects [i].position;
float HeightValue = heightmap.GetPixel (x, z).grayscale * Height;
pos.y = OriginalY[i] + HeightValue;
movedObjects[i].position = pos;
}
}
void DeformZ()
{
for (int i = 0; i < originalObjects.Length; i++)
{
float normalizedX = (OriginalX [i] - smallestX*StretchX) / (largestX*StretchXB - smallestX*StretchX);
float normalizedY = (OriginalY [i] - smallestY*StretchZ) / (largestY*StretchZB - smallestY*StretchZ);
int x = Mathf.FloorToInt(normalizedX * heightmap.width);
int y = Mathf.FloorToInt(normalizedY * heightmap.height);
Vector3 pos = originalObjects [i].position;
float HeightValue = heightmap.GetPixel (x, y).grayscale * Height;
pos.z = OriginalZ[i] + HeightValue;
movedObjects[i].position = pos;
}
}
}
fileFormatVersion: 2
guid: e2848ecaa68c0e34eb0e23966fe84c3d
timeCreated: 1484047685
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class ObjectsRipple : MonoBehaviour {
public enum Axis {X,Y,Z};
[Tooltip("Choose the Axis you want the deformer to work on")]
public Axis DeformAxis = Axis.Y;
[Tooltip("increase or decrease Ripples")]
public float Frequency =2.0f;
[Tooltip("Cycle through the Ripples")]
public float Phaze = 1.0f;
[Tooltip("Height of the Ripples")]
public float PeakMultiplier=1.0f;
[Tooltip("Enable the animation of the Ripples, PS. animates the phase value")]
public bool AnimatePhaze = false;
[Tooltip("The speed for animating the ripples")]
public float AnimationSpeed = 10.0f;
[Tooltip("Offset the Ripple center")]
public float OffsetRippleCenterA = 1.0f, OffsetRippleCenterB= 1.0f;
[Tooltip("Move objects in a Set Axis")]
public float moveX, moveY, moveZ = 0;
[Tooltip("Defines whether the Deformer is static or Dynamic, if true, the deformer will only be calculated once at Start")]
public bool IsStaic = false;
float new_y, new_x, new_z,xsquared,ysquared,zsquared = 0;
Mesh deformingMesh;
Transform[] originalObjects, movedObjects;
Vector3 [] displacedObjects, originalPositions;
Vector3 newObjectPos = Vector3.zero;
void Start ()
{
originalObjects = new Transform[transform.childCount];
movedObjects = new Transform[originalObjects.Length];
displacedObjects = new Vector3[originalObjects.Length];
originalPositions = new Vector3[originalObjects.Length];
for (int i = 0; i < transform.childCount; i++)
{
originalObjects [i] = transform.GetChild (i);
displacedObjects [i] = originalObjects [i].position;
originalPositions[i] = originalObjects [i].position;
}
movedObjects = originalObjects;
if (IsStaic)
{
Ripple ();
}
}
void FixedUpdate()
{
if (!IsStaic) {
Ripple ();
if (AnimatePhaze) {
animateRipple ();
}
}
}
void Ripple()
{
for (int i = 0; i < originalObjects.Length; i++) {
float x = originalPositions [i].x + moveX;
float y = originalPositions [i].y + moveY;
float z = originalPositions [i].z + moveZ;
switch (DeformAxis)
{
case Axis.X:
new_y = y;
ysquared = Mathf.Pow (y+OffsetRippleCenterA, 2);
zsquared = Mathf.Pow (z+OffsetRippleCenterB, 2);
new_x = x + Mathf.Sin (Frequency * Mathf.Sqrt (ysquared +zsquared) + Phaze)*PeakMultiplier;
new_z = z;
break;
case Axis.Y:
new_x = x;
new_z = z;
xsquared = Mathf.Pow (x+OffsetRippleCenterA,2);
zsquared = Mathf.Pow (z+OffsetRippleCenterB,2);
new_y = y + Mathf.Sin (Frequency * Mathf.Sqrt (xsquared +zsquared) + Phaze)*PeakMultiplier;
break;
case Axis.Z:
new_x = x;
xsquared = Mathf.Pow (x+OffsetRippleCenterA, 2);
ysquared = Mathf.Pow (y+OffsetRippleCenterB, 2);
new_z = z + Mathf.Sin (Frequency * Mathf.Sqrt (xsquared +ysquared) + Phaze)*PeakMultiplier;
new_y = y;
break;
}
newObjectPos.Set(new_x, new_y, new_z); //Vector3.set
displacedObjects [i] = newObjectPos;
}
for (int x = 0; x < originalObjects.Length; x++)
{
movedObjects [x].position = displacedObjects [x];
}
}
public void animateRipple()
{
Phaze += Time.deltaTime * AnimationSpeed;
}
}
fileFormatVersion: 2
guid: 998a6fa29423ffe4b928d1e8b7a96cfe
timeCreated: 1481630994
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class ObjectsSine : MonoBehaviour {
//Public Vars
public enum Axis {X,Y,Z};
[Tooltip("Choose the Axis you want the deformer to work on")]
public Axis DeformAxis = Axis.Y;
[Tooltip("Use this curve to further refine the deformation")]
public AnimationCurve Refinecurve ;
[Tooltip("Choose the Axis the curve will act on")]
public Axis CurveInfluence = Axis.X;
[Tooltip("the amount of sine waves")]
public float Frequency =0.5f;
[Tooltip("cycle throught the waves")]
public float Phaze = 1.0f;
[Tooltip("Waves Height multiplier")]
public float PeakMultiplier=1.0f;
[Tooltip("Animate the waves")]
public bool AnimatePhaze = false;
[Tooltip("the speed of the waves animation")]
public float AnimationSpeed = 10.0f;
[Tooltip("Defines whether the Deformer is static or Dynamic, if true, the deformer will only be calculated once at Start")]
public bool IsStaic = false;
[Tooltip("move through the corresponding axis")]
public float moveX, moveY, moveZ = 0;
//private Vars
Transform[] originalObjects, movedObjects;
Vector3 [] displacedObjects, originalPositions;
float normalized , curveValue;
float smallestY,largestY,smallestX,largestX,smallestZ,largestZ =0;
float offsetMin,offsetMax = 0;
Vector3 newObjectPos;
private float[] OriginalY,OriginalX,OriginalZ;
private Vector3 originalsLerper;
void Start ()
{
if (Refinecurve.length == 0) {
Refinecurve = new AnimationCurve (new Keyframe (0, 1), new Keyframe (1, 1));
}
originalObjects = new Transform[transform.childCount];
movedObjects = new Transform[originalObjects.Length];
displacedObjects = new Vector3[originalObjects.Length];
OriginalY = new float[originalObjects.Length];
OriginalX = new float[originalObjects.Length];
OriginalZ = new float[originalObjects.Length];
originalPositions = new Vector3[originalObjects.Length];
for (int i = 0; i < transform.childCount; i++)
{
originalObjects [i] = transform.GetChild (i);
displacedObjects [i] = originalObjects [i].position;
originalPositions[i] = originalObjects [i].position;
}
movedObjects = originalObjects;
if(originalObjects.Length !=0)//if the array is not empty fill variables with relevant values
{
smallestY=originalObjects [0].position.y;
largestY=originalObjects [0].position.y;
smallestX=originalObjects [0].position.x;
largestX=originalObjects [0].position.x;
smallestZ=originalObjects [0].position.z;
largestZ =originalObjects [0].position.z;
}
for (int i = 0; i <originalObjects.Length; i++)
{
OriginalY [i] = originalObjects [i].transform.position.y;
OriginalX [i] = originalObjects [i].transform.position.x;
OriginalZ [i] = originalObjects [i].transform.position.z;
if(originalObjects[i].position.y < smallestY)
{
smallestY = originalObjects[i].position.y;
}
if(originalObjects[i].position.y > largestY)
{
largestY = originalObjects[i].position.y ;
}
if(originalObjects[i].position.x < smallestX)
{
smallestX =originalObjects[i].position.x;
}
if(originalObjects[i].position.x > largestX)
{
largestX = originalObjects[i].position.x ;
}
if(originalObjects[i].position.z < smallestZ)
{
smallestZ = originalObjects[i].position.z;
}
if(originalObjects[i].position.z > largestZ)
{
largestZ = originalObjects[i].position.z ;
}
}
if (IsStaic)
{
SineWave ();
}
}
void FixedUpdate()
{
if (!IsStaic) {
SineWave ();
if (AnimatePhaze) {
animateSine ();
}
}
}
void SineWave ()
{
switch (CurveInfluence)
{
case Axis.X:
offsetMin = smallestX;
offsetMax = largestX;
break;
case Axis.Y:
offsetMin = smallestY;
offsetMax = largestY;
break;
case Axis.Z:
offsetMin = smallestZ;
offsetMax = largestZ;
break;
}
if (offsetMin == offsetMax)
{
offsetMin = 0;
offsetMax = 1;
}
for (int i = 0; i < originalObjects.Length; i++)
{
float x, y, z;
x = originalPositions [i].x+ moveX;
y = originalPositions [i].y+ moveY;
z = originalPositions [i].z+ moveZ;
float new_x = x;
float new_y = y;
float new_z = z;
switch (DeformAxis)
{
case Axis.X:
switch (CurveInfluence)
{
case Axis.X:
normalized = (x - offsetMin) / (offsetMax - offsetMin);
break;
case Axis.Y:
normalized = (y - offsetMin) / (offsetMax - offsetMin);
break;
case Axis.Z:
normalized = (z - offsetMin) / (offsetMax - offsetMin);
break;
}
curveValue = Refinecurve.Evaluate (normalized);
new_x = x + Mathf.Sin (Frequency * z + Phaze)*PeakMultiplier*curveValue;
break;
case Axis.Y:
switch (CurveInfluence) {
case Axis.X:
normalized = (x - offsetMin) / (offsetMax - offsetMin);
break;
case Axis.Y:
normalized = (y - offsetMin) / (offsetMax - offsetMin);
break;
case Axis.Z:
normalized = (z - offsetMin) / (offsetMax - offsetMin);
break;
}
curveValue = Refinecurve.Evaluate (normalized);
new_y = y + Mathf.Sin (Frequency * x + Phaze) * PeakMultiplier*curveValue;
break;
case Axis.Z:
switch (CurveInfluence)
{
case Axis.X:
normalized = (x - offsetMin) / (offsetMax - offsetMin);
break;
case Axis.Y:
normalized = (y - offsetMin) / (offsetMax - offsetMin);
break;
case Axis.Z:
normalized = (z - offsetMin) / (offsetMax - offsetMin);
break;
}
curveValue = Refinecurve.Evaluate (normalized);
new_z = z + Mathf.Sin (Frequency * x + Phaze) * PeakMultiplier*curveValue;
break;
}
newObjectPos = new Vector3 (new_x, new_y, new_z);
displacedObjects [i] = newObjectPos;
}
for (int x = 0; x < originalObjects.Length; x++)
{
movedObjects [x].position = displacedObjects [x];
}
}
public void animateSine()
{
Phaze += Time.deltaTime * AnimationSpeed;
}
}
fileFormatVersion: 2
guid: 77bdacba73166794e8567921dc0c5a4f
timeCreated: 1481717354
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 4882334ddb7f0484190999cf4e4578cf
folderAsset: yes
timeCreated: 1489666867
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SkinnedMeshAnimCurveDeformer : MonoBehaviour {
public enum Axis {X,Y,Z};
[Tooltip("Choose the Axis you want the deformer to work on")]
public Axis DeformAxis = Axis.Y;
[Tooltip("Use this curve to define the deformation")]
public AnimationCurve Refinecurve ;
[Tooltip("Deformation Multiplier")]
public float Multiplier = 1.0f;
[Tooltip("Allow unity to re-calculate the normals, sometimes its needed, others no")]
public bool RecalculateNormals = false;
Mesh deformingMesh;
Vector3[] originalVertices, displacedVertices;
float smallestY =0;
float largestY = 0;
private bool ISkinned = true;
void Start ()
{
if (GetComponent<SkinnedMeshRenderer> () == null) {
Debug.Log ("Please assign this script to a Skinned Mesh, you can find out which mesh is skinned by checking if it has a Skinned Mesh Renderer Attached to it");
ISkinned = false;
} else {
if (Refinecurve.length == 0) {
Refinecurve = new AnimationCurve (new Keyframe (0, 0), new Keyframe (1, 0.5f));
}
deformingMesh = GetComponent<SkinnedMeshRenderer> ().sharedMesh;
originalVertices = deformingMesh.vertices;
displacedVertices = new Vector3[originalVertices.Length];
for (int i = 0; i < originalVertices.Length; i++) {
displacedVertices [i] = originalVertices [i];
if (displacedVertices [i].y < smallestY) {
smallestY = displacedVertices [i].y;
}
if (displacedVertices [i].y > largestY) {
largestY = displacedVertices [i].y;
}
}
}
}
void FixedUpdate()
{
if (ISkinned) {
CurveUP ();
}
}
void CurveUP ()
{
for (int i = 0; i < originalVertices.Length; i++)
{
float x, y, z;
x = originalVertices [i].x;
y = originalVertices [i].y;
z = originalVertices [i].z;
float normalized = (y - smallestY) / (largestY - smallestY);
float curveValue = Refinecurve.Evaluate (normalized);
float new_x = x;
float new_y = y;
float new_z = z;
switch (DeformAxis)
{
case Axis.X:
new_x = x + curveValue * Multiplier;
break;
case Axis.Y:
new_y = y + curveValue * Multiplier;
break;
case Axis.Z:
new_z = z + curveValue * Multiplier;
break;
}
Vector3 newvertPos = new Vector3 (new_x, new_y, new_z);
displacedVertices [i] = newvertPos;
}
deformingMesh.vertices = displacedVertices;
if(RecalculateNormals){
deformingMesh.RecalculateNormals();
}
}
void OnApplicationQuit()
{
Multiplier = 0;
Refinecurve = new AnimationCurve (new Keyframe (0, 1), new Keyframe (1, 1));
if (deformingMesh != null) {
CurveUP ();
}
}
}
fileFormatVersion: 2
guid: 049fef82911904a488a0976407d4c550
timeCreated: 1489671162
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SkinnedMeshFlareDeformer : MonoBehaviour {
[Tooltip("Defines whether the Deformer is static or Dynamic, if true, the deformer will only be calculated once at Start, Iportant if you want to create a script to stack deformers")]
public bool isStatic = false;
public enum Axis {X,Y,Z};
[Tooltip("Choose the Axis you want the deformer to work on")]
public Axis DeformAxis = Axis.Y;
[Tooltip("Use the curve to determin the influence of the deformer over the chosen Axis")]
public AnimationCurve Refinecurve ;
[Tooltip("Multiply the over-all effect of the deformer")]
public float Multiplier = 1.0f;
// private Vars
Mesh deformingMesh;
Vector3[] originalVertices, displacedVertices;
Vector3 []normalVerts;
float smallestY,largestY,smallestX,largestX,smallestZ,largestZ,normalized,curveValue =0;
private bool ISkinned = true;
void Start ()
{if (GetComponent<SkinnedMeshRenderer> () == null) {
Debug.Log ("Please assign this script to a Skinned Mesh, you can find out which mesh is skinned by checking if it has a Skinned Mesh Renderer Attached to it");
ISkinned = false;
} else {
if (Refinecurve.length == 0) {
Refinecurve = new AnimationCurve (new Keyframe (0, 0), new Keyframe (1, 1));
}
deformingMesh = GetComponent<SkinnedMeshRenderer> ().sharedMesh;
originalVertices = deformingMesh.vertices;
normalVerts = new Vector3[originalVertices.Length];
displacedVertices = new Vector3[originalVertices.Length];
for (int i = 0; i < originalVertices.Length; i++) {
normalVerts [i] = Vector3.Normalize (deformingMesh.normals [i]);
displacedVertices [i] = originalVertices [i];
if (displacedVertices [i].y < smallestY) {
smallestY = displacedVertices [i].y;
}
if (displacedVertices [i].y > largestY) {
largestY = displacedVertices [i].y;
}
if (displacedVertices [i].x < smallestX) {
smallestX = displacedVertices [i].x;
}
if (displacedVertices [i].x > largestX) {
largestX = displacedVertices [i].x;
}
if (displacedVertices [i].z < smallestZ) {
smallestZ = displacedVertices [i].z;
}
if (displacedVertices [i].z > largestZ) {
largestZ = displacedVertices [i].z;
}
}
flareUP ();
}
}
void FixedUpdate()
{
if (!isStatic && ISkinned) {
flareUP ();
}
}
void flareUP ()
{
for (int i = 0; i < originalVertices.Length; i++)
{
float x, y, z;
x = originalVertices [i].x;
y = originalVertices [i].y;
z = originalVertices [i].z;
float new_x = x;
float new_y = y;
float new_z = z;
switch (DeformAxis)
{
case Axis.X:
normalized = (x - smallestX) / (largestX - smallestX);
curveValue = Refinecurve.Evaluate (normalized);
new_y = (y + normalVerts [i].y/100000.0f)* Multiplier * curveValue;
new_z = (z + normalVerts[i].z/100000.0f)* Multiplier* curveValue;
break;
case Axis.Y:
normalized = (y - smallestY) / (largestY - smallestY);
curveValue = Refinecurve.Evaluate (normalized);
new_x = (x + normalVerts [i].x/100000.0f)* Multiplier * curveValue;
new_z = (z + normalVerts[i].z/100000.0f)* Multiplier* curveValue;
break;
case Axis.Z:
normalized = (z - smallestZ) / (largestZ - smallestZ);
curveValue = Refinecurve.Evaluate (normalized);
new_x = (x + normalVerts [i].x/100000.0f)* Multiplier * curveValue;
new_y = (y + normalVerts[i].y/100000.0f)* Multiplier* curveValue;
break;
}
Vector3 newvertPos = new Vector3 (new_x, new_y, new_z);
displacedVertices [i] = newvertPos;
}
deformingMesh.vertices = displacedVertices;
}
void OnApplicationQuit()
{
Multiplier = 1;
Refinecurve = new AnimationCurve (new Keyframe (0, 1), new Keyframe (1, 1));
if (deformingMesh != null) {
flareUP ();
}
}
}
fileFormatVersion: 2
guid: ae92fe33b754f184488b5350cb38ae64
timeCreated: 1489670373
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e681ade1dc3f3ec46b03747892e2393b
timeCreated: 1489666887
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class skinnedMeshRipple : MonoBehaviour {
public enum Axis {X,Y,Z};
[Tooltip("Choose the Axis you want the deformer to work on")]
public Axis DeformAxis = Axis.Y;
[Tooltip("increase or decrease Ripples")]
public float Frequency =2.0f;
[Tooltip("Cycle through the Ripples")]
public float Phaze = 1.0f;
[Tooltip("Height of the Ripples")]
public float PeakMultiplier=1.0f;
[Tooltip("Enable the animation of the Ripples, PS. animates the phase value")]
public bool AnimatePhaze = false;
[Tooltip("The speed for animating the ripples")]
public float AnimationSpeed = 10.0f;
[Tooltip("Offset the Ripple center")]
public float OffsetA,OffsetB = 0.0f;
[Tooltip("Defines whether the Deformer is static or Dynamic, if true, the deformer will only be calculated once at Start")]
public bool isStatic = false;
[Tooltip("Enable/Disable the use of the effector")]
public bool UseEffector = false;
[Tooltip("The effector Object (must have the effector script attached to it)")]
public GameObject Effector;
float new_y, new_x, new_z,xsquared,ysquared,zsquared = 0;
Mesh deformingMesh;
Vector3[] originalVertices, displacedVertices;
float normalized,curveValue,normalized2,curveValue2;
private bool ISkinned = true;
private EffectorVal theEffector;
private float EffectorDistance = 3.0f;
private bool InvertedEffector = false;
private AnimationCurve Refinecurve;
private float normalizedCurve;
void Start ()
{
if (UseEffector != false) {
if (Effector != null) {
theEffector = Effector.GetComponent<EffectorVal> ();
} else {
Debug.LogWarning ("Please assign an effector to the effector Value, to create an effector go to: Mesh Deformer -> createEffector");
}
}
if (GetComponent<SkinnedMeshRenderer> () == null) {
Debug.Log ("Please assign this script to a Skinned Mesh, you can find out which mesh is skinned by checking if it has a Skinned Mesh Renderer Attached to it");
ISkinned = false;
} else {
deformingMesh = GetComponent<SkinnedMeshRenderer> ().sharedMesh;
originalVertices = deformingMesh.vertices;
displacedVertices = new Vector3[originalVertices.Length];
if (isStatic) {
if (!UseEffector) {
Ripple ();
} else {
RippleEffector ();
}
}
}
}
void FixedUpdate()
{
if (ISkinned) {
if (!isStatic) {
if (!UseEffector) {
Ripple ();
} else {
RippleEffector ();
}
if (AnimatePhaze) {
animateRipple ();
}
}
}
}
void Ripple()
{
for (int i = 0; i < originalVertices.Length; i++) {
float x, y, z;
x = originalVertices [i].x;
y = originalVertices [i].y;
z = originalVertices [i].z;
switch (DeformAxis)
{
case Axis.X:
new_y = y;
ysquared = Mathf.Pow (y+OffsetA, 2);
zsquared = Mathf.Pow (z+OffsetB, 2);
new_x = x + Mathf.Sin (Frequency * Mathf.Sqrt (ysquared +zsquared) + Phaze)*PeakMultiplier;
new_z = z;
break;
case Axis.Y:
new_x = x;
xsquared = Mathf.Pow (x+OffsetA,2);
zsquared = Mathf.Pow (z+OffsetB,2);
new_y =y + Mathf.Sin (Frequency * Mathf.Sqrt (xsquared +zsquared) + Phaze)*PeakMultiplier;
new_z = z;
break;
case Axis.Z:
new_x = x;
xsquared = Mathf.Pow (x+OffsetA, 2);
ysquared = Mathf.Pow (y+OffsetB, 2);
new_z = z + Mathf.Sin (Frequency * Mathf.Sqrt (xsquared +ysquared) + Phaze)*PeakMultiplier;
new_y = y;
break;
}
Vector3 newvertPos = new Vector3 (new_x, new_y, new_z);
displacedVertices [i] = newvertPos;
}
deformingMesh.vertices = displacedVertices;
}
public void animateRipple()
{
Phaze += Time.deltaTime * AnimationSpeed;
}
void OnApplicationQuit()
{
PeakMultiplier = 0;
if (deformingMesh != null) {
Ripple ();
}
}
void RippleEffector()
{
InvertedEffector = theEffector.Inverted;
Refinecurve = theEffector.FallOffCurve;
EffectorDistance = theEffector.EffectorDistance;
if (!InvertedEffector) {
for (int i = 0; i < originalVertices.Length; i++) {
if (Vector3.Distance (transform.TransformPoint (originalVertices [i]), Effector.transform.position) <= EffectorDistance) {
float dist = Vector3.Distance (transform.TransformPoint (originalVertices [i]), Effector.transform.position);
normalizedCurve = dist / EffectorDistance;
curveValue = Refinecurve.Evaluate (normalizedCurve);
float x, y, z;
x = originalVertices [i].x;
y = originalVertices [i].y;
z = originalVertices [i].z;
switch (DeformAxis) {
case Axis.X:
new_y = y;
ysquared = Mathf.Pow (y + OffsetA, 2);
zsquared = Mathf.Pow (z + OffsetB, 2);
new_x = x + Mathf.Sin (Frequency * Mathf.Sqrt (ysquared + zsquared) + Phaze) * PeakMultiplier * curveValue;
new_z = z;
break;
case Axis.Y:
new_x = x;
xsquared = Mathf.Pow (x + OffsetA, 2);
zsquared = Mathf.Pow (z + OffsetB, 2);
new_y = y + Mathf.Sin (Frequency * Mathf.Sqrt (xsquared + zsquared) + Phaze) * PeakMultiplier * curveValue;
new_z = z;
break;
case Axis.Z:
new_x = x;
xsquared = Mathf.Pow (x + OffsetA, 2);
ysquared = Mathf.Pow (y + OffsetB, 2);
new_z = z + Mathf.Sin (Frequency * Mathf.Sqrt (xsquared + ysquared) + Phaze) * PeakMultiplier * curveValue;
new_y = y;
break;
}
Vector3 newvertPos = new Vector3 (new_x, new_y, new_z);
displacedVertices [i] = newvertPos;
} else {
displacedVertices [i] = originalVertices [i];
}
}
} else {
for (int i = 0; i < originalVertices.Length; i++) {
if (Vector3.Distance (transform.TransformPoint (originalVertices [i]), Effector.transform.position) >= EffectorDistance) {
float dist = Vector3.Distance (transform.TransformPoint (originalVertices [i]), Effector.transform.position);
normalizedCurve = (dist - EffectorDistance) / EffectorDistance;
curveValue = Refinecurve.Evaluate (normalizedCurve);
float x, y, z;
x = originalVertices [i].x;
y = originalVertices [i].y;
z = originalVertices [i].z;
switch (DeformAxis) {
case Axis.X:
new_y = y;
ysquared = Mathf.Pow (y + OffsetA, 2);
zsquared = Mathf.Pow (z + OffsetB, 2);
new_x = x + Mathf.Sin (Frequency * Mathf.Sqrt (ysquared + zsquared) + Phaze) * PeakMultiplier * curveValue;
new_z = z;
break;
case Axis.Y:
new_x = x;
xsquared = Mathf.Pow (x + OffsetA, 2);
zsquared = Mathf.Pow (z + OffsetB, 2);
new_y = y + Mathf.Sin (Frequency * Mathf.Sqrt (xsquared + zsquared) + Phaze) * PeakMultiplier * curveValue;
new_z = z;
break;
case Axis.Z:
new_x = x;
xsquared = Mathf.Pow (x + OffsetA, 2);
ysquared = Mathf.Pow (y + OffsetB, 2);
new_z = z + Mathf.Sin (Frequency * Mathf.Sqrt (xsquared + ysquared) + Phaze) * PeakMultiplier * curveValue;
new_y = y;
break;
}
Vector3 newvertPos = new Vector3 (new_x, new_y, new_z);
displacedVertices [i] = newvertPos;
} else {
displacedVertices [i] = originalVertices [i];
}
}
}
deformingMesh.vertices = displacedVertices;
deformingMesh.RecalculateNormals();
}
}
fileFormatVersion: 2
guid: 3bf4e67ebfb7d1d4bba1da3380f48651
timeCreated: 1489502276
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: af9e3357c24f3e34d9a7b45a06389ce5
folderAsset: yes
timeCreated: 1487669499
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEditor;
public class GridCreatorMD : EditorWindow {
int Columns = 10;
int Rows = 10;
float SeperationX=0.0f;
float SeperationZ=0.0f;
public Object theNewObject;
float tempx = 0;
float tempz = 0;
public enum GridItemsType
{
Cube = 0,
Sphere = 1,
Capsule = 2,
Cylinder = 3,
Plane=4,
Quad=5,
Custom=6
}
public GridItemsType chosenPrimitive;
[MenuItem ("Mesh Deformer/Create 2D Grid")]
static void Init ()
{
GridCreatorMD window = (GridCreatorMD)EditorWindow.GetWindow (typeof (GridCreatorMD));
window.Show();
}
void OnGUI () {
GUILayout.Label ("2D Grid Options", EditorStyles.boldLabel);
Columns = EditorGUILayout.IntField("Number Of Columns", Columns);
Rows = EditorGUILayout.IntField("Number Of Rows", Rows);
SeperationX = EditorGUILayout.FloatField ("Seperation in X", SeperationX);
SeperationZ = EditorGUILayout.FloatField ("Seperation in Z", SeperationZ);
chosenPrimitive =(GridItemsType)EditorGUILayout.EnumPopup ("Grid Item", chosenPrimitive);
if (chosenPrimitive == GridItemsType.Custom)
{
theNewObject = EditorGUILayout.ObjectField ("Custom Prefab", theNewObject, typeof(Object), true);
}
if (GUILayout.Button ("Create Grid"))
{
createTheGridItems (chosenPrimitive);
}
}
void OnInspectorUpdate() {
Repaint();
}
void createTheGridItems(GridItemsType theType )
{
GameObject GridHandle = new GameObject ("Grid Handler");
GridHandle.transform.position = Vector3.zero;
GridHandle.transform.rotation = Quaternion.identity;
switch (theType) {
case GridItemsType.Cube:
for (int i = 0; i < Columns; i++) {
for (int j = 0; j < Rows; j++) {
GameObject OBJ = GameObject.CreatePrimitive (PrimitiveType.Cube);
OBJ.transform.position = new Vector3 (i + tempx, 0, j + tempz);
OBJ.transform.SetParent (GridHandle.transform);
tempz += SeperationZ;
}
tempx += SeperationX;
tempz = 0;
}
break;
case GridItemsType.Sphere:
for (int i = 0; i < Columns; i++) {
for (int j = 0; j < Rows; j++) {
GameObject OBJ = GameObject.CreatePrimitive (PrimitiveType.Sphere);
OBJ.transform.position = new Vector3 (i + tempx, 0, j + tempz);
OBJ.transform.SetParent (GridHandle.transform);
tempz += SeperationZ;
}
tempx += SeperationX;
tempz = 0;
}
break;
case GridItemsType.Capsule:
for (int i = 0; i < Columns; i++) {
for (int j = 0; j < Rows; j++) {
GameObject OBJ = GameObject.CreatePrimitive (PrimitiveType.Capsule);
OBJ.transform.position = new Vector3 (i + tempx, 0, j + tempz);
OBJ.transform.SetParent (GridHandle.transform);
tempz += SeperationZ;
}
tempx += SeperationX;
tempz = 0;
}
break;
case GridItemsType.Cylinder:
for (int i = 0; i < Columns; i++) {
for (int j = 0; j < Rows; j++) {
GameObject OBJ = GameObject.CreatePrimitive (PrimitiveType.Cylinder);
OBJ.transform.position = new Vector3 (i + tempx, 0, j + tempz);
OBJ.transform.SetParent (GridHandle.transform);
tempz += SeperationZ;
}
tempx += SeperationX;
tempz = 0;
}
break;
case GridItemsType.Plane:
for (int i = 0; i < Columns; i++) {
for (int j = 0; j < Rows; j++) {
GameObject OBJ = GameObject.CreatePrimitive (PrimitiveType.Plane);
OBJ.transform.position = new Vector3 (i + tempx, 0, j + tempz);
OBJ.transform.SetParent (GridHandle.transform);
tempz += SeperationZ;
}
tempx += SeperationX;
tempz = 0;
}
break;
case GridItemsType.Quad:
for (int i = 0; i < Columns; i++) {
for (int j = 0; j < Rows; j++) {
GameObject Quad = GameObject.CreatePrimitive (PrimitiveType.Quad);
Quad.transform.position = new Vector3 (i + tempx, 0, j + tempz);
Quad.transform.eulerAngles = new Vector3 (90.0f, 0, 0);
Quad.transform.SetParent (GridHandle.transform);
tempz += SeperationZ;
}
tempx += SeperationX;
tempz = 0;
}
break;
case GridItemsType.Custom:
if (theNewObject != null) {
for (int i = 0; i < Columns; i++) {
for (int j = 0; j < Rows; j++) {
GameObject OBJ = Instantiate (theNewObject, new Vector3 (i + tempx, 0, j + tempz), Quaternion.identity) as GameObject;
OBJ.transform.SetParent (GridHandle.transform);
tempz += SeperationZ;
}
tempx += SeperationX;
tempz = 0;
}
}
else
{
Debug.LogError ("Kindly Assign a Prefab to the custom Prefab field");
}
break;
}
tempx = 0;
tempz = 0;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: e298a32584afcdf408526bf0a8ce3d8c
timeCreated: 1487669508
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class Grid3DMD : EditorWindow {
int Columns = 10;
int Rows = 10;
int stacks = 10;
float SeperationX=0.0f;
float SeperationZ=0.0f;
float SeperationY=1.0f;
public Object theNewObject;
float tempx = 0;
float tempz = 0;
float tempy = 0;
public enum GridItemsType
{
Cube = 0,
Sphere = 1,
Capsule = 2,
Cylinder = 3,
Plane=4,
Quad=5,
Custom=6
}
public GridItemsType chosenPrimitive;
[MenuItem ("Mesh Deformer/Create 3D Grid")]
static void Init ()
{
Grid3DMD window = (Grid3DMD)EditorWindow.GetWindow (typeof (Grid3DMD));
window.Show();
}
void OnGUI () {
GUILayout.Label ("Grid Options", EditorStyles.boldLabel);
Columns = EditorGUILayout.IntField("Number Of Columns", Columns);
Rows = EditorGUILayout.IntField("Number Of Rows", Rows);
stacks = EditorGUILayout.IntField("Number Of Stacks", stacks);
SeperationX = EditorGUILayout.FloatField ("Seperation in X", SeperationX);
SeperationY = EditorGUILayout.FloatField ("Seperation in Y", SeperationY);
SeperationZ = EditorGUILayout.FloatField ("Seperation in Z", SeperationZ);
chosenPrimitive =(GridItemsType)EditorGUILayout.EnumPopup ("Grid Item", chosenPrimitive);
if (chosenPrimitive == GridItemsType.Custom)
{
theNewObject = EditorGUILayout.ObjectField ("Custom Prefab", theNewObject, typeof(Object), true);
}
if (GUILayout.Button ("Create Grid"))
{
createTheGridItems (chosenPrimitive);
}
}
void OnInspectorUpdate() {
Repaint();
}
void createTheGridItems(GridItemsType theType )
{
GameObject GridHandle = new GameObject ("3D Grid Handler");
GridHandle.transform.position = Vector3.zero;
GridHandle.transform.rotation = Quaternion.identity;
switch (theType) {
case GridItemsType.Cube:
for (int k = 0; k < stacks; k++) {
for (int i = 0; i < Columns; i++) {
for (int j = 0; j < Rows; j++) {
GameObject OBJ = GameObject.CreatePrimitive (PrimitiveType.Cube);
OBJ.transform.position = new Vector3 (i + tempx, tempy, j + tempz);
OBJ.transform.SetParent (GridHandle.transform);
tempz += SeperationZ;
}
tempx += SeperationX;
tempz = 0;
}
tempy += SeperationY;
tempx = 0;
}
break;
case GridItemsType.Sphere:
for (int k = 0; k < stacks; k++) {
for (int i = 0; i < Columns; i++) {
for (int j = 0; j < Rows; j++) {
GameObject OBJ = GameObject.CreatePrimitive (PrimitiveType.Sphere);
OBJ.transform.position = new Vector3 (i + tempx, tempy, j + tempz);
OBJ.transform.SetParent (GridHandle.transform);
tempz += SeperationZ;
}
tempx += SeperationX;
tempz = 0;
}
tempy += SeperationY;
tempx = 0;
}
break;
case GridItemsType.Capsule:
for (int k = 0; k < stacks; k++) {
for (int i = 0; i < Columns; i++) {
for (int j = 0; j < Rows; j++) {
GameObject OBJ = GameObject.CreatePrimitive (PrimitiveType.Capsule);
OBJ.transform.position = new Vector3 (i + tempx, tempy, j + tempz);
OBJ.transform.SetParent (GridHandle.transform);
tempz += SeperationZ;
}
tempx += SeperationX;
tempz = 0;
}
tempy += SeperationY;
tempx = 0;
}
break;
case GridItemsType.Cylinder:
for (int k = 0; k < stacks; k++) {
for (int i = 0; i < Columns; i++) {
for (int j = 0; j < Rows; j++) {
GameObject OBJ = GameObject.CreatePrimitive (PrimitiveType.Cylinder);
OBJ.transform.position = new Vector3 (i + tempx, tempy, j + tempz);
OBJ.transform.SetParent (GridHandle.transform);
tempz += SeperationZ;
}
tempx += SeperationX;
tempz = 0;
}
tempy += SeperationY;
tempx = 0;
}
break;
case GridItemsType.Plane:
for (int k = 0; k < stacks; k++) {
for (int i = 0; i < Columns; i++) {
for (int j = 0; j < Rows; j++) {
GameObject OBJ = GameObject.CreatePrimitive (PrimitiveType.Plane);
OBJ.transform.position = new Vector3 (i + tempx, tempy, j + tempz);
OBJ.transform.SetParent (GridHandle.transform);
tempz += SeperationZ;
}
tempx += SeperationX;
tempz = 0;
}
tempy += SeperationY;
tempx = 0;
}
break;
case GridItemsType.Quad:
for (int k = 0; k < stacks; k++) {
for (int i = 0; i < Columns; i++) {
for (int j = 0; j < Rows; j++) {
GameObject Quad = GameObject.CreatePrimitive (PrimitiveType.Quad);
Quad.transform.position = new Vector3 (i + tempx, tempy, j + tempz);
Quad.transform.eulerAngles = new Vector3 (90.0f, 0, 0);
Quad.transform.SetParent (GridHandle.transform);
tempz += SeperationZ;
}
tempx += SeperationX;
tempz = 0;
}
tempy += SeperationY;
tempx = 0;
}
break;
case GridItemsType.Custom:
if (theNewObject != null) {
for (int k = 0; k < stacks; k++) {
for (int i = 0; i < Columns; i++) {
for (int j = 0; j < Rows; j++) {
GameObject OBJ = Instantiate (theNewObject, new Vector3 (i + tempx, tempy, j + tempz), Quaternion.identity) as GameObject;
OBJ.transform.SetParent (GridHandle.transform);
tempz += SeperationZ;
}
tempx += SeperationX;
tempz = 0;
}
tempy += SeperationY;
tempx = 0;
}
} else {
Debug.LogError ("Kindly Assign a Prefab to the custom Prefab field");
}
break;
}
tempx = 0;
tempz = 0;
tempy = 0;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: ce695ed18d7ab8c4bafb455d6c5ffba4
timeCreated: 1487749342
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class LinkComponents : MonoBehaviour {
[MenuItem ("Mesh Deformer/Create Effector")]
static void AddEffector () {
GameObject OBJ = GameObject.CreatePrimitive (PrimitiveType.Sphere);
DestroyImmediate (OBJ.GetComponent<SphereCollider>());
OBJ.AddComponent<EffectorVal> ();
OBJ.name ="Effector";
}
[MenuItem ("Mesh Deformer/Mesh Deformer/Image Deformer")]
static void AddImageDef () {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <ImageDeformer> ();
}
} else
{
Debug.LogWarning ("You Must Select at least one mesh Object");
}
}
[MenuItem ("Mesh Deformer/Mesh Deformer/Ripple Deformer")]
static void AddRipple () {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <RippleDeformer> ();
}
} else
{
Debug.LogWarning ("You Must Select at least one mesh Object");
}
}
[MenuItem ("Mesh Deformer/Mesh Deformer/Simple Blend Shape Deformer")]
static void AddBlendShape () {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <SimpleBlendShape> ();
}
} else
{
Debug.LogWarning ("You Must Select at least one mesh Object");
}
}
[MenuItem ("Mesh Deformer/Mesh Deformer/Twist Deformer")]
static void AddTwist () {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <TwistDeformer> ();
}
} else
{
Debug.LogWarning ("You Must Select at least one mesh Object");
}
}
[MenuItem ("Mesh Deformer/Mesh Deformer/Flare Deformer")]
static void AddFlare () {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <FlareDeformer> ();
}
} else
{
Debug.LogWarning ("You Must Select at least one mesh Object");
}
}
[MenuItem ("Mesh Deformer/Mesh Deformer/Sine Deformer")]
static void AddSine () {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <SineDeformer> ();
}
} else
{
Debug.LogWarning ("You Must Select at least one mesh Object");
}
}
[MenuItem ("Mesh Deformer/Mesh Deformer/Curve Shape Deformer")]
static void AddCurve () {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <CurveShapeDeformer> ();
}
} else
{
Debug.LogWarning ("You Must Select at least one mesh Object");
}
}
[MenuItem ("Mesh Deformer/Objects Deformer/Object Image Deformer")]
static void AddObjImage () {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <ObjectsImageDeformer> ();
}
} else
{
Debug.LogWarning ("You Must Select at least one parent Object");
}
}
[MenuItem ("Mesh Deformer/Objects Deformer/Object Sine Deformer")]
static void AddObjSine () {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <ObjectsSine> ();
}
} else
{
Debug.LogWarning ("You Must Select at least one parent Object");
}
}
[MenuItem ("Mesh Deformer/Objects Deformer/Object Ripple Deformer")]
static void AddObjRipple () {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <ObjectsRipple> ();
}
} else
{
Debug.LogWarning ("You Must Select at least one parent Object");
}
}
[MenuItem ("Mesh Deformer/Objects Deformer/Object Translate Deformer")]
static void AddObjTDeformer () {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <ObjectTransformEffectorDeformer> ();
GameObject OBJ = GameObject.CreatePrimitive (PrimitiveType.Sphere);
DestroyImmediate (OBJ.GetComponent<SphereCollider>());
OBJ.AddComponent<EffectorVal> ();
OBJ.name ="Translation Effector";
Selection.gameObjects [i].GetComponent<ObjectTransformEffectorDeformer> ().Effector = OBJ;
}
} else
{
Debug.LogWarning ("You Must Select at least one parent Object");
}
}
[MenuItem ("Mesh Deformer/Objects Deformer/Object Rotate Deformer")]
static void AddObjRDeformer () {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <ObjectRotateEffectorDeformer> ();
GameObject OBJ = GameObject.CreatePrimitive (PrimitiveType.Sphere);
DestroyImmediate (OBJ.GetComponent<SphereCollider>());
OBJ.AddComponent<EffectorVal> ();
OBJ.name ="Rotation Effector";
Selection.gameObjects [i].GetComponent<ObjectRotateEffectorDeformer> ().Effector = OBJ;
}
} else
{
Debug.LogWarning ("You Must Select at least one parent Object");
}
}
[MenuItem ("Mesh Deformer/Objects Deformer/Object Scale Deformer")]
static void AddObjSDeformer () {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <ObjectScaleEffectorDeformer> ();
GameObject OBJ = GameObject.CreatePrimitive (PrimitiveType.Sphere);
DestroyImmediate (OBJ.GetComponent<SphereCollider>());
OBJ.AddComponent<EffectorVal> ();
OBJ.name ="Scale Effector";
Selection.gameObjects [i].GetComponent<ObjectScaleEffectorDeformer> ().Effector = OBJ;
}
} else
{
Debug.LogWarning ("You Must Select at least one parent Object");
}
}
[MenuItem ("Mesh Deformer/Help")]
static void OpenMyWeb () {
Application.OpenURL("https://wixarexperience.com/mesh-and-object-deformer-support/");
}
[MenuItem ("Mesh Deformer/Skinned Mesh Deformer/Skinned Mesh Ripple")]
static void AddSkinnedRipple() {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <skinnedMeshRipple> ();
}
} else
{
Debug.LogWarning ("You Must Select at least one Skinned mesh Object");
}
}
[MenuItem ("Mesh Deformer/Skinned Mesh Deformer/Skinned Mesh Flare")]
static void AddSkinnedFlare() {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <SkinnedMeshFlareDeformer> ();
}
} else
{
Debug.LogWarning ("You Must Select at least one Skinned mesh Object");
}
}
[MenuItem ("Mesh Deformer/Skinned Mesh Deformer/Skinned Mesh Sine")]
static void AddSkinnedSine() {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <SkinnedMeshSine> ();
}
} else
{
Debug.LogWarning ("You Must Select at least one Skinned mesh Object");
}
}
[MenuItem ("Mesh Deformer/Skinned Mesh Deformer/Skinned Mesh Anim Curve Shape")]
static void AddSkinnedAnimCurve() {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <SkinnedMeshAnimCurveDeformer> ();
}
} else
{
Debug.LogWarning ("You Must Select at least one Skinned mesh Object");
}
}
[MenuItem ("Mesh Deformer/Colorize/Colorize Grid")]
static void AddColorize() {
if (Selection.activeGameObject != null) {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
Selection.gameObjects [i].AddComponent <ColorizeGrid> ();
}
} else
{
Debug.LogWarning ("You Must Select at least one parent Object");
}
}
[MenuItem ("Mesh Deformer/Save Mesh")]
static void SaveMeshtoAsset() {
if (Selection.activeGameObject != null) {
string saveName = Selection.gameObjects [0].name + "Saved";
Transform selectedGameObject = Selection.gameObjects [0].transform;
var SavedMesh = selectedGameObject.GetComponent<MeshFilter>();
if (SavedMesh) {
var savePath = "Assets/" + saveName + ".asset";
Debug.Log ("Saved Mesh to:" + savePath);
AssetDatabase.CreateAsset (SavedMesh.mesh, savePath);
} else {
Debug.LogWarning ("your selected object must contain a meshfilter");
}
} else
{
Debug.LogWarning ("You Must Select One Mesh");
}
}
}
fileFormatVersion: 2
guid: 7faecba48b1b3e2459541e68ac7817c9
timeCreated: 1487750902
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: d9237c8869b27714daf150e621e7f7af
folderAsset: yes
timeCreated: 1493969888
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8019376949b925d468f579daf05c3092
folderAsset: yes
timeCreated: 1493973097
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Effector
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 110704226}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1102 &110249896
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: rippleMeshEffectorAnims
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 2038061d11286b441867ee3bcbc8d990, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1107 &110704226
AnimatorStateMachine:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 110249896}
m_Position: {x: 200, y: 0, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 110249896}
fileFormatVersion: 2
guid: 7d296156684371440ba0adf5df223040
timeCreated: 1493975523
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: EffectorAnims
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 21.72, y: 0, z: -5.49}
inSlope: {x: 0, y: 0, z: 16.825}
outSlope: {x: 0, y: 0, z: 16.825}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 2
value: {x: 21.72, y: 0, z: 28.16}
inSlope: {x: -5.8875, y: 0, z: 1.0950003}
outSlope: {x: -5.8875, y: 0, z: 1.0950003}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 4
value: {x: -1.83, y: 0, z: -1.11}
inSlope: {x: -11.775, y: 0, z: -14.635}
outSlope: {x: -11.775, y: 0, z: -14.635}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path:
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 1
script: {fileID: 0}
typeID: 4
customType: 0
isPPtrCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 4
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 21.72
inSlope: 0
outSlope: 0
tangentMode: 34
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 2
value: 21.72
inSlope: -5.8875
outSlope: -5.8875
tangentMode: 34
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 4
value: -1.83
inSlope: -11.775
outSlope: -11.775
tangentMode: 34
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.x
path:
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 34
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 2
value: 0
inSlope: 0
outSlope: 0
tangentMode: 34
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 4
value: 0
inSlope: 0
outSlope: 0
tangentMode: 34
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.y
path:
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: -5.49
inSlope: 16.825
outSlope: 16.825
tangentMode: 34
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 2
value: 28.16
inSlope: 1.0950003
outSlope: 1.0950003
tangentMode: 34
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 4
value: -1.11
inSlope: -14.635
outSlope: -14.635
tangentMode: 34
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.z
path:
classID: 4
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 1
m_HasMotionFloatCurves: 0
m_Events: []
fileFormatVersion: 2
guid: 114cf33ea5fbe034c8d717b64076ddf9
timeCreated: 1493973097
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: dc558c2f7cfb5744aaa39c5395f95afd
timeCreated: 1493973097
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 69581f1e95c86954c9bbc84997f8f36b
timeCreated: 1493973266
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 52f3a996be958aa46bc7eb3f49edb434
timeCreated: 1493973266
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: fc58c7b50d97e3c4aa25a8087b129577
timeCreated: 1493973195
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 454b24e282055dd40ab5722fe44508cc
timeCreated: 1493973195
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 2038061d11286b441867ee3bcbc8d990
timeCreated: 1493975523
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment