snozbot / fungus

An easy to use Unity 3D library for creating illustrated Interactive Fiction games and more.
MIT License
1.62k stars 289 forks source link

Live2D integration #215

Open RonanPearce opened 8 years ago

RonanPearce commented 8 years ago

I downloaded Live2D SDK and played around with their samples to see what would be involved. If you follow their instructions and samples you should be able to get a scene setup with a Live2DModelUnity object in it. To control the animation on that object it looks like you call methods like setParamFloat() to set parameters for the animation.

This is from SimpleModel.cs in their example code live2DModel.setParamFloat( "PARAM_ANGLE_X" , dragMgr.getX()*30 ) ;

To use Fungus Script to control a Live2D model you would need to write some simple custom Fungus Script commands to wrap the setParamFloat(), etc. calls. These would be very similar to the animation commands we currently provide to control Mecanim animations. e.g. Fungus/Animation/Commands/SetAnimFloat.cs

I would create a new command (e.g. SetL2DParamFloat.cs) modelled on on SetAnimFloat.cs, and have it expose a Live2DModelUnity public variable instead of an Animator, and call Live2DModelUnity.setParamFloat() instead of Animator.SetFloat().

That should give you the ability to set Live2D parameters from Fungus. The process would be similar to expose other ways of controlling a Live2D model.

RonanPearce commented 8 years ago

(Comment from Noctis Fatehart) I hope something comes out of this, I would love this feature to be added or explained more!

RonanPearce commented 8 years ago

(Comment from Marcos Salvatierra) Awesome, rly looking forward to this feature Chris! I´m sure that a lot of non coder developers will be happy with it. thumbsup

FarmerJim70 commented 6 years ago

Just curious if this was ever implemented ? I'm looking to start a large project (putting pieces together now) and wanted to use Live2D with Fungus.