Hi I wonder why it failed, I’m simply calling the player through a js function, but not working, there are requirements or anything special to prevent this from happening.
Someone told me it was because I was trying to call an object that was already the son of a son of a son, and put it in the root of the inheritance, but does not work, js function works even before making the SendMessage, please help thanks .
JAVASCRIPT //
// get unity
function getUniytPlayer()
{
var unity = unityObject.getObjectById("unityPlayer");
return unity;
}
//send msg to the browser
function test(str)
{
alert(str);
}
// data from flash
function sendSkillsInfo(maxSkills,skillsSlots)
{
var slots = new Array();
var slotsData = String(skillsSlots);
slots = slotsData.split('-');
alert(maxSkills + " : " + skillsSlots); // 1 : image.jpg
the script does not work here
getUniytPlayer().SendMessage("GameManager","assignskills");
alert("Work it");
}
// C#
using UnityEngine;
using System.Collections;
public class SkillsManager : MonoBehaviour {
// Use this for initialization
public void assignskills()
{
Debug.Log("*********");
Application.ExternalCall("test","Unity !!!!");
}
}