public static void Load() { switch (Game.MapId) { case GameMapId.SummonersRift: { Game.OnUpdate += args => { MyTeam.Update(); }; SRManager.Load(); break; } case GameMapId.CrystalScar: { break; } case GameMapId.TwistedTreeline: { break; } case GameMapId.HowlingAbyss: { HAManager.Load(); break; } default: { HAManager.Load(); break; } } }
public override void Act() { if (element.getState() == objectState.DEFAULT) { SRManager srm = SRManager.instance; SRElement e = srm.inventory.SearchObjectByName(keyRequired); if (e != null) { if (destroyKeyOnUse) { e.actBehaviour.RemoveFromList(); } element.setState(objectState.USED); GameManager.instance.SaveData(); srm.playTTS(doorOpen); srm.deactivate(doorOpen.length); //cargar nueva escena (con invoke, para que de tiempo a oir el texto) Invoke("change", doorOpen.length); } else { srm.playTTS(failAudio); } } }
void Start() { srm = SRManager.instance; srm.playTTS(introTTS); //se desactiva el input del usuario mientras dure el sonido inicial ScreenInput.instance.deactivate(introTTS.length); //esperamos a que termine el audio para arrancar la lógica del juego Invoke("startGame", introTTS.length); }
void Start() { //ajustamos la referencia al sr srm = SRManager.instance; //comenzamos con el índice puesto directamente, sin desplazamientos Camera.main.transform.position = interestPoints[targetPoint].position; //marcamos desde donde comenzara el movimiento lastPoint = targetPoint; }
/// <summary> /// Añade objeto a inventario en estado i /// </summary> /// <param name="s"></param> public void addItemToScene(string s, int i) { sceneObjs.Add(new element(s, i)); SRManager srm = SRManager.instance; if (srm != null) { SRElement aux = Instantiate((Resources.Load("Objects/" + s)) as GameObject, srm.scene.transform).GetComponent <SRElement>(); aux.name = deleteCloneText(aux.name); aux.setState((objectState)i); srm.scene.Push(aux); } }
/// <summary> /// Añade objeto a inventario en estado i /// </summary> /// <param name="s"></param> public void addItemToInv(string s, int i) { invObjects.Add(new element(s, i)); SRManager srm = SRManager.instance; if (srm != null && srm.type == SRType.Room) { SRElement aux = Instantiate((Resources.Load("Objects/" + s)) as GameObject, srm.inventory.transform).GetComponent <SRElement>(); aux.name = deleteCloneText(aux.name); aux.setState((objectState)i); srm.inventory.Push(aux); } }
public void instantiateRoom() { SRManager srm = SRManager.instance; if (srm == null) { Debug.Log("No se puede crear escena sin SRManager"); } else { GameObject aux; SRElement elAux; List <SRElement> invList = new List <SRElement>(); int count = 0; foreach (element el in invObjects) { aux = Instantiate((Resources.Load("Objects/" + invObjects[count].prefabName)) as GameObject, srm.inventory.transform); aux.name = deleteCloneText(aux.name); elAux = aux.GetComponent <SRElement>(); elAux.setState(invObjects[count].state); invList.Add(elAux); count++; } SRManager.instance.inventory.sreList = invList; List <SRElement> sceneList = new List <SRElement>(); count = 0; foreach (element el in sceneObjs) { aux = Instantiate((Resources.Load("Objects/" + sceneObjs[count].prefabName)) as GameObject, srm.scene.transform); aux.name = deleteCloneText(aux.name); elAux = aux.GetComponent <SRElement>(); elAux.setState(sceneObjs[count].state); sceneList.Add(elAux); count++; } SRManager.instance.scene.sreList = sceneList; } }
public void saveToGMFromSRM() { SRManager srm = SRManager.instance; if (srm == null || srm.type != SRType.Room) { Debug.Log("no hay srm de la que guardar"); } else { List <SRElement> objs = srm.inventory.sreList; List <SRElement> scen = srm.scene.sreList; List <element> objStates = new List <element>(); List <element> scenStates = new List <element>(); int count = 0; element aux; foreach (SRElement el in objs) { aux.prefabName = el.gameObject.name; aux.state = el.getState(); objStates.Add(aux); count++; } count = 0; foreach (SRElement el in scen) { aux.prefabName = el.gameObject.name; aux.state = el.getState(); scenStates.Add(aux); count++; } invObjects = objStates; sceneObjs = scenStates; } }
public static void Unload() { switch (Game.MapId) { case GameMapId.SummonersRift: { SRManager.Unload(); break; } case GameMapId.HowlingAbyss: { HAManager.Unload(); break; } default: { HAManager.Unload(); break; } } }
// Start is called before the first frame update void Start() { sr = SRManager.instance; }
public void Start() { srm = SRManager.instance; }
void Start() { srm = SRManager.instance; SetListToChildren(); }
// Gestion del singleton, y se comprueba que tenga audiosource void Awake() { instance = this; }