public void ChangeTex(Texture tex)
        {
            meshRenderer.GetPropertyBlock(MatProp);

            MatProp.SetTexture("_MainTex", tex);

            meshRenderer.SetPropertyBlock(MatProp);
        }
Ejemplo n.º 2
0
        protected void ChangeElevatorTexture(Texture newTex)
        {
            meshRenderer.GetPropertyBlock(MatProp);

            MatProp.SetTexture("_MainTex", newTex);

            meshRenderer.SetPropertyBlock(MatProp);
        }
        public void SetOutlineColor(bool isWhite)
        {
            meshRenderer.GetPropertyBlock(MatProp);

            if (isWhite == true)
            {
                MatProp.SetColor("_ColorOutline", Color.white);
            }
            else
            {
                MatProp.SetColor("_ColorOutline", Color.black);
            }

            meshRenderer.SetPropertyBlock(MatProp);
        }
Ejemplo n.º 4
0
        public virtual void OutlineActive(int isActive)
        {
            meshRenderer.GetPropertyBlock(MatProp);

            if (isActive == 1)
            {
                MatProp.SetFloat("_Outline", 0.1f);
            }
            else if (isActive == 2)
            {
                MatProp.SetFloat("_Outline", 0);
            }

            meshRenderer.SetPropertyBlock(MatProp);
        }
Ejemplo n.º 5
0
        void ChangeTexture(int actualTimerValue)
        {
            switch (actualTimerValue)
            {
            case 9:
                _MainTex = _MaterialCentral.instance.actualPack._CounterTex9;
                break;

            case 8:
                _MainTex = _MaterialCentral.instance.actualPack._CounterTex8;
                break;

            case 7:
                _MainTex = _MaterialCentral.instance.actualPack._CounterTex7;
                break;

            case 6:
                _MainTex = _MaterialCentral.instance.actualPack._CounterTex6;
                break;

            case 5:
                _MainTex = _MaterialCentral.instance.actualPack._CounterTex5;
                break;

            case 4:
                _MainTex = _MaterialCentral.instance.actualPack._CounterTex4;
                break;

            case 3:
                _MainTex = _MaterialCentral.instance.actualPack._CounterTex3;
                break;

            case 2:
                _MainTex = _MaterialCentral.instance.actualPack._CounterTex2;
                break;

            case 1:
                _MainTex = _MaterialCentral.instance.actualPack._CounterTex1;
                break;
            }

            meshRenderer.GetPropertyBlock(MatProp);

            MatProp.SetTexture("_MainTex", _MainTex);

            meshRenderer.SetPropertyBlock(MatProp);
        }
        public IEnumerator IncreaseInside(bool isON)
        {
            meshRenderer.GetPropertyBlock(MatProp);
            currentOfValueChange = 0;

            if (isON)
            {
                actualnsideStrength = _InsideStrength;

                while (currentOfValueChange <= timeOfValueChange)
                {
                    currentOfValueChange += Time.deltaTime;

                    currentValue = Mathf.SmoothStep(actualnsideStrength, maxValueStrnght, currentOfValueChange / timeOfValueChange);

                    MatProp.SetFloat("_InsideTexStrength", currentValue);

                    meshRenderer.SetPropertyBlock(MatProp);
                    yield return(currentValue);
                }
            }
            else
            {
                while (currentOfValueChange <= timeOfValueChange)
                {
                    currentOfValueChange += Time.deltaTime;

                    currentValue = Mathf.SmoothStep(maxValueStrnght, actualnsideStrength, currentOfValueChange / timeOfValueChange);


                    MatProp.SetFloat("_InsideTexStrength", currentValue);

                    meshRenderer.SetPropertyBlock(MatProp);
                    yield return(currentValue);
                }
            }
        }
Ejemplo n.º 7
0
 void SetOutlineColor()
 {
     meshRenderer.GetPropertyBlock(MatProp);
     MatProp.SetColor("_ColorOutline", Color.black);
     meshRenderer.SetPropertyBlock(MatProp);
 }