// Start is called before the first frame update
    void Start()
    {
        progress = GameObject.Find("Progress").GetComponent<ProgressScript>();

        if (progress.BeatLevelTwo)
        {
            MakeEmail("Mr. Bags", "Nice show last night! I think you have a few fans here now.");
        }

        if (progress.BeatLevelOne)
        {
            if (progress.LevelTwoLosses > 0)
            {
                MakeEmail("Mr. Agent", "You must have lost the few fans you got already!");
            }
            MakeEmail("Mr. Agent", "Looks like you're starting to get a following! I've got another show for you...", "Level 2");
            MakeEmail("Mr. Bags", "The show was better than last time, but not by much. It looks like one or two people may have actually liked it this time.");
        }

        if (progress.LevelOneLosses > 0)
        {
            MakeEmail("Mr. Agent", "That's no way to start a career! I knew this would happen...");
        }
        MakeEmail("Mr. Agent", "Hey Juke, I know you've had no luck making any fans, but how about a gig?", "Level 1");
        MakeEmail("Mr. Bags", "You're really bad at DJing! Please don't ask again...");

        GameObject.Find("PlayButton").SetActive(false);
        GameObject.Find("Scrollbar Vertical").GetComponent<Scrollbar>().value = 1.0f;
    }
Beispiel #2
0
 void Start()
 {
     mine_spawn_script = GameObject.Find("MineButton").GetComponent <mine_spawn>();
     Buttons           = GameObject.FindGameObjectsWithTag("Button");
     gameWrapper       = GameObject.Find("Game Wrapper");
     progress          = gameWrapper.GetComponent <ProgressScript>();
     multiplier        = gameWrapper.GetComponent <ClickMultiplier>();
 }
    public void LoadScene()
    {
        ProgressScript progress = GameObject.Find("Progress").GetComponent <ProgressScript>();

        progress.CurrentLevel = Level;

        gameObject.GetComponent <AudioSource>().Play();
        SceneManager.LoadScene("Level 1");
    }
Beispiel #4
0
    void Start()
    {
        audio = GetComponent <AudioSource>();

        health          = maxHealth;
        slider.maxValue = maxHealth;
        slider.value    = health;
        damageScript    = slider.GetComponentInChildren <DamageEffect>();
        progress        = GameObject.Find("Progress").GetComponent <ProgressScript>();
    }
Beispiel #5
0
    private void Start()
    {
        ProgressScript progress = GameObject.Find("Progress").GetComponent <ProgressScript>();

        if (!progress.FirstLoad)
        {
            GetComponent <CameraMove>().enabled = true;
            Destroy(gameObject.transform.GetChild(0));
        }
    }
 // Start is called before the first frame update
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Beispiel #7
0
    // Start is called before the first frame update
    void Start()
    {
        ProgressScript progress = GameObject.Find("Progress").GetComponent <ProgressScript>();

        if (progress.CurrentLevel == "Level 2")
        {
            bpm        = 118;
            audio.clip = levelTwoSong;
        }
        timePerAction = 60.0f / bpm;

        audio.Play();
        counter = 0;
    }
Beispiel #8
0
    // Start is called before the first frame update
    void Start()
    {
        ProgressScript progress = GameObject.Find("Progress").GetComponent <ProgressScript>();

        // Generate tile array
        Mesh mesh = tile.GetComponentsInChildren <MeshFilter>()[0].sharedMesh;

        grid         = new GameObject[gridSize, gridSize];
        halfGridSize = gridSize / 2;
        previousX    = halfGridSize;
        previousZ    = halfGridSize;
        for (int z = -halfGridSize; z <= halfGridSize; z++)
        {
            for (int x = -halfGridSize; x <= halfGridSize; x++)
            {
                grid[x + halfGridSize, z + halfGridSize] = Instantiate(tile, new Vector3(x * mesh.bounds.size.x, -mesh.bounds.size.y, z * mesh.bounds.size.z), Quaternion.identity);
            }
        }

        // Generate vertical enemies
        for (int x = -halfGridSize; x <= halfGridSize; x++)
        {
            GameObject topEnemy    = Instantiate(enemy, new Vector3(x * mesh.bounds.size.x, 0, (halfGridSize + enemyDistance) * mesh.bounds.size.z * 1.26f), Quaternion.identity);
            GameObject bottomEnemy = Instantiate(enemy, new Vector3(x * mesh.bounds.size.x, 0, (-halfGridSize - enemyDistance) * mesh.bounds.size.z * 1.26f), Quaternion.identity);
            bottomEnemy.transform.eulerAngles = new Vector3(180, 0, 0);
        }

        // Generate horizontal enemies
        if (progress.CurrentLevel == "Level 2")
        {
            for (int z = -halfGridSize; z <= halfGridSize; z++)
            {
                GameObject rightEnemy = Instantiate(enemy, new Vector3((halfGridSize + enemyDistance) * mesh.bounds.size.x, 0, z * mesh.bounds.size.z), Quaternion.identity);
                rightEnemy.transform.eulerAngles = new Vector3(0, 90, 0);
                GameObject leftEnemy = Instantiate(enemy, new Vector3((-halfGridSize - enemyDistance) * mesh.bounds.size.x, 0, z * mesh.bounds.size.z), Quaternion.identity);
                leftEnemy.transform.eulerAngles = new Vector3(0, -90, 0);
            }
        }

        GenerateTarget();

        // Send data
        gameObject.BroadcastMessage("SendHalfGridSize", halfGridSize);
    }
    public void init(PhotoAlbum para_albumData, Sprite[] para_photoCompletionIcons,ProgressScript c)
    {
        control = c;
        //Debug.Log("START ALBUM");

        contentsPageChild = transform.FindChild("PhotoAlbum_Contents");
        photoPageChild = transform.FindChild("PhotoAlbum_PhotoPage");

        Rect contentsAreaGUIBounds = WorldSpawnHelper.getWorldToGUIBounds(contentsPageChild.FindChild("ContentsScrollArea").renderer.bounds,new bool[]{false,true,false});
        templateContentsRow = new Rect(0,0,contentsAreaGUIBounds.width,contentsAreaGUIBounds.height / (3.5f));
        templateContentsRowText = new Rect(0,0,templateContentsRow.width * 0.75f,templateContentsRow.height);
        templateContentsRowImg = new Rect(templateContentsRow.width * 0.7f,templateContentsRow.height * 0.1f,templateContentsRow.width * 0.25f,templateContentsRow.height - (2 * (templateContentsRow.height * 0.1f)));

        album = para_albumData;
        availablePhotoPages = album.getAllAvailablePages();
        photoCompletionIcons = para_photoCompletionIcons;

        displayContentsView();
    }
Beispiel #10
0
    // Start is called before the first frame update
    void Start()
    {
        progressDisplay = this;
        iceDelivered    = new List <IceAttribute>();

        menu       = transform.parent.parent.GetComponent <MenuScript>();
        smoothMove = AnimationCurve.EaseInOut(0, 0, 1, 1);

        //Muss später in Awake eingestellt werden:
        goal_Bronze    = 3;
        goal_Silver    = 4;
        goal_Gold      = 5;
        progressPoints = 0;

        //Hole alle wichtigen elemente:
        Troph_Bronze = transform.GetChild(0).GetChild(0).GetComponent <Image>();
        Troph_Silver = transform.GetChild(0).GetChild(1).GetComponent <Image>();
        Troph_Gold   = transform.GetChild(0).GetChild(2).GetComponent <Image>();

        slider      = transform.GetChild(1).GetChild(0).GetChild(0).GetComponent <RectTransform>();
        bronzeLimit = transform.GetChild(1).GetChild(1).GetComponent <RectTransform>();
        silverLimit = transform.GetChild(1).GetChild(2).GetComponent <RectTransform>();
        x_max       = slider.rect.width;//silverLimit.anchoredPosition.x;

        //Baue auf:
        slider.sizeDelta            *= Vector2.up;
        slider.anchoredPosition      = Vector2.zero;
        bronzeLimit.anchoredPosition = Vector2.right * x_max * goal_Bronze / goal_Gold;
        silverLimit.anchoredPosition = Vector2.right * x_max * goal_Silver / goal_Gold;

        Color troph_color = new Color(1, 1, 1, 0.25f);

        Troph_Bronze.color = troph_color;
        Troph_Silver.color = troph_color;
        Troph_Gold.color   = troph_color;
    }
Beispiel #11
0
    public void init(ProgressScript c, GhostbookManagerLight gb)
    {
        unlockedCharacterFaces = new Transform[34] ;
        lockedCharacterFaces = new Transform[34] ;
        characterSmallFaces = new Transform[34] ;

        for(int i =0;i<34;i++){

            unlockedCharacterFaces[i] = ((GameObject)Resources.Load("Prefabs/Ghostbook/UnlockedProfilePics/UnlockedPortrait_"+i)).transform;
            //			unlockedCharacterFaces[i] = (Transform)Instantiate(Resources.Load("UnlockedPortrait_"+i));
            lockedCharacterFaces[i] = ((GameObject)Resources.Load("Prefabs/Ghostbook/LockedProfilePics/LockedPortrait_"+i)).transform;
            characterSmallFaces[i] = ((GameObject)Resources.Load("Prefabs/Ghostbook/SmallHeads/SmallHeads_"+i)).transform;

        }

        activitySymbols= new Transform[9];
        activitySymbols[0] = ((GameObject)Resources.Load("Prefabs/Ghostbook/ActivitySymbols/SmallSymbols_MAIL_SORTER")).transform;
        activitySymbols[1] = ((GameObject)Resources.Load("Prefabs/Ghostbook/ActivitySymbols/SmallSymbols_WHAK_A_MOLE")).transform;
        activitySymbols[2] = ((GameObject)Resources.Load("Prefabs/Ghostbook/ActivitySymbols/SmallSymbols_ENDLESS_RUNNER")).transform;
        activitySymbols[3] = ((GameObject)Resources.Load("Prefabs/Ghostbook/ActivitySymbols/SmallSymbols_HARVEST")).transform;
        activitySymbols[4] = ((GameObject)Resources.Load("Prefabs/Ghostbook/ActivitySymbols/SmallSymbols_SERENADE_HERO")).transform;
        activitySymbols[5] = ((GameObject)Resources.Load("Prefabs/Ghostbook/ActivitySymbols/SmallSymbols_MOVING_PATHWAYS")).transform;
        activitySymbols[6] = ((GameObject)Resources.Load("Prefabs/Ghostbook/ActivitySymbols/SmallSymbols_EYE_EXAM")).transform;
        activitySymbols[7] = ((GameObject)Resources.Load("Prefabs/Ghostbook/ActivitySymbols/SmallSymbols_TRAIN_DISPATCHER")).transform;
        activitySymbols[8] = ((GameObject)Resources.Load("Prefabs/Ghostbook/ActivitySymbols/SmallSymbols_DROP_CHOPS")).transform;

        photoPageCompletionStatusIcons = new Sprite[5] ;

        for(int i = 0;i<5;i++){
            photoPageCompletionStatusIcons[i] = Resources.Load<Sprite>("Prefabs/Ghostbook/PhotoIcon_V"+i);

        }

        maskShaderMaterial = (Material)Resources.Load("Prefabs/Ghostbook/ScrollMaskMat");
        maskShaderMaterialForText = (Material)Resources.Load("Prefabs/Ghostbook/ScrollMaskMatForText");

        ghostBookWordBoxPrefab = ((GameObject)Resources.Load("Prefabs/Ghostbook/GBookWordBox")).transform;

        textBannerNarrowPrefab = ((GameObject)Resources.Load("Prefabs/Ghostbook/TextBannerNarrow")).transform;
        //textBannerThickPrefab = ((GameObject)Resources.Load("Prefabs/Ghostbook/TextBannerThick")).transform;
        newsIconPrefab = ((GameObject)Resources.Load("Prefabs/Ghostbook/NewsBanner")).transform;

        this.loadTextures();
        this.prepUIBounds();

        //customTRSMat = Matrix4x4.TRS(Vector3.zero,Quaternion.identity,new Vector3(Screen.width/virtualWidth,Screen.height/virtualHeight,1.0f));

        this.gbMang = gb;
        this.control = c;

        //albumCollectionScrollPos = new Vector2();

        //smallFacesNormTexBounds = extractNormTexBoundsForMultisprites(characterSmallFaces);
        //activitySymbolsNormTexBounds = extractNormTexBoundsForMultisprites(activitySymbols);

        //constructTabbedGhostbook();
        //loadContactGridPage();
        //ghostbookGObj.SetActive(false);

        setupReady = true;
        //this.enabled = false;
    }
Beispiel #12
0
 void Start()
 {
     audio    = GetComponent <AudioSource>();
     progress = GameObject.Find("Progress").GetComponent <ProgressScript>();
 }
Beispiel #13
0
    void Start()
    {
        float iconifiedBounds_Width = Screen.width * 0.15f;
        float iconifiedBounds_Height = Screen.height * 0.15f;
        if(iconifiedBounds_Width > iconifiedBounds_Height) { iconifiedBounds_Width = iconifiedBounds_Height; }
        else { iconifiedBounds_Height = iconifiedBounds_Width; }
        float iconifiedBounds_X = Screen.width - iconifiedBounds_Width;
        float iconifiedBounds_Y = Screen.height - iconifiedBounds_Height;

        clickableArea = new Rect(iconifiedBounds_X,iconifiedBounds_Y,iconifiedBounds_Width,iconifiedBounds_Height);

        walkers = new GameObject[LocalisationMang.getNPCnames().Count];
        visibleWalkers = new List<int>();

        isPaused = false;
        currPlayerDestCell = new int[2] {-1,-1};
        playerNavigationFlag = true;

        dialogEventRequired = false;
        dialogTargetCharID = -1;

        // Disable any debug scene related things.
        makeAllClickablesTransparent();

        // Apply Clothing Config to Main Avatar.
        applyPlayerAvatarClothing();
        clonePlayerAv();

        // Calculate World Bounds.
        gPropMapWorldBounds = calculateWorldMapBounds(mapSize);
        WorldSpawnHelper.initObjWithinWorldBounds(blankCollisionBox,
                                                  blankCollisionBox.transform.renderer.bounds.size.x,
                                                  blankCollisionBox.transform.renderer.bounds.size.y,
                                                  "WorldColBox",
                                                  new Rect(gPropMapWorldBounds.x,gPropMapWorldBounds.y,gPropMapWorldBounds.totalWidth,gPropMapWorldBounds.totalHeight),
                                                  null,
                                                  gPropMapWorldBounds.z,
                                                  upAxisArr);

        // Remove Scroll Cam and use Follow Cam.
        Destroy(GameObject.Find("GlobObj").GetComponent(typeof(ScrollCam)));
        FollowScript followScrpt = Camera.main.transform.gameObject.AddComponent<FollowScript>();
        followScrpt.init(GameObject.Find("MainAvatar"),new bool[3] { true, true, false });

        // Init Nav Graph.
        string bnwMapFilePath = "Textures/WorldView/WorldView_B&W";
        ImgToWorldNavGraphBuilderV2 navBuilder = new ImgToWorldNavGraphBuilderV2(bnwMapFilePath,gPropMapWorldBounds);
        List<ColorGraphTypeInfo> graphRequirements = new List<ColorGraphTypeInfo>()
        {
            new ColorGraphTypeInfo(new string[] { "FreeSpace", "MainCharacterSpawns" },
            new Color[] { Color.white, Color.red })
        };
        List<ColoredNavGraph> graphList = navBuilder.constructColorGraphs(graphRequirements);
        worldNavGraph = graphList[0];

        List<System.Object> paramList = new List<System.Object>();
        paramList.Add(worldNavGraph);
        paramList.Add(gPropMapWorldBounds);
        terrainHandle = new BasicTerrainHandler();
        terrainHandle.constructTerrainStructures(paramList);

        Animator mainPlayerAvatarAni = GameObject.Find("MainAvatar").GetComponent<Animator>();
        //mainPlayerAvatarAni.Play("MainAvatar_walkDown");
        mainPlayerAvatarAni.speed = 0;

        SoundPlayerScript sps = transform.GetComponent<SoundPlayerScript>();
        //sps.triggerSoundLoopAtCamera("WindAmbient","WorldAmbientBox",0.3f,true);
        ambientSound = sps.triggerSoundLoopAtCamera("Serenade Band Tracks/Serenade_Bass_01.00","WorldAmbientBox",0.3f,true);

        // Init input detectors.
        inputDetectors = new List<AbsInputDetector>();
        ClickDetector cd = transform.gameObject.AddComponent<ClickDetector>();
        cd.registerListener("WorldScript",this);
        cd.setMaxDelayBetweenClicks(0.0001f);
        inputDetectors.Add(cd);

        // Persistent Obj Check.

        int index = 0;

        //Hide all recognised characters and destroy extra ones
        foreach(string para_namePrefix in new string[]{"AvatarChar-","SecChar-"}){

            int counter = 0;
            bool foundItem = true;
            while(foundItem)
            {
                GameObject tmpObj = GameObject.Find(para_namePrefix+""+counter);
                counter++;
                if(tmpObj == null)
                {
                    foundItem = false;
                }
                else
                {
                    if(index >= walkers.Length){
                        Destroy(tmpObj);

                    }else{
                        rootItemToMapGrid(tmpObj);
                        walkers[index++] = tmpObj;
                        List<SpriteRenderer> sRends = CommonUnityUtils.getSpriteRendsOfChildrenRecursively(tmpObj);
                        if(sRends != null)
                        {
                            for(int i=0; i<sRends.Count; i++)
                            {
                                sRends[i].enabled = false;
                            }
                        }
                        tmpObj.collider.enabled = false;
                    //tmpObj.SetActive(false);
                    }
                }

            }
        }

        isStillPerformingUnlockSequence = false;

        GameObject poRef = PersistentObjMang.getInstance();
        control = poRef.GetComponent<ProgressScript>();
        if(control == null)
        {
            control = poRef.AddComponent<ProgressScript>();
        }/*else{
            Debug.Log("Enable progress script");
            control.enabled = true;
        }*/

        Debug.LogWarning("Position of avatar not initialised");
        //placeExistingItemInCell("MainAvatar",int[]{});//NEW
        control.attemptActivityDebrief(this);

        // Switch player controls off until the intro effect is over.
        togglePlayerInputState(false);
        setupReady = false;

        Debug.Log("Fading removed");

        respondToEvent("", "FadeEffectDone", null);
    }
Beispiel #14
0
    private void spawnAsteroid()
    {
        int        chooseType = random.Next(1, 11);
        int        randomNumber;
        GameObject ast;

        if (chooseType == 1)
        {
            ast          = Instantiate(threeHitAsteroidPrefab) as GameObject;
            minimumScale = 0.06f;
            maximumScale = 0.1f;
        }
        else if (chooseType == 2 || chooseType == 3)
        {
            ast          = Instantiate(wavyAsteroidPrefab) as GameObject;
            minimumScale = 0.01f;
            maximumScale = 0.03f;
        }
        else if (chooseType == 4)
        {
            ast          = Instantiate(largeAsteroidPrefab) as GameObject;
            minimumScale = 0.06f;
            maximumScale = 0.07f;
        }
        else
        {
            minimumScale = 0.03f;
            maximumScale = 0.07f;
            randomNumber = random.Next(0, 5);
            asteroidPrefab.GetComponent <SpriteRenderer>().sprite = spriteList[randomNumber];
            ast = Instantiate(asteroidPrefab) as GameObject;
        }


        Vector2 spawn = new Vector2(0, 0);

        ast.transform.parent = Asteroids.transform;
        asteroid_float astScript = ast.GetComponent <asteroid_float>();
        ProgressScript prog      = gameObject.GetComponent <ProgressScript>(); //Gets the game score from progress script

        //TODO: this area will most likely simplify upon a major revamp, getting components together
        //such as spawn_asteroids shouldn't be in camera, but in Game Wrapper - This can happen later
        if (chooseType == 2 || chooseType == 3)
        {
            //astScript.wavy = true;
            // debugging
        }
        if (oldScore + 20 < prog.secondsPassed)
        {
            oldScore       = prog.secondsPassed;
            level         += 1;
            asteroidSpeed += 0.35f * level;
            rate           = rate / level;
            print("Level: " + level);
        }

        randomNumber = random.Next(1, 5);
        if (randomNumber == 1)
        {
            spawn = new Vector2(screenBounds.x * 2, UnityEngine.Random.Range(-screenBounds.y, screenBounds.y));
        }
        else if (randomNumber == 2)
        {
            spawn = new Vector2(-screenBounds.x * 2, UnityEngine.Random.Range(-screenBounds.y, screenBounds.y));
        }
        else if (randomNumber == 3)
        {
            spawn = new Vector2(UnityEngine.Random.Range(-screenBounds.x, screenBounds.x), screenBounds.y * 2);
        }
        else if (randomNumber == 4)
        {
            spawn = new Vector2(UnityEngine.Random.Range(-screenBounds.x, screenBounds.x), -screenBounds.y * 2);
        }
        astScript.speed        = asteroidSpeed;
        ast.transform.position = spawn;
        float size = UnityEngine.Random.Range(minimumScale, maximumScale);

        ast.transform.localScale += new Vector3(size, size);
    }