Exemplo n.º 1
0
 /// <summary>
 /// 启用飘字结点
 /// </summary>
 /// <param name="ins"></param>
 public static void EnableFloatNode(FloatFontNode ins)
 {
     ActiviteList.AddLast(ins);
     UnActiviteList.Remove(ins);
     ins.SetEnable(true);
     ins.OnEnabled();
 }
Exemplo n.º 2
0
 /// <summary>
 /// 禁用飘字结点
 /// </summary>
 /// <param name="ins"></param>
 public static void DisableFloatNode(FloatFontNode ins)
 {
     WillRemoveActiviteList.AddLast(ins);
     UnActiviteList.AddLast(ins);
     ins.SetEnable(false);
     ins.OnDisabled();
 }
Exemplo n.º 3
0
    static FloatFontNode CreateNewNode(GameObject entry)
    {
        FloatFontNode temp = null;

        Value ins = new Value();

        if (!FloatFontMovie.Instance.AttachMovie(ref ins, FloatFontAS3RefrenceName, FloatFontAS3RefrenceName + index, -1))
        {
            ins = null;
            return(temp);
        }
        index++;
        temp = new FloatFontNode(entry, ins);
        return(temp);
    }
Exemplo n.º 4
0
 /// <summary>
 /// 摧毁指定的组件
 /// </summary>
 /// <param name="instance">需要清除的Blood</param>
 public static void Destroy(FloatFontNode instance)
 {
     if (Movie.GetSingleton <FloatFontMovie>() == null)
     {
         return;
     }
     if (null == instance)
     {
         return;
     }
     if (FloatFontMovie.Instance != null)
     {
         FloatFontMovie.Instance.RemoveMovieAS3(instance.Instance);
     }
     instance.Clear();
     instance = null;
 }
Exemplo n.º 5
0
    /// <summary>
    /// 创建一个飘字,成功返回实例,失败返回null
    /// </summary>
    /// <param name="entry">实体</param>
    /// <param name="text">飘字的内容,目前只能是数字,像暴击、躲闪之类的尚未实现</param>
    /// <param name="type">飘字的类型</param>
    /// <param name="followEntity">跟随实体</param>
    /// <returns></returns>
    public static FloatFontNode CreateFloatFont(GameObject entry, string text, FloatFontType type = FloatFontType.TYPE_ENEMY_DAMGE, bool followEntity = false)
    {
        FloatFontNode tempNode = null;

        if (!bInit)
        {
            Trace.LogError("FloatFontManager必须初始化!");
            return(tempNode);
        }

        if (SFGFxMovieManager.Instance == null)
        {
            Trace.LogError("SFGFxMovieManager没有初始化,请不要在Awake中创建!");
            return(tempNode);
        }
        //有可能FloatFontMovie还没有创建完成.
        if (Movie.GetSingleton <FloatFontMovie>() == null)
        {
            //Trace.LogError("FloatFontMovie尚未创建完成,请等待创建完成后再调用,请不要在Awake或者Start中创建");
            return(tempNode);
        }
        //有可能FloatFontMovie还没有创建完成.
        if (FloatFontMovie.Instance == null)
        {
            //Trace.LogError("FloatFontMovie尚未创建完成,请等待创建完成后再调用,请不要在Awake或者Start中创建");
            return(tempNode);
        }

        if (!NeedToCreate(entry))
        {
            return(null);
        }

        if (UnActiviteList.Count > 0)
        {
            tempNode = UnActiviteList.First.Value;
            UnActiviteList.RemoveFirst();
            EnableFloatNode(tempNode);

            tempNode.ChangeHostEntity(entry);
            tempNode.ChangeType(type);
            tempNode.SetText(text);
            tempNode.UpdatePos();
        }
        else
        {
            tempNode = CreateNewNode(entry);
            if (null == tempNode)
            {
                return(null);
            }

            tempNode.ChangeType(type);
            tempNode.SetText(text);
            tempNode.UpdatePos();
            tempNode.SetEnable(true);

            ActiviteList.AddLast(tempNode);
        }
        tempNode.bFollowEntity = followEntity;
        return(tempNode);
    }