コード例 #1
0
    /// <summary>
    /// 添加特效到服务器
    /// </summary>
    /// <returns>The world effect.</returns>
    /// <param name="effectid">Effectid.</param>
    /// <param name="pos">Position.</param>
    GameEffect AddEffect(int effectid, GameObject obj, Vector3 pos, float scale)
    {
        if (obj == null)
        {
            return(AddWorldEffect(effectid, pos, scale));
        }
        GameEffect ge = GetEffect(effectid, obj.transform.position + pos);

        if (ge == null)
        {
            return(null);
        }
        ge.SetParent(obj);
        ge.Play(scale);
        return(ge);
    }
コード例 #2
0
    /// <summary>
    /// Adds effects and sets a parent object that it will follow.
    /// </summary>
    /// <param name="effectName"> The name of this effect</param>
    /// <param name="obj"></param>
    /// <param name="pos"></param>
    /// <param name="scale"></param>
    /// <param name="time"></param>
    /// <returns></returns>
    public GameEffect AddEffect(string effectName, GameObject obj, Vector3 pos, float scale, float time)
    {
        if (obj == null)
        {
            AddWorldEffect(effectName, pos, scale, time);
        }

        GameEffect ge = GetEffect(effectName);

        if (ge == null)
        {
            return(null);
        }

        ge.SetParent(obj);
        ge.Play(scale, time);
        return(ge);
    }