-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
…2023.2.10f1.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"version": "1.0", | ||
"components": [ | ||
"Microsoft.VisualStudio.Workload.ManagedGame" | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!114 &-7451729123616202099 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 11 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 0} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} | ||
m_Name: | ||
m_EditorClassIdentifier: | ||
version: 0 | ||
--- !u!21 &2100000 | ||
Material: | ||
serializedVersion: 8 | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_Name: Alphed | ||
m_Shader: {fileID: -6465566751694194690, guid: 9d50b8fc70812b34785f76f4adc04532, type: 3} | ||
m_ValidKeywords: [] | ||
m_InvalidKeywords: [] | ||
m_LightmapFlags: 4 | ||
m_EnableInstancingVariants: 0 | ||
m_DoubleSidedGI: 0 | ||
m_CustomRenderQueue: -1 | ||
stringTagMap: {} | ||
disabledShaderPasses: [] | ||
m_SavedProperties: | ||
serializedVersion: 3 | ||
m_TexEnvs: | ||
- _BumpMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailAlbedoMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailMask: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailNormalMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _EmissionMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _MainTex: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _MetallicGlossMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _OcclusionMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _ParallaxMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _Texture2D: | ||
m_Texture: {fileID: 2800000, guid: 963532af8bec74a4b81ce7f478aa1a70, type: 3} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
m_Ints: [] | ||
m_Floats: | ||
- _BUILTIN_QueueControl: 0 | ||
- _BUILTIN_QueueOffset: 0 | ||
- _BumpScale: 1 | ||
- _Cutoff: 0.5 | ||
- _DetailNormalMapScale: 1 | ||
- _DstBlend: 0 | ||
- _Fuzziness: 1 | ||
- _GlossMapScale: 1 | ||
- _Glossiness: 0.5 | ||
- _GlossyReflections: 1 | ||
- _Metallic: 0 | ||
- _Mode: 0 | ||
- _OcclusionStrength: 1 | ||
- _Parallax: 0.02 | ||
- _SmoothnessTextureChannel: 0 | ||
- _SpecularHighlights: 1 | ||
- _SrcBlend: 1 | ||
- _UVSec: 0 | ||
- _ZWrite: 1 | ||
m_Colors: | ||
- _AlphaColor: {r: 1, g: 1, b: 1, a: 0} | ||
- _Color: {r: 0, g: 0, b: 0, a: 1} | ||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} | ||
- _MixColor: {r: 1, g: 0, b: 0, a: 0} | ||
m_BuildTextureStacks: [] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
|
||
namespace JALJ.Common | ||
{ | ||
[ExecuteAlways] | ||
public class CharacterBlendShapes : MonoBehaviour | ||
{ | ||
public string[] blendShapesNames; | ||
|
||
SkinnedMeshRenderer _charMeshRenderer; | ||
|
||
public void RetrieveBlendshapes() | ||
{ | ||
// Retrive the first mesh renderer from the children. | ||
_charMeshRenderer = GetComponentInChildren<SkinnedMeshRenderer>(); | ||
|
||
// Retrieve the blendshapes' indexes. | ||
var mesh = _charMeshRenderer.sharedMesh; | ||
blendShapesNames = new string[mesh.blendShapeCount]; | ||
for (int i = 0; i < mesh.blendShapeCount; i++) | ||
blendShapesNames[i] = mesh.GetBlendShapeName(i); | ||
} | ||
|
||
#region MonoBehaviour impl. | ||
private void Awake() | ||
{ | ||
RetrieveBlendshapes(); | ||
} | ||
#endregion Monobehaviour impl. | ||
|
||
#region Indexed access | ||
int IndexOf(string key) => Array.IndexOf<string>(blendShapesNames, key); | ||
|
||
public float this[string key] | ||
{ | ||
get => _charMeshRenderer.GetBlendShapeWeight(IndexOf(key)); | ||
set => _charMeshRenderer.SetBlendShapeWeight(IndexOf(key), value); | ||
} | ||
|
||
public ICollection<string> Keys => blendShapesNames; | ||
|
||
public ICollection<float> Values | ||
=> blendShapesNames.Select(bs => this[bs]).ToArray(); | ||
|
||
public int Count => blendShapesNames.Length; | ||
|
||
public bool Contains(KeyValuePair<string, float> item) | ||
=> blendShapesNames.Contains(item.Key) && this[item.Key] == item.Value; | ||
|
||
public bool ContainsKey(string key) => blendShapesNames.Contains(key); | ||
|
||
public bool TryGetValue(string key, out float value) | ||
{ | ||
if (blendShapesNames.Contains(key)) | ||
{ | ||
value = this[key]; | ||
return true; | ||
} | ||
else | ||
{ | ||
value = default(float); | ||
return false; | ||
} | ||
} | ||
#endregion Indexed access | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.