void Update() { if (MyRenderer == null) { GetRenderer(); } if (MyRenderer == null) { return; } float f = FXDataProvider.GetFloat(FloatToBind); float remapped = Remap(RemapParams.x, RemapParams.y, RemapParams.z, RemapParams.w, f); localValue += remapped; ShowWarning = false; if (!MyRenderer.sharedMaterial.HasProperty(FloatPropertyName)) { ShowWarning = true; } else { MyRenderer.sharedMaterial.SetFloat(FloatPropertyName, localValue); } }
Vector3 GetNewRandValueNotInsideTab(int i) { bool bAlreadyIn = false; float amp = Remap(0f, 1f, 0.5f, 1.0f, FXDataProvider.GetFloat(FXDataProvider.FLOAT_DATA_TYPE.AmplitudeSetting)); float randX = Random.Range(-5.5f * amp, 5.5f * amp); float randY = Random.Range(-2f * amp, 4f * amp); for (int j = 0; j < stockPos.Length; j++) { if (stockPos[j].x == randX && stockPos[j].y == randY) { bAlreadyIn = true; break; } } if (!bAlreadyIn) { stockPos[i] = new Vector3(randX, randY, 10f); } else { //récursivité ! stockPos[i] = GetNewRandValueNotInsideTab(i); } return(stockPos[i]); }
void Update() { if (MyRenderer == null) { GetRenderer(); } if (MyRenderer == null) { return; } float f = FXDataProvider.GetFloat(FloatToBind); ShowWarning = false; if (!MyRenderer.sharedMaterial.HasProperty(FloatPropertyName)) { ShowWarning = true; } else { MyRenderer.sharedMaterial.SetFloat(FloatPropertyName, f); } }
public override void UpdateBinding(VisualEffect component) { component.SetFloat(FloatProperty, FXDataProvider.GetFloat(FloatToBind)); }