Beispiel #1
0
    private void AddPathfinding()
    {
        target = new GameObject("Target");
        target.transform.parent = gameObject.transform.parent.transform;

        gameObject.AddComponent <LineRenderer>();
        gameObject.GetComponent <LineRenderer>().SetWidth(0.1f, 0.1f);
        gameObject.GetComponent <LineRenderer>().material.shader = Shader.Find("Particles/Additive");
        Color clanColor = blackBoard.GetColorForObject(clan.Substring(0, clan.Length - 5));

        gameObject.GetComponent <LineRenderer>().SetColors(new Color(clanColor.r, clanColor.g, clanColor.b, 0), clanColor);
        gameObject.GetComponent <LineRenderer>().enabled = false;

        ((AIPath)gameObject.GetComponent("AIPath")).target = target.transform;
    }