Beispiel #1
0
 public void ChangeOutline(int outlineInt)
 {
     if (outlineInt == 0)
     {
         playOutline.GetComponent <Outline>().enabled    = true;
         creditsOutline.GetComponent <Outline>().enabled = false;
         blip.Play();
     }
     if (outlineInt == 1)
     {
         playOutline.GetComponent <Outline>().enabled    = false;
         creditsOutline.GetComponent <Outline>().enabled = true;
         blip.Play();
     }
     if (outlineInt == 2)
     {
         playOutline.GetComponent <Outline>().enabled    = false;
         creditsOutline.GetComponent <Outline>().enabled = false;
         play1Outline.GetComponent <Outline>().enabled   = false;
     }
     if (outlineInt == 3)
     {
         play1Outline.GetComponent <Outline>().enabled = true;
         blip.Play();
     }
 }
Beispiel #2
0
 public void OutLine(int outLineNumber)
 {
     if (outLineNumber == 0)
     {
         startOutline.GetComponent <Outline>().enabled = true;
     }
     if (outLineNumber == 1)
     {
         startOutline.GetComponent <Outline>().enabled = false;
     }
 }
Beispiel #3
0
 public void Start()
 {
     playOutline.GetComponent <Outline>().enabled    = false;
     creditsOutline.GetComponent <Outline>().enabled = false;
     playButton.SetActive(true);
     creditsButton.SetActive(true);
     play1Button.SetActive(false);
     thePooper.SetActive(true);
     directions.SetActive(false);
     playOutline.GetComponent <Outline>().enabled    = false;
     creditsOutline.GetComponent <Outline>().enabled = false;
 }
Beispiel #4
0
    /// <summary>
    /// Unhighlights a button with an outline from the ButtonTypes enum.
    /// </summary>
    /// <param name="buttonType">The type of button to unhighlight.</param>
    public void UnhighlightButton(ButtonTypes buttonType)
    {
        Outline outline = null;

        switch (buttonType)
        {
        case ButtonTypes.BlockButton:
            outline = _blockButton.gameObject.GetComponent <Outline>();
            break;

        case ButtonTypes.HomeButton:
            outline = _homeButton.gameObject.GetComponent <Outline>();
            break;

        case ButtonTypes.GridButton:
            outline = _gridButton.gameObject.GetComponent <Outline>();
            break;
        }

        if (!outline)
        {
            return;
        }

        OutlineEffect outlineEffect = outline.GetComponent <OutlineEffect>();

        if (!outlineEffect)
        {
            return;
        }

        outlineEffect.FadeOutAndDestroy();
    }
Beispiel #5
0
    void UpdateLabelPosition()
    {
        var     renderer   = Outline.GetComponent <SpriteRenderer>();
        Vector3 updatedPos = SelectionLabelController.CalculateLabelScreenPosition(renderer, TopOffset);

        LabelController.UpdateLabelPosition(gameObject, updatedPos);
    }
Beispiel #6
0
 private void Start()
 {
     portrait.GetComponent <Image>().sprite = uwudle.Portrait;
     HealthBar.value = uwudle.Health.Hp;
     level.text      = uwudle.level + "";
     uwudle.Health.HpListener.AddListener(updateHealth);
     uwudle.levelListener.AddListener(updateLevel);
 }
Beispiel #7
0
    private IEnumerator FadeOut()
    {
        Outline.GetComponent <Image>().CrossFadeAlpha(0, Manager.TextFadeDuration, false);
        HintText.GetComponent <Text>().CrossFadeAlpha(0, Manager.TextFadeDuration, false);

        yield return(new WaitForSeconds(Manager.TextFadeDuration));

        gameObject.SetActive(false);
    }
Beispiel #8
0
    void OnPreCull()
    {
        for (int i = 0; i < outlines.Count; i++)
        {
            Outline outline = outlines[i];
            if (outline)
            {
                Renderer renderer = outlines[i].GetComponent <Renderer>();
                if (renderer)
                {
                    outline.originalMaterial = renderer.sharedMaterial;
                    outline.originalLayer    = outline.gameObject.layer;

                    if (outline.useLineColor)
                    {
                        renderer.sharedMaterial = outlineMaskMaterial2;
                    }
                    else
                    {
                        renderer.sharedMaterial = outlineMaskMaterial1;
                    }

                    if (renderer is MeshRenderer)
                    {
                        renderer.sharedMaterial.mainTexture = outline.originalMaterial.mainTexture;
                    }

                    outline.gameObject.layer = LayerMask.NameToLayer("Outline");
                }
            }
        }

        if (outlineCamera && outlines.Count > 0)
        {
            outlineCamera.Render();
        }

        for (int i = 0; i < outlines.Count; i++)
        {
            Outline outline = outlines[i];
            if (outline)
            {
                Renderer renderer = outline.GetComponent <Renderer>();
                if (renderer is MeshRenderer)
                {
                    renderer.sharedMaterial.mainTexture = null;
                }

                if (renderer)
                {
                    renderer.sharedMaterial  = outline.originalMaterial;
                    outline.gameObject.layer = outline.originalLayer;
                }
            }
        }
    }
Beispiel #9
0
    private void SwitchTool()
    {
        if (Player.Instance.HasAxe() && Player.Instance.HasPickaxe())
        {
            toolbarCanvas.SetActive(true);
        }

        Player.Instance.axe.gameObject.SetActive(false);
        Player.Instance.pickaxe.gameObject.SetActive(false);

        axe.effectColor     = new Color(0, 0, 0, 0);
        pickaxe.effectColor = new Color(0, 0, 0, 0);
        axe.GetComponent <Image>().color     = Color.white;
        pickaxe.GetComponent <Image>().color = Color.white;

        switch (_activeTool)
        {
        case Tool.None:
            break;

        case Tool.Axe:
            Player.Instance.axe.gameObject.SetActive(true);
            axe.effectColor = new Color(0.70f, 0.305f, 0, 1f);
            axe.GetComponent <Image>().color = activeColor;
            break;

        case Tool.Pickaxe:
            Player.Instance.pickaxe.gameObject.SetActive(true);
            pickaxe.effectColor = new Color(0.70f, 0.305f, 0, 1f);
            pickaxe.GetComponent <Image>().color = activeColor;
            break;

        default:
            Debug.LogError("Tool not implemented!");
            break;
        }
    }
Beispiel #10
0
    void OnPreCull()
    {
        if (outlines != null)
        {
            for (int i = 0; i < outlines.Count; i++)
            {
                Outline outline = outlines[i];
                if (outline != null)
                {
                    Renderer renderer = outlines[i].GetComponent <Renderer>();
                    if (renderer)
                    {
                        outline.originalMaterial = renderer.sharedMaterial;
                        outline.originalLayer    = outlines[i].gameObject.layer;

                        renderer.sharedMaterial = outline1Material;

                        if (renderer is MeshRenderer)
                        {
                            renderer.sharedMaterial.mainTexture = outline.originalMaterial.mainTexture;
                        }

                        if (outline.useLineColor == true)
                        {
                            outlineShaderMaterial.SetColor("_LineColor1", outline.lineColor);
                        }
                        else
                        {
                            outlineShaderMaterial.SetColor("_LineColor1", lineColor0);
                        }

                        outline.gameObject.layer = LayerMask.NameToLayer("Outline");
                    }
                }
            }
        }

        if (outlineCamera != null)
        {
            outlineCamera.Render();
        }

        if (outlines != null)
        {
            for (int i = 0; i < outlines.Count; i++)
            {
                Outline outline = outlines[i];
                if (outline != null)
                {
                    Renderer renderer = outline.GetComponent <Renderer>();
                    if (renderer is MeshRenderer)
                    {
                        renderer.sharedMaterial.mainTexture = null;
                    }

                    if (renderer)
                    {
                        renderer.sharedMaterial  = outline.originalMaterial;
                        outline.gameObject.layer = outline.originalLayer;
                    }
                }
            }
        }
    }
    void Start()
    {
        ti = GameObject.FindWithTag("Dialogue").GetComponent <Text_Importer2>();
        ti.Import(24);

        if (Stage2_Controller.q[16])
        {
            _mirror_use.SetActive(true);
            Destroy(_shadow);
            _bg.sprite    = _day_bg;
            _orgel.sprite = _day_orgel1;
        }

        if (Stage2_Controller.q [18])
        {
            _clockwork_ol.GetComponent <BoxCollider2D>().enabled = false;
        }

        if (Stage2_Controller.q[22])
        {
            _bg.sprite    = _moode_bg;
            _orgel.sprite = _night_orgel;
        }

        if (Stage2_Controller.q[19])
        {
            //오르골 노래를 켠다.
        }

        if (Stage2_Controller.q[20])
        {
            _moode_code [0].SetActive(false);
            _moode_code [1].SetActive(true);
        }

        if (Stage2_Controller.q[22])
        {
            Item_Controller aa = GameObject.FindWithTag("Item_Canvas").GetComponent <Item_Controller> ();
            for (int i = 0; i < 5; i++)
            {
                if (aa._item_name_list [i] == "Clockwork")
                {
                    aa._consumable [i] = true;
                    break;
                }
            }
        }

        if (Stage2_Controller.q[22] && Stage2_Controller.q[19])
        {
            _Last_wall.SetActive(false);
            Stage2_Controller.q [23] = true;
            if (!whiteOut)
            {
                StartCoroutine("WhiteOut");
                whiteOut = true;
            }
        }

        if (Stage2_Controller.q [22] && Stage2_Controller.q [19] && !Stage2_Controller.q[24])
        {
            //8th save point//
            Save_Script.Save_Now_Point();
            print("Saved");
            //8th save point//
        }

        if (Stage2_Controller.q[23])
        {
            _mirror_use_last.GetComponent <SpriteRenderer> ().color = new Color(1, 1, 1, 1);
            _star.enabled = true;
        }
    }
Beispiel #12
0
    private IEnumerator MoveOutline()
    {
        RectTransform o  = Outline.GetComponent <RectTransform>();
        RectTransform tl = _backdropTL.GetComponent <RectTransform>();
        RectTransform tc = _backdropTC.GetComponent <RectTransform>();
        RectTransform tr = _backdropTR.GetComponent <RectTransform>();
        RectTransform ml = _backdropML.GetComponent <RectTransform>();
        RectTransform mr = _backdropMR.GetComponent <RectTransform>();
        RectTransform bl = _backdropBL.GetComponent <RectTransform>();
        RectTransform bc = _backdropBC.GetComponent <RectTransform>();
        RectTransform br = _backdropBR.GetComponent <RectTransform>();

        RectTransform start = Instantiate(Resources.Load <GameObject>("TutorialOutline"), transform)
                              .GetComponent <RectTransform>();

        start.gameObject.SetActive(false);
        MatchTransform(start, o);
        RectTransform finish = _steps[_index].Position;

        float startTime = Time.time;

        while (Time.time - startTime < Manager.MoveDuration)
        {
            float proportion = Manager.OutlineCurve.Evaluate((Time.time - startTime) / Manager.MoveDuration);

            o.anchorMin = Vector2.Lerp(start.anchorMin, finish.anchorMin, proportion);
            o.anchorMax = Vector2.Lerp(start.anchorMax, finish.anchorMax, proportion);
            o.offsetMin = Vector2.Lerp(start.offsetMin, finish.offsetMin, proportion);
            o.offsetMax = Vector2.Lerp(start.offsetMax, finish.offsetMax, proportion);

            tl.anchorMin = new Vector2(0, o.anchorMax.y);
            tl.anchorMax = new Vector2(o.anchorMin.x, 1);
            tl.offsetMin = new Vector2(0, o.offsetMax.y);
            tl.offsetMax = new Vector2(o.offsetMin.x, 0);

            tc.anchorMin = new Vector2(o.anchorMin.x, o.anchorMax.y);
            tc.anchorMax = new Vector2(o.anchorMax.x, 1);
            tc.offsetMin = new Vector2(o.offsetMin.x, o.offsetMax.y);
            tc.offsetMax = new Vector2(o.offsetMax.x, 0);

            tr.anchorMin = o.anchorMax;
            tr.anchorMax = Vector2.one;
            tr.offsetMin = o.offsetMax;
            tr.offsetMax = Vector2.zero;

            ml.anchorMin = new Vector2(0, o.anchorMin.y);
            ml.anchorMax = new Vector2(o.anchorMin.x, o.anchorMax.y);
            ml.offsetMin = new Vector2(0, o.offsetMin.y);
            ml.offsetMax = new Vector2(o.offsetMin.x, o.offsetMax.y);

            mr.anchorMin = new Vector2(o.anchorMax.x, o.anchorMin.y);
            mr.anchorMax = new Vector2(1, o.anchorMax.y);
            mr.offsetMin = new Vector2(o.offsetMax.x, o.offsetMin.y);
            mr.offsetMax = new Vector2(0, o.offsetMax.y);

            bl.anchorMin = Vector2.zero;
            bl.anchorMax = o.anchorMin;
            bl.offsetMin = Vector2.zero;
            bl.offsetMax = o.offsetMin;

            bc.anchorMin = new Vector2(o.anchorMin.x, 0);
            bc.anchorMax = new Vector2(o.anchorMax.x, o.anchorMin.y);
            bc.offsetMin = new Vector2(o.offsetMin.x, 0);
            bc.offsetMax = new Vector2(o.offsetMax.x, o.offsetMin.y);

            br.anchorMin = new Vector2(o.anchorMax.x, 0);
            br.anchorMax = new Vector2(1, o.anchorMin.y);
            br.offsetMin = new Vector2(o.offsetMax.x, 0);
            br.offsetMax = new Vector2(0, o.offsetMin.y);

            yield return(null);
        }

        Destroy(start.gameObject);
    }