Esempio n. 1
0
        private void SetState(GlyphState state)
        {
            _state = state;

            switch (state)
            {
            case GlyphState.Icon:
                Glyph.Style             = (Style)TryFindResource(@"GlyphIconStyle");
                GlyphContextMenu.IsOpen = false;
                break;

            case GlyphState.Hovering:
                Glyph.Style             = (Style)TryFindResource(@"GlyphHoveringStyle");
                GlyphContextMenu.IsOpen = false;
                break;

            case GlyphState.Expanded:
                Glyph.Style             = (Style)TryFindResource(@"GlyphHoveringStyle");
                GlyphContextMenu.IsOpen = true;
                break;

            default:
                throw ExceptionBuilder.UnexpectedValue(state);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Deactivates particle effects
 /// </summary>
 public void DeactivateParticles()
 {
     GetComponent <ParticleSystem>().Stop();
     glyphState = GlyphState.Disappearing;
 }
Esempio n. 3
0
    /// <summary>
    /// Called every frame
    /// </summary>
    protected void Update()
    {
        //If player left clicks while in the rock trigger
        if (Input.GetMouseButtonDown(0) && inRock)
        {
            if (!Cursor.visible)
            {
                aud.Play();
            }
            //lock camera to proper location and angle
            character.LockCam(camLocation, angleY, angleX);

            //make cursor visible
            Cursor.lockState = CursorLockMode.None;
            Cursor.visible   = true;

            //fire tabletActivate event
            tabletActivate.Invoke(tabletNum);
        }

        //If player right clicks while in the rock trigger
        else if ((Input.GetMouseButtonDown(1) || Input.GetKeyDown("escape")) && inRock)
        {
            if (Cursor.visible)
            {
                aud.Play();
            }

            //unlock camera
            character.UnlockCam();

            //make cursor invisible
            Cursor.lockState = CursorLockMode.Locked;
            Cursor.visible   = false;

            //fire tabletActivate event with deactivate case (-1)
            tabletActivate.Invoke(-1);
        }

        if (sliderState == SliderState.Appearing)
        {
            if (cg.alpha < 1)
            {
                cg.alpha += Time.deltaTime * SLIDER_RATE;
            }
            else
            {
                sliderState = SliderState.None;
            }
        }

        else if (sliderState == SliderState.Disappearing)
        {
            if (cg.alpha > 0)
            {
                cg.alpha -= Time.deltaTime * SLIDER_RATE;
            }
            else
            {
                sliderState = SliderState.None;
                slider.SetActive(false);
            }
        }

        if (glyphState == GlyphState.Appearing)
        {
            glowVal += Time.deltaTime * GLYPH_RATE;

            if (glowVal >= 1.0f)
            {
                glowVal    = 1.0f;
                glyphState = GlyphState.None;
            }

            mat.SetColor("_EmissionColor", new Color(1.0f, 1.0f, 1.0f, 1.0f) * glowVal);
        }

        else if (glyphState == GlyphState.Disappearing)
        {
            glowVal -= Time.deltaTime * GLYPH_RATE;

            if (glowVal <= 0)
            {
                glowVal    = 0;
                glyphState = GlyphState.None;
            }

            mat.SetColor("_EmissionColor", new Color(1.0f, 1.0f, 1.0f, 1.0f) * glowVal);
        }
    }
Esempio n. 4
0
 /// <summary>
 /// Activates particle effects
 /// </summary>
 public void ActivateParticles()
 {
     GetComponent <ParticleSystem>().Play();
     glyphState = GlyphState.Appearing;
 }