-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
101 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
PregnancyPlus/PregnancyPlus.Core/tools/BlendShape/BlendShape.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using UnityEngine; | ||
using MessagePack; | ||
|
||
namespace KK_PregnancyPlus | ||
{ | ||
//This format contains all the info a blendshape needs to be created (For a single blendshape frame). It also server as the format we will save to a character card later | ||
[MessagePackObject(keyAsPropertyName: true)] | ||
public class BlendShape //This is technically a blendshape frame, but w/e. Its already set in stone | ||
{ | ||
public string name; | ||
private float _frameWeight = 100;//The range that _weight has to stay within | ||
public float frameWeight | ||
{ | ||
set { _frameWeight = Mathf.Clamp(value, 0, 100); } | ||
get { return _frameWeight <= 0 ? 100 : _frameWeight; }//Fix for old cards not having frameWeight prop, set them to 100 | ||
} | ||
private float _weight = 100;//The current weight | ||
public float weight | ||
{ | ||
set { _weight = value; } | ||
get { return _weight; } | ||
} | ||
public Vector3[] verticies; | ||
public Vector3[] normals; | ||
public Vector3[] tangents; | ||
|
||
[IgnoreMember] | ||
public bool isInitilized | ||
{ | ||
get { return name != null; } | ||
} | ||
|
||
[IgnoreMember] | ||
public int vertexCount | ||
{ | ||
get { return verticies.Length; } | ||
} | ||
|
||
[IgnoreMember] | ||
public string log | ||
{ | ||
get { return $"name {name} weight {_weight} frameWeight {_frameWeight} vertexCount {vertexCount}"; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters