Exemplo n.º 1
0
 private IEnumerator feedBackCoroutine()
 {
     isEffectOn[10] = true;
     curMat         = feedbackMaterial;
     for (int i = 0; i < feedBackTime; i++)
     {
         yield return(null);
     }
     curMat         = throughMaterial;
     posteffectType = PosteffecTypes.TROUGH;
     yield break;
 }
Exemplo n.º 2
0
 private IEnumerator pingPongFlashCoroutine()
 {
     isEffectOn[14] = true;
     curMat         = pingpongFlashMaterial;
     for (int i = 0; i < pingPongTime; i++)
     {
         yield return(null);
     }
     curMat         = throughMaterial;
     posteffectType = PosteffecTypes.TROUGH;
     yield break;
 }
Exemplo n.º 3
0
 private IEnumerator edgeCoroutine()
 {
     isEffectOn[11] = true;
     curMat         = edgeMaterial;
     for (int i = 0; i < edgeTime; i++)
     {
         yield return(null);
     }
     curMat         = throughMaterial;
     posteffectType = PosteffecTypes.TROUGH;
     yield break;
 }
Exemplo n.º 4
0
 private IEnumerator gridFlashCoroutine()
 {
     isEffectOn[5] = true;
     curMat        = gridFlashMaterial;
     for (int i = gridFlashTime; i > 0; i--)
     {
         yield return(null);
     }
     curMat         = throughMaterial;
     posteffectType = PosteffecTypes.TROUGH;
     yield break;
 }
Exemplo n.º 5
0
 private IEnumerator horizontalSymmetryCoroutine()
 {
     isEffectOn[7] = true;
     curMat        = horizontalSymmetryMaterial;
     for (int i = horizontalSymmetryTime; i > 0; i--)
     {
         yield return(null);
     }
     curMat         = throughMaterial;
     posteffectType = PosteffecTypes.TROUGH;
     yield break;
 }
Exemplo n.º 6
0
 private IEnumerator invertColorCoroutine()
 {
     isEffectOn[1] = true;
     curMat        = invertColorMaterial;
     for (int i = 0; i < invertColorTime; i++)
     {
         yield return(null);
     }
     curMat         = throughMaterial;
     posteffectType = PosteffecTypes.TROUGH;
     yield break;
 }
Exemplo n.º 7
0
 private IEnumerator tileCoroutine()
 {
     isEffectOn[9] = true;
     curMat        = tileMaterial;
     curMat.SetInt("_tileNum", (Random.Range(1, tileNum)));
     for (int i = 0; i < tileTime; i++)
     {
         yield return(null);
     }
     curMat         = throughMaterial;
     posteffectType = PosteffecTypes.TROUGH;
     yield break;
 }
Exemplo n.º 8
0
 private IEnumerator mosaicCoroutine()
 {
     isEffectOn[8] = true;
     curMat        = mosaicMaterial;
     for (int i = 0; i < mosaicTime; i++)
     {
         curMat.SetFloat("_blockSize", i * mosaicSize);
         yield return(null);
     }
     curMat         = throughMaterial;
     posteffectType = PosteffecTypes.TROUGH;
     yield break;
 }
Exemplo n.º 9
0
 private IEnumerator zoomCoroutine()
 {
     isEffectOn[2] = true;
     curMat        = zoomMaterial;
     for (int i = zoomTime; i > 0; i--)
     {
         curMat.SetFloat("_Strength", i * zoomPower);
         yield return(null);
     }
     curMat         = throughMaterial;
     posteffectType = PosteffecTypes.TROUGH;
     yield break;
 }
Exemplo n.º 10
0
 private IEnumerator rgbshiftCoroutine()
 {
     isEffectOn[3] = true;
     curMat        = rgbShiftMaterial;
     for (int i = rgbshiftTime; i > 0; i--)
     {
         curMat.SetFloat("_offSet1", Random.Range(-offSet, offSet));
         curMat.SetFloat("_offSet2", Random.Range(-offSet, offSet));
         yield return(null);
     }
     curMat         = throughMaterial;
     posteffectType = PosteffecTypes.TROUGH;
     yield break;
 }
Exemplo n.º 11
0
 private IEnumerator distortionCoroutine()
 {
     isEffectOn[12]  = true;
     curMat          = distortionMaterial;
     distortionPower = Random.Range(0.5f, distortionPower);
     curMat.SetFloat("_pivotX", Random.Range(0.0f, 1.0f));
     curMat.SetFloat("_pivotX", Random.Range(0.0f, 1.0f));
     for (int i = 0; i < distortionTime; i++)
     {
         curMat.SetFloat("_power", Mathf.Clamp(i * 0.2f, 0.0f, distortionPower));
         yield return(null);
     }
     curMat         = throughMaterial;
     posteffectType = PosteffecTypes.TROUGH;
     yield break;
 }
Exemplo n.º 12
0
    void init()
    {
        throughMaterial            = GetComponent <Through>().material;
        invertColorMaterial        = GetComponent <InvertColor>().material;
        zoomMaterial               = GetComponent <Zoom>().material;
        rgbShiftMaterial           = GetComponent <RGBShift>().material;
        glitchMaterial             = GetComponent <Glitch>().material;
        gridFlashMaterial          = GetComponent <GridFlash>().material;
        horizontalSymmetryMaterial = GetComponent <HorizontalSymmetry>().material;
        verticalSymmetryMaterial   = GetComponent <VerticalSymmetry>().material;
        mosaicMaterial             = GetComponent <Mosaic>().material;
        tileMaterial               = GetComponent <Tile>().material;
        feedbackMaterial           = GetComponent <Feedback>().material;
        edgeMaterial               = GetComponent <SobelEdge>().material;
        distortionMaterial         = GetComponent <Distortion>().material;
        pixleSortingMaterial       = GetComponent <PixleSorting>().material;
        pingpongFlashMaterial      = GetComponent <PingPongFlash>().material;



        materials = new List <Material>();
        materials.Add(throughMaterial);
        materials.Add(invertColorMaterial);
        materials.Add(zoomMaterial);
        materials.Add(rgbShiftMaterial);
        materials.Add(glitchMaterial);
        materials.Add(gridFlashMaterial);
        materials.Add(horizontalSymmetryMaterial);
        materials.Add(verticalSymmetryMaterial);
        materials.Add(mosaicMaterial);
        materials.Add(tileMaterial);
        materials.Add(feedbackMaterial);
        materials.Add(edgeMaterial);
        materials.Add(distortionMaterial);
        materials.Add(pixleSortingMaterial);
        materials.Add(pingpongFlashMaterial);

        isEffectOn = Enumerable.Repeat(false, materials.Count).ToList();

        curMat         = throughMaterial;
        PosteffectType = PosteffecTypes.TROUGH;
    }
Exemplo n.º 13
0
    void inputs()
    {
        if (Input.GetKeyDown(KeyCode.F1))
        {
            posteffectType      = PosteffecTypes.TROUGH;
            postEffect          = this.GetComponent <Through>();
            postEffect.IsActive = true;
        }
        else if (Input.GetKeyDown(KeyCode.F2))
        {
            posteffectType      = PosteffecTypes.INVERTCOLOR;
            postEffect          = this.GetComponent <InvertColor>();
            postEffect.IsActive = true;

            if (SwitchMode == SwitchModes.MomentaryHumanMode)
            {
                isEffectOn[1] = false;
            }
        }
        else if (Input.GetKeyDown(KeyCode.F3))
        {
            posteffectType      = PosteffecTypes.ZOOM;
            postEffect          = this.GetComponent <Zoom>();
            postEffect.IsActive = true;

            if (SwitchMode == SwitchModes.MomentaryHumanMode)
            {
                isEffectOn[2] = false;
            }
        }
        else if (Input.GetKeyDown(KeyCode.F4))
        {
            posteffectType      = PosteffecTypes.RGBSHIFT;
            postEffect          = this.GetComponent <RGBShift>();
            postEffect.IsActive = true;

            if (SwitchMode == SwitchModes.MomentaryHumanMode)
            {
                isEffectOn[3] = false;
            }
        }
        else if (Input.GetKeyDown(KeyCode.F5))
        {
            posteffectType = PosteffecTypes.GLITCH;
            postEffect.GetComponent <Glitch>();
            postEffect.IsActive = true;

            if (SwitchMode == SwitchModes.MomentaryHumanMode)
            {
                isEffectOn[4] = false;
            }
        }
        else if (Input.GetKeyDown(KeyCode.F6))
        {
            posteffectType      = PosteffecTypes.GRIDFLASH;
            postEffect          = this.GetComponent <GridFlash>();
            postEffect.IsActive = true;

            if (SwitchMode == SwitchModes.MomentaryHumanMode)
            {
                isEffectOn[5] = false;
            }
        }
        else if (Input.GetKeyDown(KeyCode.F7))
        {
            posteffectType      = PosteffecTypes.VERTICALSYMMETRY;
            postEffect          = this.GetComponent <VerticalSymmetry>();
            postEffect.IsActive = true;

            if (SwitchMode == SwitchModes.MomentaryHumanMode)
            {
                isEffectOn[6] = false;
            }
        }
        else if (Input.GetKeyDown(KeyCode.F8))
        {
            posteffectType      = PosteffecTypes.HORIZONTALSYMMETRY;
            postEffect          = this.GetComponent <HorizontalSymmetry>();
            postEffect.IsActive = true;

            if (SwitchMode == SwitchModes.MomentaryHumanMode)
            {
                isEffectOn[7] = false;
            }
        }
        else if (Input.GetKeyDown(KeyCode.F9))
        {
            posteffectType      = PosteffecTypes.MOSAIC;
            postEffect          = this.GetComponent <Mosaic>();
            postEffect.IsActive = true;

            if (SwitchMode == SwitchModes.MomentaryHumanMode)
            {
                isEffectOn[8] = false;
            }
        }
        else if (Input.GetKeyDown(KeyCode.F10))
        {
            posteffectType      = PosteffecTypes.TILE;
            postEffect          = this.GetComponent <Tile>();
            postEffect.IsActive = true;

            if (SwitchMode == SwitchModes.MomentaryHumanMode)
            {
                isEffectOn[9] = false;
            }
        }
        else if (Input.GetKeyDown(KeyCode.F11))
        {
            posteffectType      = PosteffecTypes.FEEDBACK;
            postEffect          = this.GetComponent <Feedback>();
            postEffect.IsActive = true;

            if (SwitchMode == SwitchModes.MomentaryHumanMode)
            {
                isEffectOn[10] = false;
            }
        }
        else if (Input.GetKeyDown(KeyCode.F12))
        {
            posteffectType      = PosteffecTypes.EDGE;
            postEffect          = this.GetComponent <SobelEdge>();
            postEffect.IsActive = true;

            if (SwitchMode == SwitchModes.MomentaryHumanMode)
            {
                isEffectOn[11] = false;
            }
        }

        else if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            posteffectType      = PosteffecTypes.DISTORTION;
            postEffect          = this.GetComponent <Distortion>();
            postEffect.IsActive = true;

            if (SwitchMode == SwitchModes.MomentaryHumanMode)
            {
                isEffectOn[12] = false;
            }
        }

        else if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            posteffectType      = PosteffecTypes.PIXLESORTING;
            postEffect          = this.GetComponent <PixleSorting>();
            postEffect.IsActive = true;

            if (SwitchMode == SwitchModes.MomentaryHumanMode)
            {
                isEffectOn[13] = false;
            }
        }

        else if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            posteffectType      = PosteffecTypes.PINGPONGFLASH;
            postEffect          = this.GetComponent <PingPongFlash>();
            postEffect.IsActive = true;

            if (SwitchMode == SwitchModes.MomentaryHumanMode)
            {
                isEffectOn[14] = false;
            }
        }
        else if (SwitchMode == SwitchModes.HumanMode)
        {
            if (temp != postEffect)
            {
                if (temp != null)
                {
                    temp.IsActive = false;
                }
            }

            temp = postEffect;
        }
    }