Esempio n. 1
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);
        }
        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);
                }
            }
        }