public override void Init() { base.Init(); c = (CreadorObjetos)Manager.Instance.GetMenu("CreadorObjetos"); p = (PanelIzquierdo)Manager.Instance.GetMenu("PanelIzquierdo"); GetButton("Finalizar").OnPress += (() => End()); }
public void Init() { pi = (PanelIzquierdo)Manager.Instance.GetMenu("PanelIzquierdo"); cm = (CreadorMetodos)Manager.Instance.GetMenu("CreadorMetodos"); co = (CreadorObjetos)Manager.Instance.GetMenu("CreadorObjetos"); modificar.OnPress += (() => Modificar()); this.gameObject.SetActive(false); cube.Init(mainAnchor, this); }
public static bool Compare(this string s, CreadorObjetos c, bool modify) { bool repeat = false; if (!repeat) { if (Manager.Instance.english) { c.textoError.text = "This name belongs to an attribute"; } else { c.textoError.text = "Este nombre esta en uso por un atributo"; } } for (int i = 0; i < c.variablesInt.Count && !repeat; i++) { repeat = s.Equals(c.variablesInt[i].nombre, StringComparison.InvariantCultureIgnoreCase); } for (int i = 0; i < c.variablesFloat.Count && !repeat; i++) { repeat = s.Equals(c.variablesFloat[i].nombre, StringComparison.InvariantCultureIgnoreCase); } for (int i = 0; i < c.variablesBoolean.Count && !repeat; i++) { repeat = s.Equals(c.variablesBoolean[i].nombre, StringComparison.InvariantCultureIgnoreCase); } if (!repeat) { if (Manager.Instance.english) { c.textoError.text = "This name belongs to another class"; } else { c.textoError.text = "Este nombre esta en uso por otra clase"; } } for (int i = 0; i < mg.anchorablePrefs.Count && !repeat; i++) { repeat = s.Equals(mg.anchorablePrefs[i].nombre, StringComparison.InvariantCultureIgnoreCase); } if (modify && repeat) { repeat = !(s == c.objectToModify.nombre); } return(repeat); }
public void Init() { mg = (MenuGrid)Manager.Instance.GetMenu("MenuGrid"); mc = (MenuClases)Manager.Instance.GetMenu("MenuClases"); co = (CreadorObjetos)Manager.Instance.GetMenu("CreadorObjetos"); me = (MenuExplorar)Manager.Instance.GetMenu("MenuExplorar"); cv = (CreadorVariables)Manager.Instance.GetMenu("CreadorVariables"); ce = (ConfirmacionEliminarClase)Manager.Instance.GetMenu("ConfirmacionEliminarClase"); modificar.OnPress += (() => Modificar()); crearObjeto.OnPress += (() => CrearObjeto()); crearVariable.OnPress += (() => CrearVariable()); explorar.OnPress += (() => Explorar()); this.gameObject.SetActive(false); cube.Init(mainAnchor, this); }
public override void Init() { base.Init(); c = (CreadorObjetos)Manager.Instance.GetMenu("CreadorObjetos"); p = (PanelIzquierdo)Manager.Instance.GetMenu("PanelIzquierdo"); GetButton("Public").OnPress += (() => { NivelDeProteccion = ProteccionVar.Public; }); GetButton("Private").OnPress += (() => { NivelDeProteccion = ProteccionVar.Private; }); GetButton("Protected").OnPress += (() => { NivelDeProteccion = ProteccionVar.Protected; }); GetButton("Int").OnPress += (() => { Tipo = TipoVar.Int; }); GetButton("Float").OnPress += (() => { Tipo = TipoVar.Float; }); GetButton("Bool").OnPress += (() => { Tipo = TipoVar.Boolean; }); GetButton("Finalizar").OnPress += (() => End()); nombreInput.gameObject.SetActive(false); }
public override void Init() { base.Init(); c = (CreadorObjetos)Manager.Instance.GetMenu("CreadorObjetos"); for (int i = 0; i < lineasVariables.Length; i++) { lineasVariables[i].indice = i; lineasVariables[i].Init(); } for (int i = 0; i < lineasMetodos.Length; i++) { lineasMetodos[i].indice = i; lineasMetodos[i].Init(); } panelIzquierdoParent.SetActive(false); }
public static void Init() { mg = (MenuGrid)Manager.Instance.GetMenu("MenuGrid"); c = (CreadorObjetos)Manager.Instance.GetMenu("CreadorObjetos"); }
// Start is called before the first frame update void Start() { if (Instance == null) { Instance = this; } else { Destroy(this.gameObject); } languageControl.selectedLanguage = 1; languageControl.UpdateTextTranslation(); prefabsPivot = GameObject.FindGameObjectWithTag("PrefabPivot").transform; AssetBundle bundle = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "objeto")); objetoBasePrefab = Instantiate(bundle.LoadAsset <GameObject>("ObjetoBasico"), new Vector3(400, 400, 400), Quaternion.Euler(0, 0, 0), prefabsPivot).GetComponent <ObjetoBase>(); bundle.Unload(false); bundle = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "variable_objeto")); variableObjetoPrefab = Instantiate(bundle.LoadAsset <GameObject>("VariableObjeto"), new Vector3(500, 500, 500), Quaternion.Euler(0, 0, 0), prefabsPivot).GetComponent <VariableObjeto>(); bundle.Unload(false); bundle = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "variables")); intVariablePrefab = Instantiate(bundle.LoadAsset <GameObject>("IntVariable"), new Vector3(700, 700, 700), Quaternion.Euler(0, 0, 0), prefabsPivot).GetComponent <IntVariable>(); floatVariablePrefab = Instantiate(bundle.LoadAsset <GameObject>("FloatVariable"), new Vector3(700, 700, 700), Quaternion.Euler(0, 0, 0), prefabsPivot).GetComponent <FloatVariable>(); boolVariablePrefab = Instantiate(bundle.LoadAsset <GameObject>("BoolVariable"), new Vector3(700, 700, 700), Quaternion.Euler(0, 0, 0), prefabsPivot).GetComponent <BoolVariable>(); bundle.Unload(false); bundle = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "metodos")); List <GameObject> metodos = bundle.LoadAllAssets <GameObject>().ToList(); foreach (GameObject g in metodos) { MetodoBase m = Instantiate(g, new Vector3(800, 800, 800), Quaternion.Euler(0, 0, 0), prefabsPivot).GetComponent <MetodoBase>(); metodosPrefab.Add(m.nombre, m); } bundle.Unload(false); menus = new Dictionary <string, CustomMenu>(); List <CustomMenu> menusList = FindObjectsOfType <CustomMenu>().ToList(); foreach (CustomMenu c in menusList) { menus.Add(c.name, c); } foreach (CustomMenu c in menus.Values) { c.Init(); } StringExtension.Init(); mg = (MenuGrid)GetMenu("MenuGrid"); mc = (MenuClases)GetMenu("MenuClases"); c = (Consola)GetMenu("Consola"); co = (CreadorObjetos)GetMenu("CreadorObjetos"); ca = (CreadorAtributos)GetMenu("CreadorAtributos"); cm = (CreadorMetodos)GetMenu("CreadorMetodos"); ini = (MenuInicio)GetMenu("MenuInicio"); aud = GetComponent <AudioSource>(); string path = Path.Combine(Application.streamingAssetsPath, "save.sv"); if (!File.Exists(path)) { ini.GetButton("Cargar").Blocked = true; } }