///<summary>
 /// Method SetLightColor sets the color property of Light light to the corisponding color of Colortype type
 ///</summary>
 public void SetLightColor(Colortype type)
 {
     switch (type)
     {
         case Colortype.Blue: glower.color = Color.blue; break;
         case Colortype.Green: glower.color = Color.green; break;
         case Colortype.Pink: glower.color = Color.magenta; break;
         case Colortype.Yellow: glower.color = Color.yellow; break;
         default: Debug.Log("ColorChanger is broken"); break;
     }
 }
Beispiel #2
0
 ///<summary>
 /// Method SetType sets the weaponType type
 ///</summary>
 public void SetType(Colortype type)
 {
     this.type = type;
 }
Beispiel #3
0
 void Start()
 {
     type = Colortype.White;
     laserLayerMask = ~laserLayerMask;
 }
Beispiel #4
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("Polygone=[Typ=0x");
            sb.Append(Type.ToString("x2"));
            if (Type >= 0x100)
            {
                sb.Append(Subtype.ToString("x2"));
            }
            sb.Append(" " + Colortype.ToString() + " ");
            switch (Colortype)
            {
            case ColorType.Day1:
                sb.Append(colDayColor.ToString());
                break;

            case ColorType.Day1_Night1:
                sb.Append(colDayColor.ToString());
                sb.Append(colNightColor.ToString());
                break;

            case ColorType.BM_Day1_Night1:
                sb.Append(colDayColor[0].ToString());
                sb.Append(colNightColor[0].ToString());
                sb.Append(XBitmapDay.ToString());
                break;

            case ColorType.BM_Day1_Night2:
                sb.Append(colDayColor[0].ToString());
                sb.Append(colNightColor[0].ToString());
                sb.Append(colNightColor[1].ToString());
                sb.Append(XBitmapDay.ToString());
                break;

            case ColorType.BM_Day2_Night2:
                sb.Append(colDayColor[0].ToString());
                sb.Append(colDayColor[1].ToString());
                sb.Append(colNightColor[0].ToString());
                sb.Append(colNightColor[1].ToString());
                sb.Append(XBitmapDay.ToString());
                break;

            case ColorType.BM_Day2:
                sb.Append(colDayColor[0].ToString());
                sb.Append(colDayColor[1].ToString());
                sb.Append(XBitmapDay.ToString());
                break;

            case ColorType.BM_Day2_Night1:
                sb.Append(colDayColor[0].ToString());
                sb.Append(colDayColor[1].ToString());
                sb.Append(colNightColor[0].ToString());
                sb.Append(XBitmapDay.ToString());
                break;

            case ColorType.BM_Day1:
                sb.Append(colDayColor[0].ToString());
                sb.Append(XBitmapDay.ToString());
                break;
            }
            if (WithExtendedOptions)
            {
                sb.Append(" Options=[" + FontType.ToString() + "|" + FontColType.ToString() + "]");
            }
            if (WithString)
            {
                sb.Append(" " + Text.ToString());
            }
            sb.Append(" ]");
            return(sb.ToString());
        }
Beispiel #5
0
 /// <summary>
 /// 设置颜色
 /// </summary>
 /// <param name="control">控件</param>
 /// <param name="color">颜色名称</param>
 public void AreaColor(Control control, string color, Colortype existx)
 {
     if (color.Equals("白色"))
     {
         if (existx.Equals(Colortype.FontColor))
         {
             control.Foreground = new SolidColorBrush(Colors.WhiteSmoke);
         }
         else if (existx.Equals(Colortype.BgColor))
         {
             control.Background = new SolidColorBrush(Colors.WhiteSmoke);
         }
         else if (existx.Equals(Colortype.BrColor))
         {
             control.BorderBrush = new SolidColorBrush(Colors.WhiteSmoke);
         }
     }
     else if (color.Equals("黑色"))
     {
         if (existx.Equals(Colortype.FontColor))
         {
             control.Foreground = new SolidColorBrush(Colors.Black);
         }
         else if (existx.Equals(Colortype.BgColor))
         {
             control.Background = new SolidColorBrush(Colors.Black);
         }
         else if (existx.Equals(Colortype.BrColor))
         {
             control.BorderBrush = new SolidColorBrush(Colors.Black);
         }
     }
     else if (color.Equals("红色"))
     {
         if (existx.Equals(Colortype.FontColor))
         {
             control.Foreground = new SolidColorBrush(Colors.Red);
         }
         else if (existx.Equals(Colortype.BgColor))
         {
             control.Background = new SolidColorBrush(Colors.Red);
         }
         else if (existx.Equals(Colortype.BrColor))
         {
             control.BorderBrush = new SolidColorBrush(Colors.Red);
         }
     }
     else if (color.Equals("橙色"))
     {
         if (existx.Equals(Colortype.FontColor))
         {
             control.Foreground = new SolidColorBrush(Colors.Orange);
         }
         else if (existx.Equals(Colortype.BgColor))
         {
             control.Background = new SolidColorBrush(Colors.Orange);
         }
         else if (existx.Equals(Colortype.BrColor))
         {
             control.BorderBrush = new SolidColorBrush(Colors.Orange);
         }
     }
     else if (color.Equals("黄色"))
     {
         if (existx.Equals(Colortype.FontColor))
         {
             control.Foreground = new SolidColorBrush(Colors.Yellow);
         }
         else if (existx.Equals(Colortype.BgColor))
         {
             control.Background = new SolidColorBrush(Colors.Yellow);
         }
         else if (existx.Equals(Colortype.BrColor))
         {
             control.BorderBrush = new SolidColorBrush(Colors.Yellow);
         }
     }
     else if (color.Equals("绿色"))
     {
         if (existx.Equals(Colortype.FontColor))
         {
             control.Foreground = new SolidColorBrush(Colors.Green);
         }
         else if (existx.Equals(Colortype.BgColor))
         {
             control.Background = new SolidColorBrush(Colors.Green);
         }
         else if (existx.Equals(Colortype.BrColor))
         {
             control.BorderBrush = new SolidColorBrush(Colors.Green);
         }
     }
     else if (color.Equals("青色"))
     {
         if (existx.Equals(Colortype.FontColor))
         {
             control.Foreground = new SolidColorBrush(Colors.Cyan);
         }
         else if (existx.Equals(Colortype.BgColor))
         {
             control.Background = new SolidColorBrush(Colors.Cyan);
         }
         else if (existx.Equals(Colortype.BrColor))
         {
             control.BorderBrush = new SolidColorBrush(Colors.Cyan);
         }
     }
     else if (color.Equals("蓝色"))
     {
         if (existx.Equals(Colortype.FontColor))
         {
             control.Foreground = new SolidColorBrush(Colors.Blue);
         }
         else if (existx.Equals(Colortype.BgColor))
         {
             control.Background = new SolidColorBrush(Colors.Blue);
         }
         else if (existx.Equals(Colortype.BrColor))
         {
             control.BorderBrush = new SolidColorBrush(Colors.Blue);
         }
     }
     else if (color.Equals("紫色"))
     {
         if (existx.Equals(Colortype.FontColor))
         {
             control.Foreground = new SolidColorBrush(Colors.Violet);
         }
         else if (existx.Equals(Colortype.BgColor))
         {
             control.Background = new SolidColorBrush(Colors.Violet);
         }
         else if (existx.Equals(Colortype.BrColor))
         {
             control.BorderBrush = new SolidColorBrush(Colors.Violet);
         }
     }
 }
Beispiel #6
0
 ///<summary>
 /// Method Attack causes object to run an attack which can damage Player player
 ///</summary>
 void SetEnemyColor(Colortype type)
 {
     switch (type)
     {
         case Colortype.Blue: gameObject.GetComponent<Animator>().runtimeAnimatorController = blue ; break;
         case Colortype.Green: gameObject.GetComponent<Animator>().runtimeAnimatorController = green; break;
         case Colortype.Pink: gameObject.GetComponent<Animator>().runtimeAnimatorController = pink; break;
         case Colortype.Yellow: gameObject.GetComponent<Animator>().runtimeAnimatorController = yellow; break;
         default: Debug.Log("Enemy is white?"); break;
     }
 }
 ///<summary>
 /// Method UseColorChanger sets Player player's Colortype to Colortype color
 ///</summary>
 void UseColorChanger(Player player, Colortype color)
 {
     if(playerInside && Input.GetButtonDown("Use"))
         player.weapon.SetType(color);
 }