Exemple #1
0
    /// <summary>
    /// 复活特效加载完毕后的回调
    /// </summary>
    /// <param name="effect_object"></param>
    /// <param name="parent_trans"></param>
    /// <param name="bind_node"></param>
    bool OnEffectResLoad(GameObject effect_object, string bind_node)
    {
        if (mIsDestroy || this.transform == null)
        {
            return(false);
        }

        Transform parent_trans = transform;
        Transform effect_trans = effect_object.transform;

        if (string.IsNullOrEmpty(bind_node))
        {
            effect_trans.parent = parent_trans;
        }
        else
        {
            Transform link_node = CommonTool.FindChildInHierarchy(parent_trans, bind_node);
            if (link_node != null)
            {
                effect_trans.parent = link_node;
            }
            else
            {
                effect_trans.parent = parent_trans;
            }
        }

        effect_trans.localPosition = new Vector3(0, 0.1f, 0);
        effect_trans.localRotation = Quaternion.identity;
        effect_object.SetActive(true);

        return(true);
    }