Hi, everyone, I've encounterd a problem and cannot find the solution in this forum, so I post this thread to request some helps.
I am developing a network game, and I need to load different template files to specify my character behaviours. the key point is that the choosing of the right template which is decided by server side. For example, the server told client that it need to place a enemy on the scene, and the enyme will attack player automatically, so I will attach a PlayMakerFSM component to the character gameObject and invoke SetTemplate(FsmTemplate template) method of the PlayMakerFSM component. The FsmTemplate is loaded from a prepared playmaker template file names "AutoAttack.asset" . Below is my code:
string templateFileName = getBehaviourFromServer(); //the template file name is got from server at runtime.
PlayMakerFSM fsmComponent = gameObject.addComponent<PlayMakerFSM>();
FsmTemplate template = LoadTemplateFromFile(templateFileName);
fsmComponent.SetTemplate(template);
So my question is that how can I implement LoadTemplateFromFile method, is there any API I can use?