Exemplo n.º 1
0
        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;
            }
            }
        }
Exemplo n.º 2
0
 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);
         }
     }
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
    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;
    }
Exemplo n.º 5
0
    /// <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);
        }
    }
Exemplo n.º 6
0
    /// <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);
        }
    }
Exemplo n.º 7
0
    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;
        }
    }
Exemplo n.º 8
0
    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;
        }
    }
Exemplo n.º 9
0
        public static void Unload()
        {
            switch (Game.MapId)
            {
            case GameMapId.SummonersRift:
            {
                SRManager.Unload();
                break;
            }

            case GameMapId.HowlingAbyss:
            {
                HAManager.Unload();
                break;
            }

            default:
            {
                HAManager.Unload();
                break;
            }
            }
        }
Exemplo n.º 10
0
 // Start is called before the first frame update
 void Start()
 {
     sr = SRManager.instance;
 }
Exemplo n.º 11
0
 public void Start()
 {
     srm = SRManager.instance;
 }
Exemplo n.º 12
0
 void Start()
 {
     srm = SRManager.instance;
     SetListToChildren();
 }
Exemplo n.º 13
0
 // Gestion del singleton, y se comprueba que tenga audiosource
 void Awake()
 {
     instance = this;
 }