コード例 #1
0
 public void Hit()
 {
     if (!invincible)
     {
         invincible = true;
         hits      -= 1;
         if (source)
         {
             source.PlayOneShot(hitClip, 0.5f);
         }
         StartCoroutine(UtilControls.CameraShake(0.1f, 0.5f));
         if (hits > 0)
         {
             heroAnimator.SetBool("hit", true);
             StartCoroutine(UtilControls.MomentFreeze(0.2f));
             StartCoroutine(FlashHero());
         }
         else
         {
             invincible = false;
             UtilControls.Freeze();
             StartCoroutine(GameObject.FindGameObjectWithTag("MainCamera").GetComponent <FadeScene>().FadeOutToScene("main"));
         }
     }
 }
コード例 #2
0
    public IEnumerator FadeOutToScene(string scene)
    {
        UtilControls.Freeze();
        float fadeTime = BeginFade(1);

        yield return(new WaitForSeconds(fadeTime * 1.1f));

        SceneManager.LoadScene(scene);
    }
コード例 #3
0
    void OnLevelWasLoaded()
    {
        // MEMORIES
        foreach (string identifier in finishedMemories)
        {
            GameObject trigger = FindMemoryTriggerByIdentifier(identifier);
            if (trigger != null)
            {
                trigger.SetActive(false);
            }
        }
        memoryMessage = GameObject.FindGameObjectWithTag("MemoryMessage");
        if (memoryMessage && finishedMemories.Count > 5)
        {
            Camera.main.GetComponent <GameInitializer>().ActivateThisThingy();
            if (!memoryMessageWasAlreadyShown)
            {
                StartCoroutine(UtilControls.MomentPopup(3, memoryMessage));
                memoryMessageWasAlreadyShown = true;
            }
        }

        // HOLES
        foreach (string identifier in triggeredHoles)
        {
            GameObject trigger = FindHoleByIdentifier(identifier);
            if (trigger != null)
            {
                trigger.GetComponent <HoleTrigger>().Execute();
            }
        }

        // KEYS
        Player player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>();

        foreach (string identifier in collectedKeys)
        {
            Collectible item = player.gameObject.AddComponent <Collectible>();
            item.identifier = identifier;
            player.Collect(item);
        }
        foreach (string identifier in collectedKeys)
        {
            GameObject key = FindKeyByIdentifier(identifier);
            if (key != null)
            {
                key.SetActive(false);
            }
        }

        // POSITIONING
        if (SceneManager.GetActiveScene().name == "main")
        {
            player.transform.position = thePlayerPosition;
        }
    }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //Llenamos los combos de camión y chofer
         UtilControls.FillDropDownList(DDLChofer, "IdChofer", "Nombre", BLLChofer.GetChoferes(true), "", "Selecciona Chofer");
         UtilControls.FillDropDownList(DDLCamion, "IdCamion", "Matricula", BLLCamiones.GetlistCamiones(true), "", "Selecciona Camión");
         Session["CargaRuta"] = null;
     }
 }
コード例 #5
0
    public override void Activate()
    {
        cutsceneObject.SetActive(true);
        cutScene = cutsceneObject.GetComponent <Animator>();
        if (source)
        {
            source.PlayOneShot(clip, 0.5f);
        }
        UtilControls.Freeze();
        cutScene.Play("cutscene");

        GameObject.FindGameObjectWithTag("ThingsController").GetComponent <ThingsController>().ClearCurrentMemory();
    }
コード例 #6
0
    public override void Activate()
    {
        if (triggered)
        {
            return;
        }

        StartCoroutine(UtilControls.MomentFreeze(0.5f));
        StartCoroutine(UtilControls.CameraShake(0.5f, 0.3f));
        if (source)
        {
            source.PlayOneShot(clip, 0.5f);
        }
        this.Execute();
        GameObject.FindGameObjectWithTag("ThingsController").GetComponent <ThingsController>().DidTrigger(identifier);
    }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) // es la primer carga de la pagina
            {
                //Llena las lista del formulario
                Util.Library.UtilControls.EnumToListBox(typeof(Comidas), DDLComidas, true);
                //Util.Library.UtilControls.EnumToListBox(typeof(Comidas), DDLComidas, false);

                DDLComidas.Items.Insert(0, new ListItem("Selecciona Comida", ""));
                DDLComidas.SelectedIndex = 0;

                //Llenamos los combos de camión y chofer
                UtilControls.FillDropDownList(DDLTipoEvento, "IdTipoEvento", "Nombre", BLLTipoEventos.GetLstTipoEventos(true), "", "Selecciona Tipo Evento");
                UtilControls.FillDropDownList(DDLCliente, "IdCliente", "Nombre", BLLClientes.GetLstClientes(true), "", "Selecciona Cliente");
                Session["CargaRuta"] = null;
            }
        }
コード例 #8
0
 public void Kill()
 {
     UtilControls.Freeze();
     StartCoroutine(GameObject.FindGameObjectWithTag("MainCamera").GetComponent <FadeScene>().FadeOutToScene("main"));
 }
コード例 #9
0
 void OnLevelWasLoaded()
 {
     UtilControls.Unfreeze();
     BeginFade(-1);
 }