Beispiel #1
0
    public void setStreetRender(float width, float direction)
    {
        float result = MyMaths.Remap(direction, 0, 360, 360, 0);

        transform.localEulerAngles = new Vector3(0, 0, result);

        float scale = (width / 50.0f) + 0.2f;

        transform.localScale = new Vector3(scale, 0.5f, 1f);
    }
Beispiel #2
0
    void Update()
    {
        float easeArrowScale = MyMaths.CubicEaseOut(Time.time - startTime, 0, targetArrowScale - initialArrowScale, durationTime);

        currentArrowScale = easeArrowScale + initialArrowScale;

        transform.localScale = new Vector3(currentArrowScale, currentArrowScale, 1f);

        easeArrowDir = MyMaths.ElasticEaseOut(Time.time - startTime, 0, targetArrowDir - initialArrowDir, durationTime);

        currentArrowDir = easeArrowDir + initialArrowDir;

        float result = MyMaths.Remap(currentArrowDir, 0, 360, 360, 0);

        transform.localEulerAngles = new Vector3(0, 0, result);
    }