Example #1
0
    private void OnDrawGizmos()
    {
        int     f    = 20;
        Vector3 prev = p0;

        for (int i = 0; i < f; i++)
        {
            float   paremetr = (float)i / 20;
            Vector3 point    = Bezier.GetBezier(p0, p1, p2, p3, paremetr);
            Gizmos.DrawLine(prev, point);
            prev = point;
        }
    }
Example #2
0
    public void tranform()
    {
        if (isTrigger)
        {
            p3 = Player.singleton.transform.position + random;

            transform.position = Bezier.GetBezier(p0, p1, p2, p3, _money);
            _money            += Time.deltaTime;
            if (_money >= 1f)
            {
                isTrigger = false;
                _money    = 0;
                gameObject.SetActive(false);
            }
        }
    }