예제 #1
0
        private static void ProcessAlterColor(int index, bool random)
        {
            CASCompositorController ths = CASCompositorController.sController;

            if (ths == null)
            {
                return;
            }

            int selection = ths.MaterialSkewerSelectedPattern;

            if (selection >= 0x0)
            {
                Color[] colors = new Color[4];

                for (int i = 0; i < 4; i++)
                {
                    colors[i] = ths.mMultiColorsThumb[i].ShadeColor;
                }

                colors[index] = AlterColor(colors[index], random);

                ths.ApplyMaterial(colors, selection, true, true);

                ths.RepopulateColors(true);
            }
        }
예제 #2
0
        private static void OnProcessRandomizeMaterial()
        {
            CASCompositorController ths = CASCompositorController.sController;

            if (ths == null)
            {
                return;
            }

            int selection = ths.MaterialSkewerSelectedPattern;

            if (selection >= 0x0)
            {
                List <Complate> choices = new List <Complate>();

                foreach (ItemGridCellItem item in ths.mMaterialsWindowGrid.Items)
                {
                    Complate choice = item.mTag as Complate;
                    if (choice == null)
                    {
                        continue;
                    }

                    choices.Add(choice);
                }

                if (choices.Count > 0)
                {
                    ths.ApplyMaterial(RandomUtil.GetRandomObjectFromList(choices).Clone() as Complate, selection, false, false);

                    ProcessAlterColor(true);
                }
            }
        }