void LateUpdate() { fromvect = modelTransform.TransformPoint(fromRender.Mesh.bounds.center); tovect = modelTransform.TransformPoint(toRender.Mesh.bounds.center); ft = tovect - fromvect; var angle = Mathf.Atan2(ft.y, ft.x) * Mathf.Rad2Deg; parameter.SetToValue((angle * (Reverse?-1:1)) + Offset); }
public static void BlendToValueWeight(this CubismParameter self, CubismParameterBlendMode mode, float value, float weight = 1f) { if (mode == CubismParameterBlendMode.Additive) { self.AddToValue(value, weight); return; } if (mode == CubismParameterBlendMode.Multiply) { self.MultiplyValueBy(value, weight); return; } self.SetToValue(value, weight); }
public void setParam(float input) { parameter.SetToValue((isReverse ? (0f - input) : input)); }
public static void SetToPersent(this CubismParameter parameter, float per, float weight = 1f) { float newval = parameter.MinimumValue + (parameter.MaximumValue - parameter.MinimumValue) * per; parameter.SetToValue(newval, weight); }