Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        ic      = FindObjectOfType <inputControls>();
        guiScpt = FindObjectOfType <GUIscripts>();

        method = 0;     //Search method is using Application.DataPath
#if UNITY_ANDROID || UNITY_IOS || UNITY_WP8 || UNITY_IPHONE
        method = 1;
#endif
        numScores    = 0;
        currentScore = 0;
        maxScores    = 10;
        boomBox      = GameObject.Find("BoomBox");
        audioSource  = FindObjectOfType <AudioSource>(); // Get the Audio source object from the scene

        scoreLoader = FindObjectOfType <FileLoader>();   // Find an imageloader script
        string cPath;
        // If the user specified a custom folder path for the images, check to see if there are music files there
        if ((cPath = FindObjectOfType <pathBasedLoader>().path) != null)
        {
            fileInfos = scoreLoader.getDirInfo(method, "MusicFolder", cPath);
            createScoreObjects();
        }
        // If there were no valid music files in the custom path, or if a custom path was not specified
        if (musicObjects.Count == 0)
        {
            fileInfos = scoreLoader.getDirInfo(method, "MusicFolder");   // Get the music directory info, using method
        }
        createScoreObjects();
        // Image manager now loads music as well
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        rb = GetComponent <Rigidbody>();
        ic = FindObjectOfType <inputControls>();
        initialFocalLength = Camera.main.focalLength;
        magModRoutine      = motionPauseRoutine();

        // Removed startosc from start as ImageManager will call this
    }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        carTx            = gameObject.transform;
        rotSpeed         = 0;
        initSpeed        = 0;
        finalSpeed       = 10;
        maxRotSpeed      = 40;
        rotSpeedRampRate = 10;
        ic = FindObjectOfType <inputControls>();

        //initiateInitialRotation(); ImageManager will start carousel oscillation after loading images
    }
Exemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        // Initialize y base, y diff and thetaDiff to 0
        yBase            = 0;
        yDiff            = 0;
        thetaDiff        = 0;
        numRowsPopulated = 0;
        method           = 0; // Default Search method is using Application.DataPath
#if UNITY_ANDROID || UNITY_IOS || UNITY_WP8 || UNITY_IPHONE
        method = 1;           // Search method is using Application.persistentDataPath if on mobile
#endif
        numImages = 0;
        maxImages = 32;
        // Default display type is cylinder. This is overridden by the default in FolderSelectionManager
        loadType = 1;   // 0 - Spiral, 1 - cylinder
        // Get the base prefab gameobject from the resources folder
        imgFrameObject  = Resources.Load <GameObject>("Prefabs/ImageSpriteTemplate");
        arenaUnitObject = Resources.Load <GameObject>("Prefabs/BaseArenaUnit");
        imgLoader       = FindObjectOfType <FileLoader>();
        guiscpt         = FindObjectOfType <GUIscripts>();
        ic        = FindObjectOfType <inputControls>();
        cControls = FindObjectOfType <CameraControls>();

        // Check if we have a folderHolder. If yes, use the file information that it provides
        // to load images
        GameObject folderHolder;
        if ((folderHolder = GameObject.Find("folderHolder")) != null)
        {
            FolderSelectionManager fm = folderHolder.GetComponent <FolderSelectionManager>();
            fileInfos = fm.selectedFiles;
            loadType  = fm.loadType;
            unleashed = fm.isUnleashed;
            fm.farewell();
        }
        else
        {
            // Otherwise use the imageloader script to get files
            fileInfos = imgLoader.getDirInfo(method, "ImageFolder");    // Get the image directory info, using method
        }
        // Initial code calls placeImageFrames and cControls adjustement in sequence

        /*placeImageFrames();
         * cControls.adjustOsc(8, numRowsPopulated);*/
        // New code calls the same functions, along with calls to other scripts to initiate them once done, in a coroutine
        StartCoroutine(imagePlacementRoutine());
    }
Exemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        // Find the floating menus (quit, volume and more to come) and assign them
        quitMenuGO    = GameObject.Find("QuitMenu");
        quitMenu      = new floatingMenu(quitMenuGO);
        volumeMenuGO  = GameObject.Find("VolumeMenu");
        volumeMenu    = new floatingMenu(volumeMenuGO);
        creditsMenuGO = GameObject.Find("CreditsMenu");
        creditsMenu   = new floatingMenu(creditsMenuGO);

        // Create a sideMenu object
        sideMenuObj = new sideMenu();

        // Get the user display text objects
        userInfoPanel        = GameObject.Find("userTextBackPanel");
        userInfoText         = userInfoPanel.GetComponentInChildren <Text>();
        panelScale           = userInfoPanel.transform.localScale;
        userInfoText.enabled = false;   //Disable them
        userInfoPanel.SetActive(false);

        // Close up image setup
        closeUpImg = GameObject.Find("CloseUpImg");
        if (closeUpImg != null)
        {
            closeUpImgBotLeftBound  = GameObject.Find("bot_left_Bound").transform.position;
            closeUpImgTopRightBound = GameObject.Find("top_right_Bound").transform.position;
            initImagePos            = closeUpImg.transform.localPosition;
            initScale        = closeUpImg.transform.localScale;
            initRot          = closeUpImg.transform.eulerAngles;
            closeUpImgCanvas = GameObject.Find("CloseUpImg_Canvas");
            closeUpImgCanvas.SetActive(imageCloseUpActive = false);
            persistentScaleEnabled = true;
            persistentScale        = 1f;
        }
        closeUpImgIndex = 0;

        ic = GetComponent <inputControls>();
        startSetupComplete = true;

        UI_canvas = GameObject.Find("UI_Canvas");
        //movementControls = GameObject.Find("movementControls");
        //movementControls.SetActive(false);
    }
Exemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     ic = FindObjectOfType <inputControls>();
     isLightMaterial = true;
 }