private void OnSelectedColorPropertyChanged(Color newColor)
        {
            var item = AllColors.FirstOrDefault(i => i.Color == newColor);

            Debug.Assert(item != null);
            ctlColorPicker.SelectedItem = item;
        }
Esempio n. 2
0
    }    //awake

    IEnumerator ChangePlayerColorInSeconds()
    {
        yield return(new WaitForSeconds(1f));

        colorChooserTimer--;
        if (colorChooserTimer <= 0)
        {
            if (GamePreferences.GetSoundSetting() == 1)
            {
                AudioSource.PlayClipAtPoint(boxChangeSound, gameObject.transform.position);
            }
            string prevColor = playerBoxColorString;
            playerBoxColorString = AllColors.GET_RANDOM_COLOR_STRING();
            //more randmized
            if (prevColor == playerBoxColorString)
            {
                playerBoxColorString = AllColors.GET_RANDOM_COLOR_STRING();
            }
            Debug.Log("New COlor " + playerBoxColorString);
            colorChooserTimer = 10;
        }        //timer is at 10

        if (Player.isAlive)
        {
            StartCoroutine("ChangePlayerColorInSeconds");
        }
        else
        {
            StopCoroutine("ChangePlayerColorInSeconds");
        }
    }    //ChangePlayerColor
        private void OnDrop(object sender, DropEventArgs e)
        {
            if (!e.Data.Properties.ContainsKey("Source"))
            {
                return;
            }

            var sl = (sender as Element).Parent as StackLayout;

            if (e.Data.Properties["Source"] == sl)
            {
                return;
            }

            var color = e.Data.Properties["Color"] as SolidColorBrush;

            if (AllColors.Contains(color))
            {
                AllColors.Remove(color);
                RainbowColors.Add(color);
            }
            else
            {
                RainbowColors.Remove(color);
                AllColors.Add(color);
            }

            SLAllColors.Background = SolidColorBrush.White;
            SLRainbow.Background   = SolidColorBrush.White;
        }
Esempio n. 4
0
    private int timeDivider = 3;    //default

    // Use this for initialization
    void Start()
    {
        timeDivider = Player.isAlive == true ? 1 : 3;

        start = AllColors.GET_COLOR(Player.explodeBoxColorString);
        //for changing the box color
        gameObject.GetComponent <Renderer>().material.color = start;
        end = new Color(start.r, start.g, start.b, 0.0f);
    }
Esempio n. 5
0
        private static void ListColors()
        {
            var colors = new AllColors();

            foreach (Color theColor in colors)
            {
                Console.Write(theColor.Name + " ");
            }
        }
 static void Main(string[] args)
 {
     PrimaryColors color1 = PrimaryColors.Red;
     AllColors     result = (AllColors)color1;
     // AllColors.Red
     SecondaryColors color2 = SecondaryColors.Green;
     AllColors       other  = (AllColors)color2;
     // AllColors.Green
     AllColors final = ParseColor(PrimaryColors.Yellow);
     // AllColors.Yellow
 }
Esempio n. 7
0
    //</Snippet31>


    //<Snippet32>
    private static void ListColors()
    {
        var colors = new AllColors();

        foreach (Color theColor in colors)
        {
            Console.Write(theColor.Name + " ");
        }
        Console.WriteLine();
        // Output: red blue green
    }
Esempio n. 8
0
        private void ListColors()
        {
            AllColors colors = new AllColors();

            foreach (Color color in colors)
            {
                Console.Write(color.Name + " ");
            }

            Console.WriteLine();
        }
 private void SaveSeriesDetails(SeriesModel dataModel)
 {
     if (dataModel != null)
     {
         var matchedColor = AllColors.Where(x => x.ColorName == dataModel.ColorInfo.ColorName).FirstOrDefault();
         dataModel.ColorInfo.Color = matchedColor.Color;
         DataModelProvider.Instance.SaveSelectedDataModel(dataModel);
         Console.WriteLine(dataModel);
         GetSavedDataModels();
         CreateWpfGraphDataSeries();
     }
 }
Esempio n. 10
0
    void Start()
    {
        AllColors myColors = (AllColors)Random.Range(0, 4);
        Renderer  rend     = GetComponent <Renderer>();

        switch (myColors)
        {
        case AllColors.red:
            print("color: " + myColors);
            rend.material.color = Color.red;
            red    = true;
            blue   = false;
            green  = false;
            yellow = false;
            break;

        case AllColors.green:
            print("color: " + myColors);
            rend.material.color = Color.green;
            red    = false;
            blue   = false;
            green  = true;
            yellow = false;
            break;

        case AllColors.blue:
            print("color: " + myColors);
            rend.material.color = Color.blue;
            red    = false;
            blue   = true;
            green  = false;
            yellow = false;
            break;

        case AllColors.yellow:
            print("color: " + myColors);
            rend.material.color = Color.yellow;
            red    = false;
            blue   = false;
            green  = false;
            yellow = true;
            break;

        default:
            print("color: " + myColors);
            rend.material.color = Color.red;
            red    = true;
            blue   = false;
            green  = false;
            yellow = false;
            break;
        }
    }
Esempio n. 11
0
 public static void Load(string configFolderPath)
 {
     ConfigFolderPath = configFolderPath;
     AllColors.AddAllColors();
     AllSideEffects.AddAllSideEffects();
     AllScriptExecuteSettings.AddAllScriptExecuteSettings();
     AllBuffs.AddAllBuffs();
     AllCards.AddAllCards();
     AllBuilds.AddAllBuilds();
     AllLevels.AddAllLevels();
     AllStories.AddAllStories();
     AllCards.RefreshAllCardXML();
 }
Esempio n. 12
0
        public void SetAllLists(Manager manager)
        {
            if (SelectedModelId != 0)
            {
                var selectedModel = manager.GetModel(SelectedModelId);
                AllModels.Add(new SelectListItem {
                    Value = selectedModel.Id.ToString(), Text = selectedModel.Name
                });
            }
            //makes
            foreach (var make in manager.GetAllMakes())
            {
                AllMakes.Add(new SelectListItem {
                    Value = make.Id.ToString(), Text = make.Name
                });
            }
            //models

            //conditions
            foreach (var condition in manager.GetAllConditions())
            {
                AllConditions.Add(new SelectListItem {
                    Value = condition.Id.ToString(), Text = condition.Name
                });
            }

            //styles
            foreach (var style in manager.GetAllBodyStyles())
            {
                AllStyles.Add(new SelectListItem {
                    Value = style.Id.ToString(), Text = style.Name
                });
            }

            //colors
            foreach (var color in manager.GetAllColors())
            {
                AllColors.Add(new SelectListItem {
                    Value = color.Id.ToString(), Text = color.Name
                });
            }

            //transmissions
            foreach (var trans in manager.GetAllTransmissions())
            {
                AllTransmissions.Add(new SelectListItem {
                    Value = trans.Id.ToString(), Text = trans.Name
                });
            }
        }
Esempio n. 13
0
        public ColorDialogViewModel()
        {
            var properties = typeof(Brushes).GetProperties(BindingFlags.Static | BindingFlags.Public);

            foreach (var property in properties)
            {
                var colorInfo = new ColorInfo(property.Name,
                                              (SolidColorBrush)property.GetValue(null, null));
                AllColors.Add(colorInfo);
            }

            SelectColorCommand = new RelayCommand(o =>
            {
                //_tableViewModel.SelectRectangularBlockOfCells(Column, Row);
            }, p => SelectedColor != null);
        }
Esempio n. 14
0
    }    //generateCircleObjects

    void Explode()
    {
        Box.colorCode = AllColors.GET_RANDOM_COLOR_STRING();
        var trans = gameObject.transform;

        for (int i = 0; i < 12; i++)
        {
            var temp = trans.position;
            temp.x += (10f * Random.Range(-10, 10));
            temp.y += (5f * Random.Range(-10, 10));
            CircleBoxPieces clone = Instantiate(circleBoxPiece, temp, Quaternion.identity) as CircleBoxPieces;
            // adding force to sideways
            clone.GetComponent <Rigidbody2D>().AddForce(Vector3.right * Random.Range(-10, 10) * 500);
            //adding force to up
            clone.GetComponent <Rigidbody2D>().AddForce(Vector3.up * Random.Range(-10, -1) * 600);
        } //loop of explode
    }     //explode
Esempio n. 15
0
    // Start is called before the first frame update
    void Start()
    {
        allColors         = new AllColors();
        sappedColors      = new Queue <SoulColor>();
        rounds            = new Queue <Round>();
        roundsToFire      = new Queue <int>();
        roundCount        = new Queue <int>();
        currentRoundCount = 0;

        health = 100;

        if (SapRange == 0)
        {
            SapRange = 5;
        }

        position = transform.position;
    }
Esempio n. 16
0
    void Awake()
    {
        Time.timeScale       = 1f;
        isAlive              = true;
        direction            = 0;
        score                = 0;
        indicatorHeight      = 0.15f;
        playerBoxColorString = AllColors.GET_RANDOM_COLOR_STRING();

        indicatorObject = gameObject.transform.GetChild(0).gameObject;
        boundaryX       = CameraProp.GetCameraWidth(Camera.main) / 2 - 55f;

        //default
        indicatorObject.transform.localScale = new Vector3(1f, indicatorHeight, 1f);
        colorChooserTimer = 10;

        StopAllCoroutines();
        StopCoroutine("ChangePlayerColorInSeconds");
        StartCoroutine("ChangePlayerColorInSeconds");
    }    //awake
Esempio n. 17
0
    // Use this for initialization
    void Start()
    {
        timeDivider = Player.isAlive == true ? 1 : 3;

        if (Application.loadedLevelName == AllScenes.MAIN_MENU_SCENE)
        {
            timeDivider = 4;
        }

        if (point)
        {
            start       = new Color(1f, 1f, 1f);
            timeDivider = 2;
        }
        else
        {
            //for changing the box color
            start = AllColors.GET_COLOR(Box.colorCode);
            gameObject.GetComponent <Renderer>().material.color = start;
        }
        end = new Color(start.r, start.g, start.b, 0.0f);
    }
Esempio n. 18
0
    }    //updateIndicator

    void ApplyColor()
    {
        gameObject.GetComponent <Renderer>().material.color      = AllColors.GET_COLOR(playerBoxColorString);
        indicatorObject.GetComponent <Renderer>().material.color = AllColors.GET_COLOR(playerBoxColorString);
    }    //ApplyColor