Exemplo n.º 1
0
 // Instancie tous les éléments de l'environnement
 public void AddElement(string typeElement, string nom, Vector3 pos)
 {
     // Chargement des agents
     if (typeElement == "AgentReactif")
     {
         GameObject agentModel = Instantiate(Resources.Load("AgentReactif/AgentReactifv2")) as GameObject;
         AgentReactif.CreateComponent(agentModel, nom, pos);
     }
     if (typeElement == "SupplyZone")
     {
         GameObject supplyZone = GameObject.CreatePrimitive(PrimitiveType.Plane);
         SupplyZone.CreateComponent(supplyZone, nom, pos, new Vector3(pos.x + 1.5f, 0.01f, pos.z + 1.5f));
     }
 }
Exemplo n.º 2
0
        // Instancie tous les éléments de l'environnement
        public void AddElement(string typeElement, string nom, Vector3 firstPos, Vector3 secondPos)
        {
            // Creating agents
            if (typeElement == "AgentReactif")
            {
                GameObject agentModel = Instantiate(Resources.Load("AgentReactif/AgentReactifv2")) as GameObject;
                AgentReactif.CreateComponent(agentModel, nom, firstPos);
            }
            // Creating walls
            if (typeElement == "ElementStatique")
            {
                GameObject elementStatique = GameObject.CreatePrimitive(PrimitiveType.Cube);
                ElementStatique.CreateComponent(elementStatique, nom, firstPos, secondPos);
            }

            if (typeElement == "Supply")
            {
                GameObject supply = GameObject.CreatePrimitive(PrimitiveType.Cube);
                Supply.CreateComponent(supply, nom, firstPos);
            }
        }