Ejemplo n.º 1
0
    public void loadProfil(string name)
    {
        //load separate file "actors.xml" and read the values
        var actorCollection = ActorContainer.Load(path);

        //set the dynamic digital values to the values in the file
        foreach (Actor actor in actorCollection.actors)
        {
            if (name.Equals(actor.name))
            {
                //set Values
                actorInformation.setName(actor.name);
                actorInformation.setGender(actor.gender);
                actorInformation.setID(actor.id);
                actorInformation.setScore(actor.score);


                tmp_actor.name   = actorInformation.getName();
                tmp_actor.gender = actorInformation.getGender();
                tmp_actor.id     = actorInformation.getID();
                tmp_actor.score  = actorInformation.getScore();
            }
        }

        Debug.Log("Geladene ID: " + tmp_actor.id);
        Debug.Log("Geladener Name: " + tmp_actor.name);
        Debug.Log("Geladener Gender: " + tmp_actor.gender);
        Debug.Log("Geladener Score: " + tmp_actor.score);

        login = true;
        //SimpleTest.previousWeight = 0.0f;
        firstLogin = true;
    }
Ejemplo n.º 2
0
    public void LoadMyData()
    {
        //load separate file "actors.xml" and read the values
        var actorCollection = ActorContainer.Load(path);

        //set the dynamic digital values to the values in the file
        foreach (Actor actor in actorCollection.actors)
        {
            //set Values
            actorInformation.setName(actor.name);
            actorInformation.setGender(actor.gender);
            actorInformation.setID(actor.id);
            actorInformation.setScore(actor.score);


            tmp_actor.name   = actorInformation.getName();
            tmp_actor.gender = actorInformation.getGender();
            tmp_actor.id     = actorInformation.getID();
            tmp_actor.score  = actorInformation.getScore();
        }

        Debug.Log("Geladene ID: " + tmp_actor.id);
        Debug.Log("Geladener Name: " + tmp_actor.name);
        Debug.Log("Geladener Gender: " + tmp_actor.gender);
        Debug.Log("Geladener Score: " + tmp_actor.score);
    }
Ejemplo n.º 3
0
    public void updateScore(string input)
    {
        //load separate file "actors.xml" and read the values
        var actorCollection = ActorContainer.Load(path);

        //set the dynamic digital values to the values in the file
        foreach (Actor actor in actorCollection.actors)
        {
            if (actor.name.Equals(input))
            {
                actor.score = actorInformation.getScore();
            }
        }
        actorCollection.Save(path);
    }
Ejemplo n.º 4
0
    public void UpdateSize()
    {
        //load separate file "actors.xml" and read the values
        var actorCollection = ActorContainer.Load(path);

        //update current size of all_actor array
        size = actorCollection.actors.Count;

        int i = 0;

        foreach (Actor actor in actorCollection.actors)
        {
            //set Values
            actorInformation.setName(actor.name);
            actorInformation.setGender(actor.gender);
            actorInformation.setID(actor.id);
            actorInformation.setScore(actor.score);

            Actor tmp = new Actor();
            tmp.name   = actorInformation.getName();
            tmp.id     = actorInformation.getID();
            tmp.gender = actorInformation.getGender();
            tmp.score  = actorInformation.getScore();

            all_actors[i] = tmp;
            if (Application.loadedLevelName == "LoadProfile" && i > 0)
            {
                Button test = Instantiate(profil);
                profil.name           = tmp.name;
                test.transform.parent = my_canvas.transform;
                test.image.rectTransform.localScale = new Vector3(1, 1, 1);
                test.image.rectTransform.sizeDelta  = new Vector2(150, 75);
                if (i > 4)
                {
                    test.image.rectTransform.localPosition = new Vector3(-250 + 170, 150 - ((i - 1 - 4) * 85), 0);
                    if (tmp.gender == 1)
                    {
                        test.image.color = kindOfBlue;
                    }
                    else if (tmp.gender == 2)
                    {
                        test.image.color = kindOfRed;
                    }
                }
                else
                {
                    test.image.rectTransform.localPosition = new Vector3(-250, 150 - ((i - 1) * 85), 0);
                    if (tmp.gender == 1)
                    {
                        test.image.color = kindOfBlue;
                    }
                    else if (tmp.gender == 2)
                    {
                        test.image.color = kindOfRed;
                    }
                }



                test.GetComponentInChildren <Text>().text = tmp.name;
            }
            i++;
        }
        //need to be decreased cause will be increased in the next save step
        if (i > 0)
        {
            size--;
        }
    }