Exemplo n.º 1
0
        /// <summary>
        /// Set the default values.
        /// </summary>
        protected override void ResetDefaultValues()
        {
            if (baseTarget == null)
            baseTarget = this.target as SpriteColorBlend;

              baseTarget.strength = 1.0f;

              baseTarget.SetPixelOp(SpriteColorHelper.PixelOp.Solid);

              base.ResetDefaultValues();
        }
        /// <summary>
        /// Set the default values.
        /// </summary>
        protected override void ResetDefaultValues()
        {
            if (baseTarget == null)
            {
                baseTarget = this.target as SpriteColorBlend;
            }

            baseTarget.strength = 1.0f;

            baseTarget.SetPixelOp(SpriteColorHelper.PixelOp.Solid);

            base.ResetDefaultValues();
        }
Exemplo n.º 3
0
    private void OnEnable()
    {
      spriteColorBlend = gameObject.GetComponent<SpriteColorBlend>();

      blendModesValues = Enum.GetValues(typeof(SpriteColorHelper.PixelOp));

      if (spriteColorBlend != null && timeToChangeBlend > 0.0f)
      {
        spriteColorBlend.SetPixelOp((SpriteColorHelper.PixelOp)UnityEngine.Random.Range(0, blendModesValues.Length));

        mustChangeBlend = timeToChangeBlend;
      }
    }
Exemplo n.º 4
0
        private void OnEnable()
        {
            spriteColorBlend = gameObject.GetComponent <SpriteColorBlend>();

            blendModesValues = Enum.GetValues(typeof(SpriteColorHelper.PixelOp));

            if (spriteColorBlend != null && timeToChangeBlend > 0.0f)
            {
                spriteColorBlend.SetPixelOp((SpriteColorHelper.PixelOp)UnityEngine.Random.Range(0, blendModesValues.Length));

                mustChangeBlend = timeToChangeBlend;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            if (baseTarget == null)
            baseTarget = base.target as SpriteColorBlend;

            EditorGUIUtility.fieldWidth = 40.0f;

              baseTarget.strength = (float)SpriteColorFXEditorHelper.IntSliderWithReset(@"Strength", SpriteColorFXEditorHelper.TooltipStrength, Mathf.RoundToInt(baseTarget.strength * 100.0f), 0, 100, 100) * 0.01f;

              SpriteColorHelper.PixelOp newPixelOp = (SpriteColorHelper.PixelOp)EditorGUILayout.EnumPopup(new GUIContent(@"Blend mode", @"Blend modes"), baseTarget.pixelOp);
              if (newPixelOp != baseTarget.pixelOp)
            baseTarget.SetPixelOp(newPixelOp);
        }
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            if (baseTarget == null)
            {
                baseTarget = base.target as SpriteColorBlend;
            }

            EditorGUIUtility.fieldWidth = 40.0f;

            baseTarget.strength = (float)SpriteColorFXEditorHelper.IntSliderWithReset(@"Strength", SpriteColorFXEditorHelper.TooltipStrength, Mathf.RoundToInt(baseTarget.strength * 100.0f), 0, 100, 100) * 0.01f;

            SpriteColorHelper.PixelOp newPixelOp = (SpriteColorHelper.PixelOp)EditorGUILayout.EnumPopup(new GUIContent(@"Blend mode", @"Blend modes"), baseTarget.pixelOp);
            if (newPixelOp != baseTarget.pixelOp)
            {
                baseTarget.SetPixelOp(newPixelOp);
            }
        }