예제 #1
0
    Walker CreateWalker()
    {
        Walker walker = gameObject.AddComponent <Walker>();

        walker.Draw(dotPrefab, walkerContainer);
        walker.SetRandomPosition();
        return(walker);
    }
예제 #2
0
    void Start()
    {
        walkerContainer = GameObject.Find("Walkers");
        for (var i = 0; i < numWalkers; i++)
        {
            walkers.Add(CreateWalker());
        }
        treeContainer = GameObject.Find("Tree");
        Walker trunk = gameObject.AddComponent <Walker>();

        trunk.Draw(dotPrefab, treeContainer);
        tree.Add(trunk);
    }
예제 #3
0
 // Update is called once per frame
 void Update()
 {
     walkerComp.Step();
     walkerComp.Draw();
 }