コード例 #1
0
    void Start()
    {
        LockstepManager.Initialize();
        AgentController controller = AgentController.Create();

        for (int i = 0; i < 256; i++)
        {
            controller.CreateAgent(AgentCode.Footman);
        }
        PlayerManager.AddAgentController(controller);
    }
コード例 #2
0
    void Start()
    {
        LockstepManager.Initialize();
        GridManager.Generate();
        const int count = 32;


        for (int i = -count; i < count; i++)
        {
            for (int j = -count; j < count; j++)
            {
                if (i * i + j * j < 16)
                {
                    continue;
                }
                if (LSUtility.GetRandom(2) == 0)
                {
                    Vector2d pos = new Vector2d(i, j);
                    GridManager.GetNode(pos.x, pos.y).Unwalkable = true;
                    Instantiate(TestWall).GetComponent <LSBody>().Initialize(pos);
                }
            }
        }

        /*LSBody wall = Instantiate (TestWall).GetComponent<LSBody> ();
         * wall.Initialize (new Vector2d (-32 + 14, 0));
         * for (long i = wall.XMin; i <= wall.XMax; i+= FixedMath.One) {
         *      for (long j = wall.YMin; j <= wall.YMax; j+= FixedMath.One) {
         *              GridManager.GetNode (i, j).Unwalkable = true;
         *      }
         * }*/

        GridManager.Initialize();
        controller = AgentController.Create();
        for (int i = 0; i < 256; i++)
        {
            agent = controller.CreateAgent(AgentCode.Minion);
        }
        PlayerManager.AddAgentController(controller);
    }