示例#1
0
    void OnSelectionChange()
    {
        //TODO List
        isShowFindParticles = false;
        if (Selection.objects.Length > 0)
        {
            object selected = Selection.objects[0];

            if (selected == null)
            {
                return;
            }

            if (selected.GetType() == typeof(Texture2D))
            {
                selectedTexture = selected as Texture2D;
                string path = AssetDatabase.GetAssetPath(selectedTexture.GetInstanceID());
                string file = path.Replace(".psd", ".png");
                replaceTexture = AssetDatabase.LoadAssetAtPath(file, typeof(Texture2D)) as Texture2D;
            }
            else if (selected.GetType() == typeof(GameObject))
            {
                GameObject selectedGO = (GameObject)selected;
                ComponentToParticle(XSelectionExtension.GetAllChildComponents(selectedGO.transform, typeof(ParticleSystem)));
                if (particles.Length > 0)
                {
                    isShowFindParticles = true;
                }
//				selectedTexture = (Texture2D)particle.renderer.material.mainTexture;
            }
        }
        Repaint();
    }
示例#2
0
    void OnSelectionChange()
    {
        transAll = null;
        //TODO List
        XSelectionExtension.Clear();
        if (Selection.transforms.Length > 0)
        {
            transAll = XSelectionExtension.GetAllChild(Selection.transforms[0]);

            _transAnimator  = Selection.transforms[0].GetComponent <Animator>();
            _transAnimation = Selection.transforms[0].GetComponent <Animation>();
        }
        Repaint();
    }