Example #1
0
    void makeLine(GameObject attacker, Color color)
    {
        LineRenderer lRend = new GameObject().AddComponent <LineRenderer>();
        LineSet      line  = lRend.gameObject.AddComponent <LineSet>();

        line.init(m.frames);
        lRend.SetPositions(new Vector3[] { attacker.transform.position, transform.position });
        lRend.startColor = new Color(color.r / 2, color.g / 2, color.b / 2);
        lRend.endColor   = color;
        lRend.startWidth = 0.1f;
        lRend.endWidth   = 0.1f;
    }