Example #1
0
        public void Init(DialogReceiverInterface e, string cutsceneFilePath)
        {
            cutscenePath = cutsceneFilePath;
            clearImg     = (Texture2D)Resources.Load("EAdventureData/img/icons/deleteContent", typeof(Texture2D));
            addTexture   = (Texture2D)Resources.Load("EAdventureData/img/icons/addNode", typeof(Texture2D));
            moveLeft     = (Texture2D)Resources.Load("EAdventureData/img/icons/moveNodeLeft", typeof(Texture2D));
            moveRight    = (Texture2D)Resources.Load("EAdventureData/img/icons/moveNodeRight", typeof(Texture2D));
            duplicateImg = (Texture2D)Resources.Load("EAdventureData/img/icons/duplicateNode", typeof(Texture2D));

            animInfoRect        = new Rect(0f, 0.05f * windowHeight, windowWidth, 0.15f * windowHeight);
            timelineRect        = new Rect(0f, 0.25f * windowHeight, windowWidth, 0.3f * windowHeight);
            timelineButtonsRect = new Rect(0f, 0.50f * windowHeight, windowWidth, 0.1f * windowHeight);
            frameInfoRect       = new Rect(0f, 0.65f * windowHeight, windowWidth, 0.25f * windowHeight);
            buttonRect          = new Rect(0f, 0.9f * windowHeight, windowWidth, 0.1f * windowHeight);

            noBackgroundSkin  = (GUISkin)Resources.Load("Editor/EditorNoBackgroundSkin", typeof(GUISkin));
            selectedFrameSkin = (GUISkin)Resources.Load("Editor/EditorLeftMenuItemSkinConcreteOptions", typeof(GUISkin));

            //transitionTypes = new string []{ "None" , "Fade in", "Horizontal", "Vertical"};
            Debug.Log(cutsceneFilePath);

            workingAnimation = Loader.loadAnimation(AssetsController.InputStreamCreatorEditor.getInputStreamCreator(),
                                                    cutsceneFilePath, new EditorImageLoader());

            Debug.Log(workingAnimation.getAboslutePath() + " " + workingAnimation.getFrames().Count + " " + workingAnimation.isSlides() + " " + workingAnimation.getId());
            if (workingAnimation == null)
            {
                workingAnimation = new Animation(cutsceneFilePath, 40, new EditorImageLoader());
            }

            // Initalize
            selectedFrame            = 0;
            documentationTextContent = workingAnimation.getFrames()[selectedFrame].getDocumentation();
            imagePath = workingAnimation.getFrames()[selectedFrame].getUri();
            soundPath = workingAnimation.getFrames()[selectedFrame].getSoundUri();
            animationDurationString          =
                animationDurationStringLast  = workingAnimation.getFrames()[selectedFrame].getTime().ToString();
            transitionDurationString         =
                transitionDurationStringLast = workingAnimation.getTransitions()[selectedFrame + 1].getTime().ToString();
            useTransitonFlag    = useTransitonFlagLast = workingAnimation.isUseTransitions();
            slidesAnimationFlag = slidesAnimationFlagLast = workingAnimation.isSlides();

            base.Init(e);
        }