// Update is called once per frame void LateUpdate() { if (isDone) { return; } if (effects == null) { return; } var myAngles = new List <string>(); effects.effectNodes.ForEach(element => { CCEffectData myData = element.GetComponent <CCEffectData>(); float myAngle = myData.angle * Mathf.Rad2Deg; maxValue = Mathf.Max(Mathf.Abs(myAngle), maxValue); myAngles.Add(myAngle.ToString(CultureInfo.CreateSpecificCulture("en-EN"))); }); rowData.Add(myAngles); _myTime += Time.deltaTime; if (_myTime >= recordingTime) { Save(); isDone = true; } Debug.Log(Time.deltaTime); }
public float EffectBlend(CCEffectData theData, float theBlend) { switch (theBlend) { case 0: return(0); case 1: return(1); } var myOffsetSum = modulation.OffsetSum() * blendAmp; var myModulation = modulation.Modulation(theData) * blendAmp; var myBlend = (myModulation - myOffsetSum) + theBlend * (1 + myOffsetSum * 2); myBlend = CCMath.Saturate(myBlend); if (interpolator) { myBlend = interpolator.Interpolate(myBlend); } return(myBlend); }
private float[] Values(CCEffectData theData) { return(signal.Values( phase.X(theData) + offset.x, phase.Y(theData) + offset.y, phase.Z(theData) + offset.z + phase.ModulationWithoutPosition(theData) )); }
public override float Apply(CCEffectData theData) { if (!signal) { return(0); } return(Values(theData)[0] * amp.Modulation(theData)); }
public override float Apply(CCEffectData theObject) { if (theObject.id >= amounts.Count) { return(0); } return(amounts[theObject.id]); }
public float Value(CCEffectData theData) { if (travelRange == 0) { return(0); } float d = (modulation.Modulation(theData) - travelPosition) / travelRange; d = Mathf.Clamp(d, 0, 1); d = interpolation.Evaluate(d); return(d); }
public override float Apply(CCEffectData theData) { Vector3 toTarget = target.transform.position - theData.gameObject.transform.parent.position; Vector2 toTargetXZ = new Vector2(toTarget.x, toTarget.z); Vector2 elementDir = new Vector2(theData.gameObject.transform.parent.forward.x, theData.gameObject.transform.parent.forward.z); float dot = Vector2.Dot(toTarget, elementDir); float angle = Mathf.Atan2(-toTarget.y, toTargetXZ.magnitude) * Mathf.Rad2Deg; float d = angle / effects.amount; //d = Mathf.Clamp(d, -1, 1); return(d); }
public override float Apply(CCEffectData theData) { float d = Value(theData);; //d = (Mathf.Cos(d * Mathf.PI + Mathf.PI) + 1) / 2; //d = (Mathf.Cos(d * Mathf.PI + Mathf.PI) + 1) / 2; //d = (Mathf.Cos(d * Mathf.PI + Mathf.PI) + 1) / 2; //d = (Mathf.Cos(d * Mathf.PI + Mathf.PI) + 1) / 2; if (!normed) { d = d * 2 - 1; } //d *= amount; //d = Mathf.Clamp(d, 0, 1) * amount; // * amount; return(d); }
public float ModulationWithoutPosition(CCEffectData theData) { return (Id(theData) + IdMod(theData) + Unit(theData) + UnitMod(theData) + UnitId(theData) + UnitIdMod(theData) + Group(theData) + GroupId(theData) + GroupMod(theData) + Distance(theData) + Random(theData) + Constant(theData) + Angle(theData)); }
public abstract float Apply(CCEffectData theObject);
public float Z(CCEffectData theData) { return(theData.z * z); }
public float Y(CCEffectData theData) { return(theData.y * y); }
public float X(CCEffectData theData) { return(theData.x * x); }
public virtual void ApplyEffect(CCEffectData theData, float theEffectAmount) { }
public float Id(CCEffectData theData) { return(theData.idBlend * id); }
public float UnitId(CCEffectData theData) { return(theData.unitIDBlend * unitId); }
public float UnitIdMod(CCEffectData theData) { return(((theData.unitID % 2) * 2 - 1) * unitIdMod); }
public float GroupMod(CCEffectData theData) { return(((theData.group % 2) * 2 - 1) * groupMod); }
public float Angle(CCEffectData theData) { return(theData.angle * angle); }
public float GroupId(CCEffectData theData) { return(theData.groupIDBlend * groupId); }
public float Group(CCEffectData theData) { return(theData.groupBlend * group); }
public float IdMod(CCEffectData theData) { return(((theData.id % 2) * 2 - 1) * idMod); }
public override float Apply(CCEffectData theData) { return(modulation.Modulation(theData)); }
public float Distance(CCEffectData theData) { return(theData.dist * dist); }
public virtual void SetupEffectData(CCEffectData theData) { }
public float Constant(CCEffectData theData) { return(constant); }
public float Unit(CCEffectData theData) { return(theData.unitBlend * unit); }
public float Random(CCEffectData theData) { return(theData.Random(randomSeed) * random); }