Ejemplo n.º 1
0
    public void InstantiateSystem()
    {
        if (parametricSystem != null)                      //Set-up object
        {
            GameObject.Destroy(parametricSystem.gameObject);
        }
        GameObject system = GameObject.Instantiate(Resources.Load("Prefabs/L_Systems/BlankParametric")) as GameObject;

        system.transform.position = Vector3.zero;
        system.transform.Rotate(new Vector3(0, 90, 0));
        parametricSystem      = system.GetComponent <Parametric_L_System>();
        parametricSystem.name = SystemName;
        FindObjectOfType <LaboratoryCamera>().SetFocus(parametricSystem.gameObject);

        foreach (GameObject go in productionSet) //Add productions
        {
            Production          pp         = go.GetComponent <Production>();
            List <SystemModule> moduleList = new List <SystemModule>();
            foreach (UIModule uim in pp.RHS)
            {
                if (uim.Module.Symbol != Parametric_Turtle.EMPTY)
                {
                    moduleList.Add(uim.Module);
                }
            }
            parametricSystem.Productions.Add(pp.LHS, moduleList);
        }
        OutputArea.text = parametricSystem.PrintSystem();
    }
Ejemplo n.º 2
0
 public void DefaultSystem()
 {
     InstantiateSystem();
     parametricSystem.BuildDefaultSystem();
     parametricSystem.gameObject.transform.position = new Vector3(0, 0, 0);
     FindObjectOfType <LaboratoryCamera>().SetFocus(parametricSystem.gameObject);
     OutputArea.text = parametricSystem.PrintSystem();
 }