logError() public static method

public static logError ( string error ) : object
error string
return object
Ejemplo n.º 1
0
    public void setPoints(Vector3[] pts_)
    {
        if (pts_.Length < 4)
        {
            LeanTween.logError("LeanTween - When passing values for a vector path, you must pass four or more values!");
        }
        if (pts_.Length % 4 != 0)
        {
            LeanTween.logError("LeanTween - When passing values for a vector path, they must be in sets of four: controlPoint1, controlPoint2, endPoint2, controlPoint2, controlPoint2...");
        }
        pts = pts_;
        int num = 0;

        beziers     = new LTBezier[pts.Length / 4];
        lengthRatio = new float[beziers.Length];
        length      = 0f;
        for (int i = 0; i < pts.Length; i += 4)
        {
            beziers[num] = new LTBezier(pts[i], pts[i + 2], pts[i + 1], pts[i + 3], 0.05f);
            length      += beziers[num].length;
            num++;
        }
        for (int i = 0; i < beziers.Length; i++)
        {
            lengthRatio[i] = beziers[i].length / length;
        }
    }
Ejemplo n.º 2
0
    public void setPoints(Vector3[] pts_)
    {
        int num2;

        if (pts_.Length < 4)
        {
            LeanTween.logError("LeanTween - When passing values for a vector path, you must pass four or more values!");
        }
        if ((pts_.Length % 4) != 0)
        {
            LeanTween.logError("LeanTween - When passing values for a vector path, they must be in sets of four: controlPoint1, controlPoint2, endPoint2, controlPoint2, controlPoint2...");
        }
        this.pts = pts_;
        int index = 0;

        this.beziers     = new LTBezier[this.pts.Length / 4];
        this.lengthRatio = new float[this.beziers.Length];
        this.length      = 0f;
        for (num2 = 0; num2 < this.pts.Length; num2 += 4)
        {
            this.beziers[index] = new LTBezier(this.pts[num2], this.pts[num2 + 2], this.pts[num2 + 1], this.pts[num2 + 3], 0.05f);
            this.length        += this.beziers[index].length;
            index++;
        }
        for (num2 = 0; num2 < this.beziers.Length; num2++)
        {
            this.lengthRatio[num2] = this.beziers[num2].length / this.length;
        }
    }
    public void setPoints(Vector3[] pts_)
    {
        if (pts_.Length < 4)
        {
            LeanTween.logError("LeanTween - When passing values for a vector path, you must pass four or more values!");
        }
        if (pts_.Length % 4 != 0)
        {
            LeanTween.logError("LeanTween - When passing values for a vector path, they must be in sets of four: controlPoint1, controlPoint2, endPoint2, controlPoint2, controlPoint2...");
        }
        this.pts = pts_;
        int num = 0;

        this.beziers     = new LTBezier[this.pts.Length / 4];
        this.lengthRatio = new float[this.beziers.Length];
        this.length      = 0f;
        for (int i = 0; i < this.pts.Length; i += 4)
        {
            this.beziers[num] = new LTBezier(this.pts[i], this.pts[i + 2], this.pts[i + 1], this.pts[i + 3], 0.05f);
            this.length      += this.beziers[num].length;
            num++;
        }
        for (int j = 0; j < this.beziers.Length; j++)
        {
            this.lengthRatio[j] = this.beziers[j].length / this.length;
        }
    }
Ejemplo n.º 4
0
    private void init(Vector3[] pts, bool constantSpeed)
    {
        if (pts.Length < 4)
        {
            LeanTween.logError("LeanTween - When passing values for a spline path, you must pass four or more values!");
            return;
        }
        this.pts = new Vector3[pts.Length];
        Array.Copy(pts, this.pts, pts.Length);
        numSections = pts.Length - 3;
        float   num  = float.PositiveInfinity;
        Vector3 b    = this.pts[1];
        float   num2 = 0f;

        for (int i = 1; i < this.pts.Length - 1; i++)
        {
            float num3 = Vector3.Distance(this.pts[i], b);
            if (num3 < num)
            {
                num = num3;
            }
            num2 += num3;
        }
        if (!constantSpeed)
        {
            return;
        }
        num = num2 / (float)(numSections * SUBLINE_COUNT);
        float num4 = num / (float)SUBLINE_COUNT;
        int   num5 = (int)Mathf.Ceil(num2 / num4) * DISTANCE_COUNT;

        if (num5 <= 1)
        {
            num5 = 2;
        }
        ptsAdj = new Vector3[num5];
        b      = interp(0f);
        int num6 = 1;

        ptsAdj[0] = b;
        distance  = 0f;
        for (int j = 0; j < num5 + 1; j++)
        {
            float   num7   = (float)j / (float)num5;
            Vector3 vector = interp(num7);
            float   num8   = Vector3.Distance(vector, b);
            if (num8 >= num4 || num7 >= 1f)
            {
                ptsAdj[num6] = vector;
                distance    += num8;
                b            = vector;
                num6++;
            }
        }
        ptsAdjLength = num6;
    }
Ejemplo n.º 5
0
    private void init(Vector3[] pts, bool constantSpeed)
    {
        if ((int)pts.Length < 4)
        {
            LeanTween.logError("LeanTween - When passing values for a spline path, you must pass four or more values!");
            return;
        }
        this.pts = new Vector3[(int)pts.Length];
        Array.Copy(pts, this.pts, (int)pts.Length);
        this.numSections = (int)pts.Length - 3;
        float   sUBLINECOUNT = Single.PositiveInfinity;
        Vector3 vector3      = this.pts[1];
        float   single       = 0f;

        for (int i = 1; i < (int)this.pts.Length - 1; i++)
        {
            float single1 = Vector3.Distance(this.pts[i], vector3);
            if (single1 < sUBLINECOUNT)
            {
                sUBLINECOUNT = single1;
            }
            single += single1;
        }
        if (constantSpeed)
        {
            sUBLINECOUNT = single / (float)(this.numSections * LTSpline.SUBLINE_COUNT);
            float sUBLINECOUNT1 = sUBLINECOUNT / (float)LTSpline.SUBLINE_COUNT;
            int   num           = (int)Mathf.Ceil(single / sUBLINECOUNT1) * LTSpline.DISTANCE_COUNT;
            if (num <= 1)
            {
                num = 2;
            }
            this.ptsAdj = new Vector3[num];
            vector3     = this.interp(0f);
            int num1 = 1;
            this.ptsAdj[0] = vector3;
            this.distance  = 0f;
            for (int j = 0; j < num + 1; j++)
            {
                float   single2  = (float)j / (float)num;
                Vector3 vector31 = this.interp(single2);
                float   single3  = Vector3.Distance(vector31, vector3);
                if (single3 >= sUBLINECOUNT1 || single2 >= 1f)
                {
                    this.ptsAdj[num1] = vector31;
                    this.distance    += single3;
                    vector3           = vector31;
                    num1++;
                }
            }
            this.ptsAdjLength = num1;
        }
    }
Ejemplo n.º 6
0
 public static void LTLogError(this Transform self, string error)
 {
     LeanTween.logError(error);
 }