public Material GetMaterial(MouthShape mouthShape) { switch (mouthShape) { case MouthShape.A: return(A); case MouthShape.B: return(B); case MouthShape.C: return(C); case MouthShape.D: return(D); case MouthShape.E: return(E); case MouthShape.F: return(F); case MouthShape.G: return(G); case MouthShape.H: return(H); case MouthShape.X: return(X); } return(null); }
public bool Deserialize(string text) { string[] parts = text.Split("\t"[0]); if (parts.Length == 2) { frame = Rhubarb.StringToFrame(parts[0]); phoneme = Rhubarb.GetPhonemeType(parts[1]); return(true); } return(false); }
public override void ProcessFrame(Playable playable, FrameData info, object playerData) { m_TrackBinding = playerData as RhubarbSprite; if (m_TrackBinding == null) { return; } int inputCount = playable.GetInputCount(); float totalWeight = 0f; float greatestWeight = 0f; int currentInputs = 0; for (int i = 0; i < inputCount; i++) { float inputWeight = playable.GetInputWeight(i); ScriptPlayable <RhubarbPlayableBehaviour> inputPlayable = (ScriptPlayable <RhubarbPlayableBehaviour>)playable.GetInput(i); RhubarbPlayableBehaviour input = inputPlayable.GetBehaviour(); totalWeight += inputWeight; if (inputWeight > greatestWeight) { m_AssignedMouthShape = input.MouthShape; m_TrackBinding.MouthShape = m_AssignedMouthShape; greatestWeight = inputWeight; } if (!Mathf.Approximately(inputWeight, 0f)) { currentInputs++; } } if (currentInputs != 1 && 1f - totalWeight > greatestWeight) { m_TrackBinding.MouthShape = m_DefaultMouthShape; } }
public static string GetPhonemeName(MouthShape mouthShape) { return(mouthShape.ToString()); }