コード例 #1
0
        /// <summary>
        /// Creates a default Gradient
        /// </summary>
        /// <returns></returns>
        private Gradient CreateGradient()
        {
            Gradient gradient = new Gradient();

            // Populate the color keys at the relative time 0 and 1 (0 and 100%)
            GradientColorKey[] colorKey = new GradientColorKey[3];
            colorKey[0].color = GaiaUtils.GetColorFromHTML("0C233A");
            colorKey[0].time  = 0.0f;
            colorKey[1].color = GaiaUtils.GetColorFromHTML("5686BC");
            colorKey[1].time  = 0.5f;
            colorKey[2].color = GaiaUtils.GetColorFromHTML("5C9BE0");
            colorKey[2].time  = 1f;

            // Populate the alpha  keys at relative time 0 and 1  (0 and 100%)
            GradientAlphaKey[] alphaKey = new GradientAlphaKey[3];
            alphaKey[0].alpha = 1.0f;
            alphaKey[0].time  = 0.0f;
            alphaKey[1].alpha = 1.0f;
            alphaKey[1].time  = 0.5f;
            alphaKey[2].alpha = 1.0f;
            alphaKey[2].time  = 1.0f;

            gradient.SetKeys(colorKey, alphaKey);

            return(gradient);
        }
コード例 #2
0
 /// <summary>
 /// Sets the underwater color on the material
 /// </summary>
 private void UpdateUnderwaterMaterial()
 {
     if (m_mainLight != null)
     {
         m_underwaterMaterial.SetColor(GaiaShaderID.m_underwaterColor, m_mainLight.color);
     }
     else
     {
         m_underwaterMaterial.SetColor(GaiaShaderID.m_underwaterColor, GaiaUtils.GetColorFromHTML("CFCFCF"));
     }
 }
コード例 #3
0
        public static void SetupOperationHeaderColor(ref GUIStyle style, string normalColor, string proColor, List <Texture2D> tempTextureList)
        {
            if (style == null || style.normal.background == null)
            {
                style = new GUIStyle();
                style.stretchWidth = true;
                style.margin       = new RectOffset(5, 5, 0, 0);
                //m_operationHeaderStyle.overflow = new RectOffset(2, 2, 2, 2);

                // Setup colors for Unity Pro
                if (EditorGUIUtility.isProSkin)
                {
                    style.normal.background = GaiaUtils.GetBGTexture(GaiaUtils.GetColorFromHTML(proColor), tempTextureList);
                }
                // or Unity Personal
                else
                {
                    style.normal.background = GaiaUtils.GetBGTexture(GaiaUtils.GetColorFromHTML(normalColor), tempTextureList);
                }
            }
        }