Exemple #1
0
        public void UpdateTheme(Theme theme)
        {
            try
            {
                _border.Color      = theme.BorderSettings.Normal;
                _border.HoverColor = theme.BorderSettings.Hover;

                ForeColor           = theme.TextSetting.Enabled;
                _textStyle.Enabled  = theme.TextSetting.Enabled;
                _textStyle.Disabled = theme.TextSetting.Disabled;

                Font = theme.TextSetting.Font;

                _borderEdge.BackColor = theme.OtherSettings.Line;

                _backColorState = new ColorState
                {
                    Enabled  = theme.OtherSettings.BoxEnabled,
                    Disabled = theme.OtherSettings.BoxDisabled
                };

                _buttonColor = theme.OtherSettings.FlatControlEnabled;

                _menuTextColor  = theme.TextSetting.Enabled;
                _menuItemNormal = theme.ListItemSettings.Item;
                _menuItemHover  = theme.ListItemSettings.ItemHover;
            }
            catch (Exception e)
            {
                VisualExceptionDialog.Show(e);
            }

            Invalidate();
            OnThemeChanged(new ThemeEventArgs(theme));
        }
Exemple #2
0
 public void RightButtonClick()
 {
     if (isCycling)
     {
         return;
     }
     else
     {
         if (state.Equals(ColorState.RED))
         {
             //       StartCoroutine(Move(false));
             anim.SetTrigger("Red_to_Blue");
             state = ColorState.BLUE;
         }
         else if (state.Equals(ColorState.BLUE))
         {
             //       StartCoroutine(Move(false));
             anim.SetTrigger("Blue_to_Green");
             state = ColorState.GREEN;
         }
         else if (state.Equals(ColorState.GREEN))
         {
             //       StartCoroutine(Move(false));
             anim.SetTrigger("Green_to_Red");
             state = ColorState.RED;
         }
     }
 }
Exemple #3
0
        public void UpdateTheme(Theme theme)
        {
            try
            {
                _border.Color      = theme.ColorPalette.BorderNormal;
                _border.HoverColor = theme.ColorPalette.BorderHover;

                ForeColor          = theme.ColorPalette.TextEnabled;
                TextStyle.Enabled  = theme.ColorPalette.TextEnabled;
                TextStyle.Disabled = theme.ColorPalette.TextDisabled;

                // Font = theme.ColorPalette.Font;
                _itemNormal    = theme.ColorPalette.Item;
                _itemAlternate = theme.ColorPalette.ItemAlternate;
                _itemSelected  = theme.ColorPalette.ItemSelected;

                _colorState = new ColorState
                {
                    Enabled  = theme.ColorPalette.ControlEnabled,
                    Disabled = theme.ColorPalette.ControlDisabled
                };
            }
            catch (Exception e)
            {
                ConsoleEx.WriteDebug(e);
            }

            Invalidate();
            OnThemeChanged(new ThemeEventArgs(theme));
        }
Exemple #4
0
    private void AddPlayer(bool isAI, ColorState color)
    {
        Player p = Instantiate(GetPrefab(isAI), transform);

        p.Setup(color, controller);
        players.Add(p);
    }
Exemple #5
0
    void OnCollisionEnter2D(Collision2D col2D)
    {
        if (col2D.gameObject.tag == "Spike")
        {
            GameManager.instance.relocate();
            myColor = ColorState.Normal;
        }

        if (col2D.gameObject.tag == "Check Point")
        {
            GameManager.instance.updateCheckPoint(col2D.gameObject.transform.position);
        }

        if (col2D.gameObject.tag == "Chest")
        {
            GameManager.instance.endScene();
        }

        if (col2D.gameObject.tag == "Death")
        {
            GameManager.instance.endGame();
            GameManager.instance.endRun();
        }

        if (castLeft.collider != null)
        {
            rb.velocity = new Vector3(0, 0, 0f);
        }

        if (castRight.collider != null)
        {
            rb.velocity = new Vector3(0, 0, 0f);
        }
    }
Exemple #6
0
        public void UpdateTheme(Theme theme)
        {
            try
            {
                _colorState = new ColorState
                {
                    Enabled  = theme.OtherSettings.ProgressBackground,
                    Disabled = theme.OtherSettings.ProgressDisabled
                };

                _hatch.BackColor = Color.FromArgb(0, theme.OtherSettings.HatchBackColor);
                _hatch.ForeColor = Color.FromArgb(20, theme.OtherSettings.HatchForeColor);

                _progressColor = theme.OtherSettings.Progress;

                _border.Color      = theme.BorderSettings.Normal;
                _border.HoverColor = theme.BorderSettings.Hover;

                ForeColor          = theme.TextSetting.Enabled;
                TextStyle.Enabled  = theme.TextSetting.Enabled;
                TextStyle.Disabled = theme.TextSetting.Disabled;

                Font = theme.TextSetting.Font;

                BackColorState.Enabled  = theme.ColorStateSettings.Enabled;
                BackColorState.Disabled = theme.ColorStateSettings.Disabled;
            }
            catch (Exception e)
            {
                VisualExceptionDialog.Show(e);
            }

            Invalidate();
            OnThemeChanged(new ThemeEventArgs(theme));
        }
        public void UpdateTheme(Theme theme)
        {
            try
            {
                _border.Color      = theme.BorderSettings.Normal;
                _border.HoverColor = theme.BorderSettings.Hover;

                ForeColor          = theme.TextSetting.Enabled;
                TextStyle.Enabled  = theme.TextSetting.Enabled;
                TextStyle.Disabled = theme.TextSetting.Disabled;

                Font = theme.TextSetting.Font;

                _borderEdge.BackColor    = theme.BorderSettings.Normal;
                _borderButtons.BackColor = theme.OtherSettings.Line;

                _buttonForeColor = theme.OtherSettings.LightText;
                _buttonFont      = new Font(theme.TextSetting.Font.FontFamily, 14, FontStyle.Bold);
                _buttonColor     = theme.BackgroundSettings.Type2;

                _colorState = new ColorState
                {
                    Enabled  = theme.BackgroundSettings.Type2,
                    Disabled = theme.BackgroundSettings.Type1
                };
            }
            catch (Exception e)
            {
                VisualExceptionDialog.Show(e);
            }

            Invalidate();
            OnThemeChanged(new ThemeEventArgs(theme));
        }
    private void ChangeColorState()
    {
        float mouseWheel = Input.GetAxis("Mouse ScrollWheel");

        //  scroll up
        if (mouseWheel > 0f)
        {
            colorSelected++;
        }

        // scroll down
        if (mouseWheel < 0f)
        {
            colorSelected--;
        }

        if (colorSelected % colorStateSize == 0)
        {
            colorSelected = 0;
        }

        if (colorSelected < 0)
        {
            colorSelected = colorStateSize + colorSelected;
        }

        currentColorState = (ColorState)colorSelected;

        gunProperties.SetBulletPrefab(bulletPrefabs[colorSelected]);
    }
        public void UpdateTheme(Theme theme)
        {
            try
            {
                _colorState = new ColorState {
                    Enabled = theme.ColorPalette.ProgressBackground, Disabled = theme.ColorPalette.ProgressDisabled
                };

                _hatch.BackColor = Color.FromArgb(0, theme.ColorPalette.HatchBackColor);
                _hatch.ForeColor = Color.FromArgb(20, theme.ColorPalette.HatchForeColor);

                _progressColor = theme.ColorPalette.Progress;

                _border.Color      = theme.ColorPalette.BorderNormal;
                _border.HoverColor = theme.ColorPalette.BorderHover;

                ForeColor          = theme.ColorPalette.TextEnabled;
                TextStyle.Enabled  = theme.ColorPalette.TextEnabled;
                TextStyle.Disabled = theme.ColorPalette.TextDisabled;

                // Font = theme.ColorPalette.Font;
                BackColorState.Enabled  = theme.ColorPalette.Enabled;
                BackColorState.Disabled = theme.ColorPalette.Disabled;
            }
            catch (Exception e)
            {
                Logger.WriteDebug(e);
            }

            Invalidate();
            OnThemeChanged(this, new ThemeEventArgs(theme));
        }
Exemple #10
0
 public bool Equals(ColorState state)
 {
     return(normalColor == state.normalColor &&
            disabledColor == state.disabledColor &&
            focusedColor == state.focusedColor &&
            pressedColor == state.pressedColor);
 }
Exemple #11
0
    // Update is called once per frame
    void Update()
    {
        //ステージのスクロール
        Vector3 stage1Position = transform.GetChild(0).transform.position;
        Vector3 stage2Position = transform.GetChild(1).transform.position;

        stage1Position -= new Vector3(scrollSpeedDef, 0, 0) * Time.deltaTime;
        transform.GetChild(0).transform.position = CheckDef(stage1Position);

        stage2Position -= new Vector3(scrollSpeedDef, 0, 0) * Time.deltaTime;
        transform.GetChild(1).transform.position = CheckDef(stage2Position);

        //背景のスクロール
        Vector3 ground1BackPosition = transform.GetChild(2).GetChild(1).transform.position;
        Vector3 ground2BackPosition = transform.GetChild(3).GetChild(1).transform.position;

        Vector3 ground1DefPosition = transform.GetChild(2).GetChild(2).transform.position;
        Vector3 ground2DefPosition = transform.GetChild(3).GetChild(2).transform.position;

        ground1BackPosition -= new Vector3(scrollSpeedBack, 0, 0) * Time.deltaTime;
        transform.GetChild(2).GetChild(1).transform.position = CheckBack(ground1BackPosition);
        //Debug.Log("ground1"+ground1BackPosition);
        ground2BackPosition -= new Vector3(scrollSpeedBack, 0, 0) * Time.deltaTime;
        //CheckState(ground2BackPosition);
        transform.GetChild(3).GetChild(1).transform.position = CheckBack(ground2BackPosition);
        //Debug.Log("ground2" + ground2BackPosition);

        ground1DefPosition -= new Vector3(scrollSpeedDef, 0, 0) * Time.deltaTime;
        transform.GetChild(2).GetChild(2).transform.position = CheckDef(ground1DefPosition);
        ground2DefPosition -= new Vector3(scrollSpeedDef, 0, 0) * Time.deltaTime;
        transform.GetChild(3).GetChild(2).transform.position = CheckDef(ground2DefPosition);

        state = camera.GetComponent <BackGround>().GetState();
        sunMoon.SetState(state);
    }
Exemple #12
0
 public void ChangeColorState(string inState)
 {
     if (inState == "LightBulletRed(Clone)")
     {
         currentColorState = ColorState.Red; justChanged = true;
     }
     else if (inState == "LightBulletOrange(Clone)")
     {
         currentColorState = ColorState.Orange; justChanged = true;
     }
     else if (inState == "LightBulletBlue(Clone)")
     {
         currentColorState = ColorState.Blue; justChanged = true;
     }
     else if (inState == "LightBulletGreen(Clone)")
     {
         currentColorState = ColorState.Green; justChanged = true;
     }
     else if (inState == "LightBulletPurple(Clone)")
     {
         currentColorState = ColorState.Purple; justChanged = true;
     }
     else if (inState == "LightBulletYellow(Clone)")
     {
         currentColorState = ColorState.Yellow; justChanged = true;
     }
 }
        public void UpdateTheme(Theme theme)
        {
            try
            {
                _border.Color      = theme.BorderSettings.Normal;
                _border.HoverColor = theme.BorderSettings.Hover;

                ForeColor          = theme.TextSetting.Enabled;
                TextStyle.Enabled  = theme.TextSetting.Enabled;
                TextStyle.Disabled = theme.TextSetting.Disabled;

                Font        = theme.TextSetting.Font;
                _headerFont = ThemeManager.Theme.TextSetting.Font;

                _itemEnabled  = theme.ListItemSettings.Item;
                _itemSelected = theme.ListItemSettings.ItemSelected;
                _itemHover    = theme.ListItemSettings.ItemHover;

                _columnHeaderColor = theme.OtherSettings.ColumnHeader;
                _headerText        = theme.OtherSettings.ColumnText;

                _colorState = new ColorState
                {
                    Enabled  = theme.BackgroundSettings.Type4,
                    Disabled = theme.BackgroundSettings.Type1
                };
            }
            catch (Exception e)
            {
                VisualExceptionDialog.Show(e);
            }

            Invalidate();
            OnThemeChanged(new ThemeEventArgs(theme));
        }
Exemple #14
0
        /********************************************************************************************
        * Constructors
        ********************************************************************************************/

        public QQDataSet(
            int n,
            int l,
            ColorState colorState,
            PotentialType potentialType,
            double temperature,
            double debyeMass,
            double displacementRMS,
            double softScale,
            double ultraSoftScale,
            double boundMass,
            double energy,
            double gammaDamp,
            double gammaDiss,
            double gammaTot
            )
        {
            N               = n;
            L               = l;
            ColorState      = colorState;
            PotentialType   = potentialType;
            Temperature     = temperature;
            DebyeMass       = debyeMass;
            DisplacementRMS = displacementRMS;
            SoftScale       = softScale;
            UltraSoftScale  = ultraSoftScale;
            BoundMass       = boundMass;
            Energy          = energy;
            GammaDamp       = gammaDamp;
            GammaDiss       = gammaDiss;
            GammaTot        = gammaTot;
        }
Exemple #15
0
        /********************************************************************************************
        * Constructors
        ********************************************************************************************/

        public VacuumPotential_NoString(
            double alphaSoft,
            ColorState colorState
            )
            : base(alphaSoft, 0, colorState)
        {
        }
    public void SetColorState( ColorState cs )
    {
        if(colorState == ColorState.CS_ACTIVE && cs != ColorState.CS_ACTIVE){
            //deselect sound
            SoundManager.instance.PlaySoundAt(platSource, "ClawRelease");
        } else if(colorState != ColorState.CS_ACTIVE && cs == ColorState.CS_ACTIVE){
            //select sound
            SoundManager.instance.PlaySoundAt(platSource, "ClawGrab");
        }
        colorState = cs;

        foreach( MeshRenderer rend in LEDRenderers )
        {

            switch( cs )
            {
            case ColorState.CS_ACTIVE:
                rend.materials[1].color = Color.red;
                break;
            case ColorState.CS_NEXTTOSELECT:
                rend.materials[1].color = Color.green;
                break;
            case ColorState.CS_NOTACTIVE:
                rend.materials[1].color = Color.white;
                break;
            }

            foreach( Transform particle in particleSystems )
                particle.gameObject.SetActive(false);

            particleSystems[(int) cs].gameObject.SetActive(true);
        }
    }
Exemple #17
0
        public void UpdateTheme(Theme theme)
        {
            try
            {
                _border.Color      = theme.BorderSettings.Normal;
                _border.HoverColor = theme.BorderSettings.Hover;

                ForeColor          = theme.TextSetting.Enabled;
                TextStyle.Enabled  = theme.TextSetting.Enabled;
                TextStyle.Disabled = theme.TextSetting.Disabled;

                Font = theme.TextSetting.Font;

                _backColorState = new ColorState
                {
                    Enabled  = theme.BackgroundSettings.Type4,
                    Disabled = theme.BackgroundSettings.Type1
                };
            }
            catch (Exception e)
            {
                VisualExceptionDialog.Show(e);
            }

            Invalidate();
            OnThemeChanged(new ThemeEventArgs(theme));
        }
        public Color GetLabelStateColor(ColorState state)
        {
            var button = this.button as ButtonWithLabel;

            if (button == null)
            {
                return(default(Color));
            }

            var colors = button.labelColor;

            if (state == ColorState.Normal)
            {
                return(colors.normalColor);
            }
            if (state == ColorState.Highlighted)
            {
                return(colors.highlightedColor);
            }
            if (state == ColorState.Pressed)
            {
                return(colors.pressedColor);
            }
            if (state == ColorState.Disabled)
            {
                return(colors.disabledColor);
            }

            return(default(Color));
        }
        public void UpdateTheme(Theme theme)
        {
            try
            {
                _border.Color      = theme.ColorPalette.BorderNormal;
                _border.HoverColor = theme.ColorPalette.BorderHover;

                _foreColor          = theme.ColorPalette.TextEnabled;
                _textDisabledColor  = theme.ColorPalette.TextDisabled;
                _textStyle.Enabled  = theme.ColorPalette.TextEnabled;
                _textStyle.Disabled = theme.ColorPalette.TextDisabled;

                _borderEdge.BackColor = theme.ColorPalette.BorderNormal;

                _backColorState = new ColorState {
                    Enabled = theme.ColorPalette.VisualComboBoxEnabled, Disabled = theme.ColorPalette.VisualComboBoxDisabled
                };

                _buttonColor = theme.ColorPalette.ElementEnabled;

                _menuTextColor  = theme.ColorPalette.TextEnabled;
                _menuItemNormal = theme.ColorPalette.Item;
                _menuItemHover  = theme.ColorPalette.ItemHover;
            }
            catch (Exception e)
            {
                VisualExceptionDialog.Show(e);
            }

            Invalidate();
            OnThemeChanged(new ThemeEventArgs(theme));
        }
Exemple #20
0
        public void UpdateTheme(Theme theme)
        {
            try
            {
                _border.Color      = theme.ColorPalette.BorderNormal;
                _border.HoverColor = theme.ColorPalette.BorderHover;

                ForeColor          = theme.ColorPalette.TextEnabled;
                TextStyle.Enabled  = theme.ColorPalette.TextEnabled;
                TextStyle.Disabled = theme.ColorPalette.TextDisabled;

                _buttonColorState = new ControlColorState {
                    Disabled = theme.ColorPalette.Disabled, Enabled = theme.ColorPalette.Enabled, Hover = theme.ColorPalette.Hover, Pressed = theme.ColorPalette.Pressed
                };

                _backColorState = new ColorState {
                    Enabled = theme.ColorPalette.ControlEnabled, Disabled = theme.ColorPalette.ControlDisabled
                };

                _borderButton.BackColor = theme.ColorPalette.BorderNormal;
                _borderImage.BackColor  = theme.ColorPalette.BorderNormal;
            }
            catch (Exception e)
            {
                ConsoleEx.WriteDebug(e);
            }

            Invalidate();
            OnThemeChanged(new ThemeEventArgs(theme));
        }
        public void UpdateTheme(Theme theme)
        {
            try
            {
                _border.Color      = theme.ColorPalette.BorderNormal;
                _border.HoverColor = theme.ColorPalette.BorderHover;

                ForeColor          = theme.ColorPalette.TextEnabled;
                TextStyle.Enabled  = theme.ColorPalette.TextEnabled;
                TextStyle.Disabled = theme.ColorPalette.TextDisabled;

                // Font = theme.ColorPalette.Font;
                _borderEdge.BackColor    = theme.ColorPalette.BorderNormal;
                _borderButtons.BackColor = theme.ColorPalette.BorderNormal;

                _buttonForeColor = theme.ColorPalette.TextLight;

                // _buttonFont = new Font(theme.ColorPalette.Font.FontFamily, 14, FontStyle.Bold);
                _buttonFont  = new Font(SystemFonts.DefaultFont.FontFamily, 14, FontStyle.Bold);
                _buttonColor = theme.ColorPalette.ControlEnabled;

                _colorState = new ColorState {
                    Enabled = theme.ColorPalette.ControlEnabled, Disabled = theme.ColorPalette.ControlDisabled
                };
            }
            catch (Exception e)
            {
                Logger.WriteDebug(e);
            }

            Invalidate();
            OnThemeChanged(this, new ThemeEventArgs(theme));
        }
        /// <summary>Initializes a new instance of the <see cref="VisualRichTextBox" /> class.</summary>
        public VisualRichTextBox()
        {
            SetStyle(ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true);

            // Contains another control
            SetStyle(ControlStyles.ContainerControl, true);

            // Cannot select this control, only the child and does not generate a click event
            SetStyle(ControlStyles.Selectable | ControlStyles.StandardClick, false);

            _border = new Border();

            ThemeManager    = new StyleManager(Settings.DefaultValue.DefaultStyle);
            _backColorState = new ColorState {
                Enabled = ThemeManager.Theme.ColorPalette.ControlEnabled
            };

            _richTextBox = new RichTextBox
            {
                Size        = GetInternalControlSize(Size, _border),
                Location    = GetInternalControlLocation(_border),
                Text        = string.Empty,
                BorderStyle = BorderStyle.None,
                Font        = Font,
                ForeColor   = ForeColor,
                BackColor   = _backColorState.Enabled,
                Multiline   = true
            };

            Size = new Size(150, 100);

            Controls.Add(_richTextBox);

            UpdateTheme(ThemeManager.Theme);
        }
Exemple #23
0
 public ColorDataPack GetColorDataPack(ColorState state, string tagName)
 {
     if (state == ColorState.Blue)
     {
         return(blueStatePack);
     }
     else if (state == ColorState.Red)
     {
         return(redStatePack);
     }
     else if (state == ColorState.Clean)
     {
         if (tagName == "Tile")
         {
             return(TileDefaultStatePack);
         }
         else
         {
             return(TowerDefaultStatePack);
         }
     }
     else if (state == ColorState.Contested)
     {
         return(TowerContestedStatePack);
     }
     else
     {
         return(TileDefaultStatePack);
     }
 }
Exemple #24
0
        /// <summary>
        /// 셀 상태 배경색을 지정합니다
        /// </summary>
        /// <param name="state"></param>
        /// <param name="Red"></param>
        /// <param name="Green"></param>
        /// <param name="Blue"></param>
        public void SetBackgroundColorState(ColorState state, byte Red, byte Green, byte Blue)
        {
            try
            {
                switch (state)
                {
                case ColorState.Normal:
                    NormalStyle = SetBackgroundColor(Red, Green, Blue);
                    break;

                case ColorState.Lock:
                    LockStyle = SetBackgroundColor(Red, Green, Blue);
                    break;

                case ColorState.Highlight:
                    HighlightStyle = SetBackgroundColor(Red, Green, Blue);
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #25
0
        public void UpdateTheme(Theme theme)
        {
            try
            {
                ForeColor          = theme.TextSetting.Enabled;
                TextStyle.Enabled  = theme.TextSetting.Enabled;
                TextStyle.Disabled = theme.TextSetting.Disabled;

                Font = theme.TextSetting.Font;

                _colorState = new ColorState
                {
                    Enabled  = theme.BackgroundSettings.Type3,
                    Disabled = theme.OtherSettings.ControlDisabled
                };

                _progress = theme.OtherSettings.Progress;
            }
            catch (Exception e)
            {
                VisualExceptionDialog.Show(e);
            }

            Invalidate();
            OnThemeChanged(new ThemeEventArgs(theme));
        }
Exemple #26
0
        /// <summary>Initializes a new instance of the <see cref="VisualToggle" /> class.</summary>
        public VisualToggle()
        {
            Size = new Size(50, 25);
            Font = StyleManager.Font;

            _animationTimer = new Timer
            {
                Interval = 1
            };

            _animationTimer.Tick += AnimationTimerTick;
            _controlColorState    = new ColorState();
            _buttonColorState     = new ControlColorState();
            _toggleType           = ToggleTypes.YesNo;
            _buttonSize           = new Size(20, 20);

            _border = new Border
            {
                Rounding = Settings.DefaultValue.Rounding.ToggleBorder
            };

            _buttonBorder = new Border
            {
                Rounding = Settings.DefaultValue.Rounding.ToggleButton
            };

            UpdateTheme(Settings.DefaultValue.DefaultStyle);
        }
        public void SetStateColor(ColorState state, Color color)
        {
            if (this.button.IsDestroyed() == true)
            {
                return;
            }

            var colors = this.button.colors;

            if (state == ColorState.Normal)
            {
                colors.normalColor = color;
            }
            if (state == ColorState.Highlighted)
            {
                colors.highlightedColor = color;
            }
            if (state == ColorState.Pressed)
            {
                colors.pressedColor = color;
            }
            if (state == ColorState.Disabled)
            {
                colors.disabledColor = color;
            }
            this.button.colors = colors;

            this.Refresh();
        }
Exemple #28
0
        public void UpdateTheme(Theme theme)
        {
            try
            {
                _border.Color      = theme.ColorPalette.BorderNormal;
                _border.HoverColor = theme.ColorPalette.BorderHover;

                _buttonBorder.Color      = theme.ColorPalette.BorderNormal;
                _buttonBorder.HoverColor = theme.ColorPalette.BorderHover;

                ForeColor          = theme.ColorPalette.TextEnabled;
                TextStyle.Enabled  = theme.ColorPalette.TextEnabled;
                TextStyle.Disabled = theme.ColorPalette.TextDisabled;

                // Font = theme.ColorPalette.Font;
                _controlColorState = new ColorState {
                    Enabled = theme.ColorPalette.ControlEnabled, Disabled = theme.ColorPalette.ControlDisabled
                };

                _buttonColorState = new ControlColorState {
                    Enabled = theme.ColorPalette.Enabled, Disabled = theme.ColorPalette.Disabled, Hover = theme.ColorPalette.Hover, Pressed = theme.ColorPalette.Pressed
                };
            }
            catch (Exception e)
            {
                Logger.WriteDebug(e);
            }

            Invalidate();
            OnThemeChanged(this, new ThemeEventArgs(theme));
        }
Exemple #29
0
        private void SetStateInternal(PowerStateValue powerState, ColorState colorState, bool forceUpdate = false)
        {
            if (colorState == null)
            {
                if (!forceUpdate && _powerState == powerState)
                {
                    return;
                }
            }
            else if (!forceUpdate && _powerState == powerState && colorState.Equals(_colorState))
            {
                return;
            }

            var oldState = GetState();

            var parameters = forceUpdate ? new IHardwareParameter[] { HardwareParameter.ForceUpdateState } : new IHardwareParameter[0];

            if (powerState == PowerStateValue.On)
            {
                _adapter.SetState(AdapterPowerState.On, GenerateAdapterColor(colorState), parameters);
            }
            else if (powerState == PowerStateValue.Off)
            {
                _adapter.SetState(AdapterPowerState.Off, GenerateAdapterColor(colorState), parameters);
            }

            _powerState = powerState;
            _colorState = colorState;

            OnStateChanged(oldState);
        }
        public void SetColorState(ColorState colorState)
        {
            CurrentColorState = colorState;
            switch (colorState)
            {
            case ColorState.Dark:
                OverlayColor = Color.Lerp(CurrentColor, Color.Black, 0.4f);
                break;

            case ColorState.DarkDark:
                OverlayColor = Color.Lerp(CurrentColor, Color.Black, 0.6f);
                break;

            case ColorState.Light:
                OverlayColor = Color.Lerp(CurrentColor, Color.White, 0.5f);
                break;

            case ColorState.None:
                OverlayColor            = Color.Lerp(CurrentColor, CurrentColor, 1f);
                OverlayColorOpacity     = 0;
                OverlayColorOpacityStep = ConstOverlayColorOpacityStep;
                break;

            case ColorState.Glow:
                OverlayColorOpacityStep = ConstOverlayColorOpacityStep;
                break;
            }
        }
Exemple #31
0
        public void Test()
        {
            // 建立对象,并对其进行两次装饰。 bold = false, color= black
            IText text = new TextObject();

            text = new BoldDecorator(text);
            text = new ColorDecorator(text);
            Assert.AreEqual <string>("<Black>hello</Black>", text.Content);

            // 动态找到需要更新的Decorator并修改相应属性
            // bold = false, color = red
            ColorState newColorState = new ColorState();

            newColorState.Color = Color.Red;
            IDecorator root = (IDecorator)text;

            root.Refresh <ColorDecorator>(newColorState);
            Assert.AreEqual <string>("<Red>hello</Red>", text.Content);

            // 动态找到需要更新的Decorator并修改相应属性
            // bold = true, color = red
            BoldState newBoldState = new BoldState();

            newBoldState.IsBold = true;
            root.Refresh <BoldDecorator>(newBoldState);
            Assert.AreEqual <string>("<Red><b>hello</b></Red>", text.Content);
        }
Exemple #32
0
 void Awake()
 {
     colorState = ColorState.Red;
     shipSpriteRenderer = this.GetComponent<SpriteRenderer> ();
     if (shipSpriteRenderer != null) {
         shipSprite = shipSpriteRenderer.sprite;
     }
 }
    void Awake()
    {
        colState = ColorState.noCol;

        col2d = GetComponent<Collider2D> ();
        col2d.isTrigger = true;

        audio = GetComponent<AudioSource> ();
    }
Exemple #34
0
        public BasilColorSet(ColorState state)
        {
            switch (state)
            {
                case ColorState.Valid:
                    ForeColor = DEFAULT_VALID_FORE_COLOR;
                    BackColor = DEFAULT_VALID_BACK_COLOR;
                    BorderColor = DEFAULT_VALID_BORDER_COLOR;
                    return;

                case ColorState.Invalid:
                    ForeColor = DEFAULT_INVALID_FORE_COLOR;
                    BackColor = DEFAULT_INVALID_BACK_COLOR;
                    BorderColor = DEFAULT_INVALID_BORDER_COLOR;
                    return;
            }
        }
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "Player") {
            if(colState != ownColor){
                if(!audio.isPlaying){
                    audio.Play ();
                }
                if(particles != null){
                    GameObject p = Instantiate (particles, transform.position, transform.rotation) as GameObject;
                    Destroy (p, 3.0f);
                }
            }

            colState = ownColor;
            if(OnColorChanged != null){
                OnColorChanged();
            }
            Debug.Log (colState);
        }
    }
Exemple #36
0
    void Update()
    {
        // 3 - Retrieve axis information
        float inputX = Input.GetAxis("Horizontal");
        float inputY = Input.GetAxis("Vertical");

        // 4 - Movement per direction
        movement = new Vector2(
            MovementSpeed.x * inputX,
            MovementSpeed.y * inputY);

        transform.position += new Vector3 (movement.x, movement.y, 0);

        if (Input.GetKeyDown(KeyCode.LeftShift) || Input.GetKeyDown(KeyCode.RightControl)) {
            if (colorState == ColorState.Red) {
                colorState = ColorState.Blue;
                ChangeShip(Color.blue);
            }
            else {
                colorState = ColorState.Red;
                ChangeShip (Color.red);
            }
        }
    }
 public void RememberColorState(ColorState colorState)
 {
     RememberedColorState = colorState;
     SetColorState(colorState);
 }
		public void SetLabelStateColor(ColorState state, Color color) {
			
			if (this.button.IsDestroyed() == true) return;

			var button = this.button as ButtonWithLabel;
			if (button == null) return;

			var colors = button.labelColor;
			if (state == ColorState.Normal) colors.normalColor = color;
			if (state == ColorState.Highlighted) colors.highlightedColor = color;
			if (state == ColorState.Pressed) colors.pressedColor = color;
			if (state == ColorState.Disabled) colors.disabledColor = color;
			button.labelColor = colors;
			
			this.Refresh();

		}
		public Color GetLabelStateColor(ColorState state) {
			
			var button = this.button as ButtonWithLabel;
			if (button == null) return default(Color);
			
			var colors = button.labelColor;
			if (state == ColorState.Normal) return colors.normalColor;
			if (state == ColorState.Highlighted) return colors.highlightedColor;
			if (state == ColorState.Pressed) return colors.pressedColor;
			if (state == ColorState.Disabled) return colors.disabledColor;
			
			return default(Color);
			
		}
		public void SetStateColor(ColorState state, Color color) {
			
			if (this.button.IsDestroyed() == true) return;

			var colors = this.button.colors;
			if (state == ColorState.Normal) colors.normalColor = color;
			if (state == ColorState.Highlighted) colors.highlightedColor = color;
			if (state == ColorState.Pressed) colors.pressedColor = color;
			if (state == ColorState.Disabled) colors.disabledColor = color;
			this.button.colors = colors;

			this.Refresh();

		}
		public Color GetStateColor(ColorState state) {
			
			var colors = this.button.colors;
			if (state == ColorState.Normal) return colors.normalColor;
			if (state == ColorState.Highlighted) return colors.highlightedColor;
			if (state == ColorState.Pressed) return colors.pressedColor;
			if (state == ColorState.Disabled) return colors.disabledColor;

			return default(Color);

		}
Exemple #42
0
 public void SetColor(Color c)
 {
     this._currentColor = c;
     c.a = 0f;
     this._currentColorZeroAlpha = c;
     this._fadeGoalColor = this._currentColor;
     this.SwitchToState(FadeState.FADING);
     //this.SnapColor();
     this.colorState = ColorState.OTHER;
 }
Exemple #43
0
 /// <summary>
 /// ColorState型の値を色コードとして返す
 /// </summary>
 /// <param name="color"></param>
 /// <returns></returns>
 public static Color GetColor(ColorState color)
 {
     return colorTable[color];
 }
Exemple #44
0
 public ObjectColor(ColorState state)
 {
     this.state = state;
 }
	void getState()
	{
		switch(currentLane)
		{
		case 0:
			colorState = ColorState.RED;
			break;
		case -1:
			colorState = ColorState.ORANGE;
			break;
		case -2:
			colorState = ColorState.YELLOW;
			break;
		case -3:
			colorState = ColorState.GREEN;
			break;
		case -4:
			colorState = ColorState.BLUE;
			break;
		case -5:
			colorState = ColorState.PURPLE;
			break;
		}
		
	}
	void Update () {
		if(character == null) {
			Destroy(this.gameObject);
			return;
		}

		if(InputHandler.current.chargingTime > 0) {
			cursorCharge.SetActive(true);
			showChargeBar();
		} else {
			cursorCharge.SetActive(false);
		}

		if(hp < character.status.hp || hp > character.status.hp+5f ) {
			if(hpChangeFrameRemain > 0) {
				hpChangeFrameRemain --;
			} else {
				if(hp > character.status.hp) {
					hp -= 5;
				} else {
					hp += 5;
				}
				hpChangeFrameRemain = hpChangeFrame;

				for(int a=19;a!=0;--a) {
					GameObject obj =  (GameObject)hpBarPart[a];
					if(hp <= 5*a) {
						obj.SetActive(false);
					} else {
						obj.SetActive(true);
					}
				}
				if(hp/character.status.maxhp <= 0.3f && colorState != ColorState.Red) {
					foreach (GameObject obj in hpBarPart) {
						SpriteRenderer rend = obj.GetComponent<SpriteRenderer>();
						rend.color = new Color(255f/255f,50f/255f, 0);
					}
					colorState = ColorState.Red;
				} else if(hp/character.status.maxhp <= 0.6f && colorState == ColorState.Yellow) {
					for(int a=0; a!=20;++a) {
						GameObject obj =  (GameObject)hpBarPart[a];
						SpriteRenderer rend = obj.GetComponent<SpriteRenderer>();
						rend.color = new Color(255/255f,164f/255f, 0);
					}
					colorState = ColorState.Orange;
				} else if(hp/character.status.maxhp > 0.6f && colorState != ColorState.Yellow) {
					for(int a=0; a!=20;++a) {
						GameObject obj =  (GameObject)hpBarPart[a];
						SpriteRenderer rend = obj.GetComponent<SpriteRenderer>();
						rend.color = new Color(240/255f,255f/255f, 0);
					}
					colorState = ColorState.Yellow;
				}
			}
		}

		transform.position = character.transform.position - new Vector3(0, 0.9f, 0);

	}
 public void SetColorState(ColorState colorState)
 {
     CurrentColorState = colorState;
     switch (colorState) {
         case ColorState.Dark:
             OverlayColor = Color.Lerp(CurrentColor, Color.Black, 0.4f);
             break;
         case ColorState.DarkDark:
             OverlayColor = Color.Lerp(CurrentColor, Color.Black, 0.6f);
             break;
         case ColorState.Light:
             OverlayColor = Color.Lerp(CurrentColor, Color.White, 0.5f);
             break;
         case ColorState.None:
             OverlayColor = Color.Lerp(CurrentColor, CurrentColor, 1f);
             OverlayColorOpacity = 0;
             OverlayColorOpacityStep = ConstOverlayColorOpacityStep;
             break;
         case ColorState.Glow:
             OverlayColorOpacityStep = ConstOverlayColorOpacityStep;
             break;
     }
 }