protected override void showContextMenu(Behaviour behaviour)
    {
        CinemaShot shot = behaviour as CinemaShot;

        if (shot == null)
        {
            return;
        }

        Camera[] cameras = GameObject.FindObjectsOfType <Camera>();

        GenericMenu createMenu = new GenericMenu();

        createMenu.AddItem(new GUIContent("Focus"), false, focusShot, shot);
        foreach (Camera c in cameras)
        {
            ContextSetCamera arg = new ContextSetCamera();
            arg.shot   = shot;
            arg.camera = c;
            createMenu.AddItem(new GUIContent(string.Format(MODIFY_CAMERA, c.gameObject.name)), false, setCamera, arg);
        }
        createMenu.AddSeparator(string.Empty);
        createMenu.AddItem(new GUIContent("Copy"), false, copyItem, behaviour);
        createMenu.AddSeparator(string.Empty);
        createMenu.AddItem(new GUIContent("Clear"), false, deleteItem, shot);
        createMenu.ShowAsContext();
    }
Beispiel #2
0
    protected override void showContextMenu(Behaviour behaviour)
    {
        CinemaShot shot = behaviour as CinemaShot;

        if (shot == null)
        {
            return;
        }

        Camera[] cameras = GameObject.FindObjectsOfType <Camera>();

        GenericMenu createMenu = new GenericMenu();

        createMenu.AddItem(new GUIContent("Focus"), false, focusShot, shot);
        {
            var __array1       = cameras;
            var __arrayLength1 = __array1.Length;
            for (int __i1 = 0; __i1 < __arrayLength1; ++__i1)
            {
                var c = (Camera)__array1[__i1];
                {
                    ContextSetCamera arg = new ContextSetCamera();
                    arg.shot   = shot;
                    arg.camera = c;
                    createMenu.AddItem(new GUIContent(string.Format(MODIFY_CAMERA, c.gameObject.name)), false, setCamera, arg);
                }
            }
        }
        createMenu.AddSeparator(string.Empty);
        createMenu.AddItem(new GUIContent("Copy"), false, copyItem, behaviour);
        createMenu.AddSeparator(string.Empty);
        createMenu.AddItem(new GUIContent("Clear"), false, deleteItem, shot);
        createMenu.ShowAsContext();
    }
    private void setCamera(object userData)
    {
        ContextSetCamera arg = userData as ContextSetCamera;

        if (arg != null)
        {
            Undo.RecordObject(arg.shot, "Set Camera");
            arg.shot.shotCamera = arg.camera;
        }
    }
Beispiel #4
0
    protected override void showContextMenu(Behaviour behaviour)
    {
        CinemaShot shot = behaviour as CinemaShot;

        if (shot == null)
        {
            return;
        }

        Camera[] cameras = Object.FindObjectsOfType <Camera>();

        GenericMenu createMenu = new GenericMenu();

        createMenu.AddItem(new GUIContent("Rename"), false, renameItem, behaviour);
        createMenu.AddItem(new GUIContent("Copy"), false, copyItem, behaviour);
        createMenu.AddItem(new GUIContent("Delete"), false, deleteItem, shot);
        createMenu.AddSeparator(string.Empty);
        createMenu.AddItem(new GUIContent("Focus"), false, focusShot, shot);
        foreach (Camera c in cameras)
        {
            ContextSetCamera arg = new ContextSetCamera
            {
                shot   = shot,
                camera = c
            };
            createMenu.AddItem(new GUIContent(string.Format(MODIFY_CAMERA, c.gameObject.name)), false, setCamera, arg);
        }
        Cutscene.ForeachDir(CinemaShot.animDir, path =>
        {
            ContextSetAnimationClip arg = new ContextSetAnimationClip
            {
                shot     = shot,
                clipName = path
            };
            createMenu.AddItem(new GUIContent(string.Format(MODIFY_ANIMATION, path)), false, setAnimationClip, arg);
        });
        createMenu.ShowAsContext();
    }
    protected override void showContextMenu(Behaviour behaviour)
    {
        CinemaShot shot = behaviour as CinemaShot;
        if (shot == null) return;

        Camera[] cameras = GameObject.FindObjectsOfType<Camera>();
        
        GenericMenu createMenu = new GenericMenu();
        createMenu.AddItem(new GUIContent("Focus"), false, focusShot, shot);
        foreach (Camera c in cameras)
        {
            
            ContextSetCamera arg = new ContextSetCamera();
            arg.shot = shot;
            arg.camera = c;
            createMenu.AddItem(new GUIContent(string.Format(MODIFY_CAMERA, c.gameObject.name)), false, setCamera, arg);
        }
        createMenu.AddSeparator(string.Empty);
        createMenu.AddItem(new GUIContent("Copy"), false, copyItem, behaviour);
        createMenu.AddSeparator(string.Empty);
        createMenu.AddItem(new GUIContent("Clear"), false, deleteItem, shot);
        createMenu.ShowAsContext();
    }