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