//Modify by liteng for MoveAtlas At 2014/1/4
 public void OnAfterCmdExecute(IEditorCommand cmd, int removeCmdCount)
 {
     if (!HasEditTarget())
     {
         return;
     }
     SpecialEffectEditorUtility.MarkSpecialEffectDirty(GetEditTarget().RealSpe);
 }
Пример #2
0
    //在每次选中GameObject时被调用
    void OnEnable()
    {
        SpecialEffect spe = target as SpecialEffect;

        //刷新子元素,并自动挂接脚本
        SpecialEffectEditorUtility.RefreshSpecialEffect(spe.gameObject);

        _UpdateSerializedObjects();

        SpecialEffectEditorUtility.MarkSpecialEffectDirty(spe);
    }
    public void Destroy()
    {
        if (!editTarget)
        {//若为非编辑特效直接删除
            //直接销毁prefab生成的编辑用实例特效
            if (realSpe != null)
            {
                GameObject.DestroyImmediate(realSpe.gameObject);
            }
            return;
        }

        if (targetSpeOldParent == null)
        {
            ForceBindTarget(null);
        }
        else
        {
            ForceBindTarget(targetSpeOldParent.gameObject);
        }

        realSpe.Stop();
        realSpe.CanShow = true;
        SpecialEffectEditorUtility.EnableSpecialEffect(realSpe);
        SpecialEffectEditorUtility.MarkSpecialEffectDirty(realSpe);

        //若此特效来自Prefab
        if (realSpePrefab != null)
        {
            if (IsDirty)
            {
                if (EditorUtility.DisplayDialog("警告!", "此特效为Prefab,编辑过程中有变动,是否保存至Prefab?", "是", "否"))
                {
                    //保存编辑结果至Prefab文件
                    SpecialEffectEditorUtility.ReplacePrefab(realSpe.gameObject, realSpePrefab);
                }
            }

            //直接销毁prefab生成的编辑用实例特效
            GameObject.DestroyImmediate(realSpe.gameObject);
        }

        targetSpeOldParent = null;
        realSpe            = null;
        realSpePrefab      = null;
    }
Пример #4
0
    private void _MarkSpecialEffectDirty()
    {
        SpecialEffect currSpe = target as SpecialEffect;

        SpecialEffectEditorUtility.MarkSpecialEffectDirty(currSpe);
    }