Example #1
0
        static void Main(string[] args)
        {
            Agent1     agent1     = new Agent1();
            Agent2     agent2     = new Agent2();
            Agent3     agent3     = new Agent3();
            Product1   product1   = new Product1();
            Product2   product2   = new Product2();
            Management management = new Management();

            management._agents.Add(agent1);
            management._agents.Add(agent2);
            management._agents.Add(agent3);
            management._products.Add(product1);
            management._products.Add(product2);
        }
    // Update is called once per frame
    void Update()
    {
        if (Time.time > 15)
        {
            if (Time.time > i)
            {
                Agent aM1 = Agent1.GetComponent <Agent>();
                aM1.id = Random.Range(0, 4);
                Agent aM2 = Agent2.GetComponent <Agent>();
                aM2.id = Random.Range(5, 10);
                Agent aM3 = Agent3.GetComponent <Agent>();
                aM3.id = Random.Range(11, 15);

                //PathManager pM2 = Agent2.GetComponent<PathManager>();
                //pM2.goal.x = Random.Range(-3, 3);
                //pM2.goal.y = Random.Range(-11, -15);
                //Agent aM2 = Agent1.GetComponent<Agent>();
                //aM2.id = Random.Range(5, 10);

                //PathManager pM2 = Agent2.GetComponent<PathManager>();
                //pM2.goal.x = Random.Range(-3, 3);
                //pM2.goal.y = Random.Range(-11, -15);

                //PathManager pM3 = Agent3.GetComponent<PathManager>();
                //pM3.goal.x = Random.Range(-3, 3);
                //pM3.goal.y = Random.Range(-11, -15);

                i += 15;


                Instantiate(Agent1, agentSpawn1.transform.position, Quaternion.identity);
                Instantiate(Agent2, agentSpawn2.transform.position, Quaternion.identity);
                Instantiate(Agent3, agentSpawn3.transform.position, Quaternion.identity);
            }
        }
    }