Inheritance: MonoBehaviour
コード例 #1
0
    // Start is called before the first frame update
    void Start()
    {
        AnaglyphizerC anaglyph = GetComponent <AnaglyphizerC>();
        GameObject    canvas   = GameObject.Find("Canvas");

        callibrateMenu = canvas.GetComponentInChildren <CallibrateAnaglyphMenu>(true);

        if (anaglyph != null)
        {
            if (MaterialHolder.Anaglyph == AnaglyphizerC.Mode.Color)
            {
                anaglyph.enabled     = true;
                anaglyph.anaglyphMat = standardAnaglyph;

                callibrateMenu.LoadAnaglyph();
                callibrateMenu.Anaglyph = anaglyph;

                InitCanvas.ChangeButtonColors(new Color(0.8f, 0.8f, 0.8f), canvas);
                InitCanvas.ChangeSliderColor(new Color(0.8f, 0.8f, 0.8f), canvas);
            }
            else if (MaterialHolder.Anaglyph == AnaglyphizerC.Mode.True)
            {
                anaglyph.enabled     = true;
                anaglyph.anaglyphMat = trueAnaglyph;

                InitCanvas.ChangeButtonColors(new Color(0.8f, 0.8f, 0.8f), canvas);
                InitCanvas.ChangeSliderColor(new Color(0.8f, 0.8f, 0.8f), canvas);
            }
        }
    }
コード例 #2
0
    void InitMat()
    {
        if (anaglyph == null)
        {
            anaglyph = Camera.main.GetComponent <AnaglyphizerC>();
        }

        if (anaglyphMat == null)
        {
            anaglyphMat = anaglyph.anaglyphMat;
        }
    }