Esempio n. 1
0
    // Use this for initialization
    private void Start()
    {
        _agent = GetComponent <AgentController>();
        _db    = new Database();
        _db.Add("Patch", new Database.Table(new string[]
        {
            "Type", "Above", "PosX", "PosZ", "LastUpdate"
        }, new Type[]
        {
            typeof(bool), typeof(string), typeof(int), typeof(int), typeof(float)
        }));
        int mapWidth  = Manager.Instance.GetComponent <Manager>().Width;
        int mapHeight = Manager.Instance.GetComponent <Manager>().Height;

        Database.Table t = _db.Tables["Patch"];
        foreach (Patch patch in GameObject.Find("Ground").GetComponentsInChildren <Patch>())
        {
            t.Insert(new object[] {
                patch.name == "Grass(Clone)", "None", (int)patch.transform.position.x, (int)patch.transform.position.z, 0f
            });
        }
    }