// 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));
 }
Example #5
0
 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);
        }
Example #7
0
        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);
        }
Example #9
0
 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));
 }
Example #10
0
 public abstract float Apply(CCEffectData theObject);
Example #11
0
 public float Z(CCEffectData theData)
 {
     return(theData.z * z);
 }
Example #12
0
 public float Y(CCEffectData theData)
 {
     return(theData.y * y);
 }
Example #13
0
 public float X(CCEffectData theData)
 {
     return(theData.x * x);
 }
 public virtual void ApplyEffect(CCEffectData theData, float theEffectAmount)
 {
 }
Example #15
0
 public float Id(CCEffectData theData)
 {
     return(theData.idBlend * id);
 }
Example #16
0
 public float UnitId(CCEffectData theData)
 {
     return(theData.unitIDBlend * unitId);
 }
Example #17
0
 public float UnitIdMod(CCEffectData theData)
 {
     return(((theData.unitID % 2) * 2 - 1) * unitIdMod);
 }
Example #18
0
 public float GroupMod(CCEffectData theData)
 {
     return(((theData.group % 2) * 2 - 1) * groupMod);
 }
Example #19
0
 public float Angle(CCEffectData theData)
 {
     return(theData.angle * angle);
 }
Example #20
0
 public float GroupId(CCEffectData theData)
 {
     return(theData.groupIDBlend * groupId);
 }
Example #21
0
 public float Group(CCEffectData theData)
 {
     return(theData.groupBlend * group);
 }
Example #22
0
 public float IdMod(CCEffectData theData)
 {
     return(((theData.id % 2) * 2 - 1) * idMod);
 }
 public override float Apply(CCEffectData theData)
 {
     return(modulation.Modulation(theData));
 }
Example #24
0
 public float Distance(CCEffectData theData)
 {
     return(theData.dist * dist);
 }
 public virtual void SetupEffectData(CCEffectData theData)
 {
 }
Example #26
0
 public float Constant(CCEffectData theData)
 {
     return(constant);
 }
Example #27
0
 public float Unit(CCEffectData theData)
 {
     return(theData.unitBlend * unit);
 }
Example #28
0
 public float Random(CCEffectData theData)
 {
     return(theData.Random(randomSeed) * random);
 }