Example #1
0
    public bool doSkill(FBActor actor, int id)
    {
        if (actor != null)
        {
        }
        NodeMapInfo map;

        if (!m_skills.TryGetValue(id, out map))
        {
            string[] skills = new string[] { "test" };
            //临时
            UnityEngine.TextAsset  ta = UnityEngine.Resources.Load <UnityEngine.TextAsset>("Skill/" + skills[id]);
            System.IO.MemoryStream ms = new System.IO.MemoryStream(ta.bytes);
            System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
            map = (NodeMapInfo)formatter.Deserialize(ms);

            m_skills.Add(id, map);
        }

        SkillContext context = createNewSkillContext(actor, map);

        context.startup();
        if (context.activedObjectCount != 0)
        {
            skillContexts.AddLast(context.updater);
        }

        return(true);
    }