/** * Copyright(c) Live2D Inc. All rights reserved. * * Use of this source code is governed by the Live2D Open Software license * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html. */ using Live2D.Cubism.Core; using Live2D.Cubism.Rendering; using UnityEngine; namespace Live2D.Cubism.Framework.Json { /// /// Default pickers. /// public static class CubismBuiltinPickers { /// /// Builtin picker. /// /// Event source. /// Drawable to map to. /// Mapped texture. public static Material DrawableMaterialPicker(CubismModel3Json sender, CubismDrawable drawable) { return CubismBuiltinMaterials.GetBlendModeMaterial("UnlitBlendMode", drawable.ColorBlend, drawable.AlphaBlend, drawable.IsMasked, drawable.IsInverted, drawable.IsDoubleSided); } /// /// Pick material for s. /// /// Event source. /// Offscreen to map to. /// public static Material OffscreenMaterialPicker(CubismModel3Json sender, CubismOffscreen offscreen) { return CubismBuiltinMaterials.GetBlendModeMaterial("UnlitOffscreen", offscreen.ColorBlend, offscreen.AlphaBlend, offscreen.IsMasked, offscreen.IsInverted, offscreen.IsDoubleSided); } /// /// Builtin picker. /// /// Event source. /// Drawable to map to. /// Mapped texture. public static Texture2D TexturePicker(CubismModel3Json sender, CubismDrawable drawable) { return sender.Textures[drawable.TextureIndex]; } } }