// SOFT RESET // // override public void SoftReset() { base.SoftReset(); if (ownerStack.isParticleStack) { vectors = new Vector4[ownerBlueprint.ownerEmitter.particleIds.Length]; elementIndices = new int[ownerBlueprint.ownerEmitter.particleIds.Length]; for (int i = 0; i < vectors.Length; i++) { vectors[i] = Vector4.zero; elementIndices[i] = 0; } } else { vectors = new Vector4[1]; vectors[0] = Vector4.zero; elementIndices = new int[1]; elementIndices[0] = 0; } lastAssignedElementIndex = 0; theMesh = sampledMesh.GetValue(); }
// GET VALUE // // public Mesh GetValue() { Mesh returnValue = null; switch (dataMode) { case eDataMode.Constant: returnValue = value; break; case eDataMode.Reference: if (reference != null) { MeshProperty theReference = (MeshProperty)reference.property; if (theReference != null) { returnValue = theReference.GetValue(); } } break; case eDataMode.Parameter: if (wasParameterQueried == false) { parameter = ownerBlueprint.ownerEmitter.GetParameter(parameterName, AmpsHelpers.eParameterTypes.Mesh); wasParameterQueried = true; } if (parameter != null) { returnValue = parameter.GetMeshValue(); } else { returnValue = value; } break; } return(returnValue); }