Exemplo n.º 1
0
    void Start()
    {
        //vol = 0.0f; // volume from start

        timerBarLength = 170;

        maxTime = 20;
        if (ChangeableVariables.levelWeAreIn == "3x3_1" || ChangeableVariables.levelWeAreIn == "3x3_2" || ChangeableVariables.levelWeAreIn == "3x3_3")
        {
            maxTime = 30;
        }
        else if (ChangeableVariables.levelWeAreIn == "4x4_1" || ChangeableVariables.levelWeAreIn == "4x4_2" || ChangeableVariables.levelWeAreIn == "4x4_3")
        {
            maxTime = 20;
        }
        else if (ChangeableVariables.levelWeAreIn == "5x5_1" || ChangeableVariables.levelWeAreIn == "5x5_2" || ChangeableVariables.levelWeAreIn == "5x5_3")
        {
            maxTime = 20;
        }
        else if (ChangeableVariables.levelWeAreIn == "3x3_Free" || ChangeableVariables.levelWeAreIn == "4x4_Free" || ChangeableVariables.levelWeAreIn == "5x5_Free")
        {
            maxTime = 20;
        }

        scoreDefaultColor = StartFunction.currentTheme_GUISkin.FindStyle("ScoreLabel").normal.textColor;

        sc           = GameObject.Find("Platform").GetComponent <ScoreController> ();
        spc          = GameObject.FindGameObjectWithTag("Spawner").GetComponent <SpawnCubes> ();
        hsc          = GameObject.Find("HighScore").GetComponent <HighScore> ();
        ls           = GameObject.Find("Platform").GetComponent <LineScore> ();
        themeSongObj = GameObject.Find("Themesong");
        DisplayImage();
    }
Exemplo n.º 2
0
 private void Start()
 {
     foreach (KeyValuePair <string, float> data in playerList.OrderByDescending(key => key.Value))
     {
         LineScore line = Instantiate(lineScore, lineParent);
         line.caption.text = data.Key;
         line.score.text   = data.Value.ToString("0.0");
         line.gameObject.SetActive(true);
     }
 }
Exemplo n.º 3
0
        public void GetGameLineScore()
        {
            NHLApiClient api = new NHLApiClient();

            //Load Expected result from file
            var testResponse = File.ReadAllText(@"../../../TestAPIResponses/GetGameLineScore.json");
            var jobj         = JObject.Parse(testResponse);
            var expected     = JsonConvert.DeserializeObject <LineScore>(jobj.ToString());

            LineScore actual = api.GetGameLineScore(2017030325); //Jets vs Vegas WCF Game 5 2018

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 4
0
    public static void AddPlayer(string name)
    {
        if (playerList.ContainsKey(name))
        {
            return;
        }

        playerList.Add(name, 100);
        string pList = PlayerPrefs.GetString("PlayerList");

        pList = pList + name + ";";
        PlayerPrefs.SetString("PlayerList", pList);
        PlayerPrefs.Save();

        LineScore line = Instantiate(instance.lineScore, instance.lineParent);

        line.caption.text = name;
        line.score.text   = "100.0";
        line.gameObject.SetActive(true);
    }
Exemplo n.º 5
0
    private IEnumerator WaitForBarrelsParticles(BioHazardMeltdown [] meltEerythingDown)
    {
        yield return(new WaitForSeconds(1));

        LineScore lS = GameObject.Find("Platform").GetComponent <LineScore> ();

        lS.Default();
        for (int i = 0; i < 3; i++)
        {
            meltEerythingDown [i].MeltEverythingDown();
        }

        //instantiate the Bio hazard liquid particles

        Destroy(this.gameObject);

        lS.MoveCubesAfterMeltingDown();
        //  spawn a new shape
        sC.PickShape();
    }
Exemplo n.º 6
0
 void Start()
 {
     lS = GameObject.Find("Platform").GetComponent <LineScore> ();
 }
Exemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     lS          = GameObject.Find("Platform").GetComponent <LineScore> ();
     tntSoundObj = GameObject.Find("TNT_SoundObj").GetComponent <AudioSource> ();
 }
Exemplo n.º 8
0
    void Start()
    {
        guiMain = Camera.main.GetComponent <GUIMain> ();


        shapesManager = GameObject.Find("ShapesManager");
        sM            = shapesManager.GetComponent <ShapesManager> ();
        tutorial      = GameObject.Find("Tutorial");
        tL            = tutorial.GetComponent <TutorialLevel> ();

        //  just for the first shape
        if (ChangeableVariables.levelWeAreIn == "3x3_1" && sM.activeShapes.Count < 1 &&
            PlayerPrefs.GetString("FinidhedFirstTutorial") == "false")
        {
            statesList.Add(TutorialLevel.TutorialStates.RotateHorizontally);
            statesList.Add(TutorialLevel.TutorialStates.RotateVertically);
            statesList.Add(TutorialLevel.TutorialStates.Drag);
            statesList.Add(TutorialLevel.TutorialStates.DoubleTap);

            tL.currentState = statesList [numberOfTheState];
            tL.CurrentTexture();
            tL.NewPositionsOfTheVectors();
            numberOfTheState++;
            weAccomplishedTutorial = false;
        }
        else
        {
            weAccomplishedTutorial = true;
        }


        SwapTexture();


        currentState = StatesOfTheShape.Idle;
        sc           = GameObject.Find("Platform").GetComponent <ScoreController> ();
        lS           = GameObject.Find("Platform").GetComponent <LineScore> ();

        lS.activeObject = this.gameObject;

        actualRot = transform.GetComponentInChildren <ActualRotation> ();
        drc       = transform.GetComponentsInChildren <DrawRaysCube> ();

        directions = GameObject.FindGameObjectWithTag("Directions");
        dfc        = (DirectionsFollowingCamera)directions.GetComponent(typeof(DirectionsFollowingCamera));

        curSpeed = dfc.speedOfFalling;

        //  get directions
        //  each time we spawn a new shape we need to know
        //  which directions we used for the last one
        dir1 = dfc.dir1;
        dir2 = dfc.dir2;
        dir3 = dfc.dir3;
        dir4 = dfc.dir4;

        rot1 = Vector3.down;
        rot2 = Vector3.up;


        camCon = (cameraController)Camera.main.gameObject.GetComponent(typeof(cameraController));
        camCon.GetTheShapeToChangeItsDirections(this.gameObject);
        camCon.DependsOnCameraPos();
        //  custom positions - most of details don't land in the center
        if (transform.gameObject.name.Contains("Sofa"))
        {
            transform.position = new Vector3(ChangeableVariables.LShapeX, transform.position.y + 1.5f, ChangeableVariables.LShapeZ);
            SpawnGhostShape();
        }
        else if (transform.gameObject.name.Contains("CanShark"))
        {
            transform.position = new Vector3(ChangeableVariables.IShapeX, transform.position.y + 2.5f, ChangeableVariables.IShapeZ);
            SpawnGhostShape();
        }
        else if (transform.gameObject.name.Contains("TV"))
        {
            transform.position = new Vector3(ChangeableVariables.OShapeX, transform.position.y + 0.5f, ChangeableVariables.OShapeZ);
            SpawnGhostShape();
        }
        else if (transform.gameObject.name.Contains("Car"))
        {
            transform.position = new Vector3(ChangeableVariables.TShapeX, transform.position.y + 1.5f, ChangeableVariables.TShapeZ);
            SpawnGhostShape();
        }
        else if (transform.gameObject.name.Contains("Microwave"))
        {
            transform.position = new Vector3(ChangeableVariables.ZShapeX, transform.position.y + 1, ChangeableVariables.ZShapeZ);
            SpawnGhostShape();
        }
        else if (transform.gameObject.name.Contains("Barrels"))
        {
            transform.position = new Vector3(ChangeableVariables.SShapeX, transform.position.y + 0.5f, ChangeableVariables.SShapeZ);
            SpawnGhostShape();
        }
        else if (transform.gameObject.name.Contains("Boxes"))
        {
            transform.position = new Vector3(ChangeableVariables.YShapeX, transform.position.y + 0.5f, ChangeableVariables.YShapeZ);
            SpawnGhostShape();
        }
        else if (transform.gameObject.name.Contains("Fridge"))
        {
            transform.position = new Vector3(ChangeableVariables.NShapeX, transform.position.y + 0.5f, ChangeableVariables.NShapeZ);
            SpawnGhostShape();
        }
        else if (transform.gameObject.name.Contains("BottleBox"))
        {
            transform.position = new Vector3(ChangeableVariables.TwoShapeX, transform.position.y + 0.5f, ChangeableVariables.TwoShapeZ);
            SpawnGhostShape();
        }
        else if (transform.gameObject.name.Contains("WC"))
        {
            transform.position = new Vector3(ChangeableVariables.ThreeShapeX, transform.position.y + 0.5f, ChangeableVariables.ThreeShapeZ);
            SpawnGhostShape();
        }
        else if (transform.gameObject.name.Contains("TNT"))
        {
            transform.position = new Vector3(ChangeableVariables.OneShapeX, transform.position.y, ChangeableVariables.OneShapeZ);
            bgs = GetComponentInChildren <BombGhostShape> ();
            SpawnGhostShape();
        }
        root = transform.root.gameObject;
        cr   = (ControlRigidbodies)root.GetComponent(typeof(ControlRigidbodies));
    }