public void SetMaterialsOriginal()
    {
        PreviewShaders.ReplaceShadersOriginal(rendHair);
        PreviewShaders.ReplaceShadersOriginal(rendAccessory);

        SetHairMaterials(false);
    }
    public void SetMaterialsPreview()
    {
        PreviewShaders.ReplaceShadersPreview(rendHair);
        PreviewShaders.ReplaceShadersPreview(rendAccessory);

        SetHairMaterials(true);
        SetAccessoryColor();
    }
Ejemplo n.º 3
0
        public void SetMaterialsPreview()
        {
            PreviewShaders.ReplaceShadersPreview(rendNormal);
            PreviewShaders.ReplaceShadersPreview(rendAlpha);
            PreviewShaders.ReplaceShadersPreview(rendGlass);

            SetColors(rendNormal);
            SetColors(rendAlpha);
            SetColors(rendGlass);
        }
Ejemplo n.º 4
0
        private void Awake()
        {
            PreviewShaders.Preview(rendNormal);
            PreviewShaders.Preview(rendAlpha);
            PreviewShaders.Preview(rendGlass);

            SetColors(rendNormal);
            SetColors(rendAlpha);
            SetColors(rendGlass);
        }
Ejemplo n.º 5
0
    private void Awake()
    {
        PreviewShaders.Preview(rendHair);
        PreviewShaders.Preview(rendAccessory);

        foreach (var rend in rendAccessory)
        {
            foreach (var mat in rend.sharedMaterials)
            {
                mat.SetColor("_Color", Color.red);
            }
        }
    }
    public void SetMaterialsPreview()
    {
        //Better handled by the ChaCustomHairComponent
        if (gameObject.GetComponent <ChaCustomHairComponent>())
        {
            return;
        }

        PreviewShaders.ReplaceShadersPreview(rendNormal);
        PreviewShaders.ReplaceShadersPreview(rendAlpha);
        PreviewShaders.ReplaceShadersPreview(rendHair);

        SetColors(rendNormal);
        SetColors(rendAlpha);
        SetColors(rendHair);
    }
    public void SetMaterialsPreview()
    {
        PreviewShaders.ReplaceShadersPreview(rendNormal01);
        PreviewShaders.ReplaceShadersPreview(rendNormal02);
        PreviewShaders.ReplaceShadersPreview(rendNormal03);

        PreviewShaders.ReplaceShadersPreview(rendAlpha01);
        PreviewShaders.ReplaceShadersPreview(rendAlpha02);

        PreviewShaders.ReplaceShadersPreview(rendEmblem01);
        PreviewShaders.ReplaceShadersPreview(exRendEmblem01);
        PreviewShaders.ReplaceShadersPreview(rendEmblem02);
        PreviewShaders.ReplaceShadersPreview(exRendEmblem02);

        PreviewShaders.ReplaceShadersPreview(objOpt01);
        PreviewShaders.ReplaceShadersPreview(objOpt02);
        PreviewShaders.ReplaceShadersPreview(objSleeves01);
        PreviewShaders.ReplaceShadersPreview(objSleeves02);
        PreviewShaders.ReplaceShadersPreview(objSleeves03);
    }
Ejemplo n.º 8
0
    private void Awake()
    {
        PreviewShaders.Preview(rendNormal01);
        PreviewShaders.Preview(rendNormal02);
        PreviewShaders.Preview(rendNormal03);

        PreviewShaders.Preview(rendAlpha01);
        PreviewShaders.Preview(rendAlpha02);

        PreviewShaders.Preview(rendEmblem01);
        PreviewShaders.Preview(exRendEmblem01);
        PreviewShaders.Preview(rendEmblem02);
        PreviewShaders.Preview(exRendEmblem02);

        PreviewShaders.Preview(objOpt01);
        PreviewShaders.Preview(objOpt02);
        PreviewShaders.Preview(objSleeves01);
        PreviewShaders.Preview(objSleeves02);
        PreviewShaders.Preview(objSleeves03);
    }
Ejemplo n.º 9
0
    private void Awake()
    {
        PreviewShaders.Preview(rendNormal);
        PreviewShaders.Preview(rendAlpha);
        PreviewShaders.Preview(rendHair);

        SetColors(rendNormal);
        SetColors(rendAlpha);
        SetColors(rendHair);

        var hairCmp = gameObject.GetComponent <ChaCustomHairComponent>();

        if (hairCmp)
        {
            foreach (var rend in hairCmp.rendAccessory)
            {
                foreach (var mat in rend.sharedMaterials)
                {
                    mat.SetColor("_Color", Color.red);
                }
            }
        }
    }
Ejemplo n.º 10
0
 public void SetMaterialsOriginal()
 {
     PreviewShaders.ReplaceShadersOriginal(rendNormal);
     PreviewShaders.ReplaceShadersOriginal(rendAlpha);
     PreviewShaders.ReplaceShadersOriginal(rendGlass);
 }
        private void ExecuteBuild()
        {
            var prebuildTime = System.DateTime.Now;

            if (AssetBundleModel.Model.DataSource.CanSpecifyBuildOutputDirectory)
            {
                if (m_ForceRebuild.state)
                {
                    string message = "Do you want to delete all files in the directory " + Constants.BuildPath + "?";
                    if (EditorUtility.DisplayDialog("File delete confirmation", message, "Yes", "No"))
                    {
                        try
                        {
                            if (Directory.Exists(Constants.BuildPath))
                            {
                                Directory.Delete(Constants.BuildPath, true);
                            }
                        }
                        catch (System.Exception e)
                        {
                            Debug.LogException(e);
                        }
                    }
                }
                if (!Directory.Exists(Constants.BuildPath))
                {
                    Directory.CreateDirectory(Constants.BuildPath);
                }
            }

            BuildAssetBundleOptions opt = BuildAssetBundleOptions.None;

            if (AssetBundleModel.Model.DataSource.CanSpecifyBuildOptions)
            {
                opt |= BuildAssetBundleOptions.UncompressedAssetBundle;

                foreach (var tog in m_ToggleData)
                {
                    if (tog.state)
                    {
                        opt |= tog.option;
                    }
                }
            }

            ABBuildInfo buildInfo = new ABBuildInfo();

            buildInfo.outputDirectory = Constants.BuildPath;
            buildInfo.options         = opt;
            buildInfo.buildTarget     = BuildTarget.StandaloneWindows;
            buildInfo.onBuild         = (assetBundleName) =>
            {
                if (m_InspectTab == null)
                {
                    return;
                }
                m_InspectTab.AddBundleFolder(buildInfo.outputDirectory);
                m_InspectTab.RefreshBundles();
            };

            PreviewShaders.SetAllMaterialsOriginal();
            AssetBundleModel.Model.DataSource.BuildAssetBundles(buildInfo);

            DirectoryInfo di           = new DirectoryInfo(buildInfo.outputDirectory);
            List <string> changedFiles = di.GetFiles("*.unity3d", SearchOption.AllDirectories).Where(x => x.LastWriteTime >= prebuildTime).Select(x => x.FullName).ToList();

            AssetDatabase.Refresh(ImportAssetOptions.ForceUpdate);

            SB3UScript.BuildAndRunScripts(Constants.BuildPath, m_UserData.m_KoikatsuPath, m_UserData.m_Compression, changedFiles);

            if (changedFiles.Count == 1)
            {
                Debug.Log("Successfully built 1 asset bundle.");
            }
            else
            {
                Debug.Log("Successfully built " + changedFiles.Count + " asset bundles.");
            }
            PreviewShaders.SetAllMaterialsPreview();
        }
 /// <summary>
 /// Switch to the preview shader when changing to a placeholder shader
 /// </summary>
 public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader)
 {
     base.AssignNewShaderToMaterial(material, oldShader, newShader);
     PreviewShaders.SetSelectedMaterialsPreview();
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Code to run on editor quit
 /// </summary>
 private static void Quitting()
 {
     PreviewShaders.SetAllMaterialsOriginal();
 }