Beispiel #1
0
 void Start()
 {
     player = SaveSEAttributes.LoadPlayer();
     nameText.GetComponent <Text>().text     = player.PlayerName;
     ageText.GetComponent <Text>().text      = Math.Round(player.PlayerAge) + " years old";
     currencyText.GetComponent <Text>().text = "$ " + player.PlayerCurrency;
 }
    // Update is called once per frame
    void Update()
    {
        updateView();
        hourCount -= Time.deltaTime;
        if (Mathf.Round(hourCount) == 0)
        {
            hourCount = 3600;
            projects.hourPass();
            List <Project> projectList = projects.GetProjects();
            foreach (Project item in projectList)
            {
                if (item.Deadline == 0)
                {
                    int id = item.ID;
                    projects.RemoveProjects(id);
                    Project newProject = generateNewProject(id);
                    projects.AddProject(newProject);
                }
            }
        }

        if (workingOn != 0)
        {
            minuteCount[workingOn - 1] -= Time.deltaTime;
            if (ChangeComputer.upgrade)
            {
                minuteCount[workingOn - 1] -= Time.deltaTime;
                UnityEngine.Debug.Log("computer change");
            }
            //print(minuteCount[workingOn - 1]);
            if (Mathf.Round(minuteCount[workingOn - 1]) == 0)
            {
                minuteCount[workingOn - 1] = 1;
                int minuteLeft = projects.minutePass(workingOn);
                //print(minuteLeft);
                if (minuteLeft == 0)
                {
                    Project compProject = projects.GetProject(workingOn);
                    compProject.Completion = true;
                    int awardCurrency = compProject.Currency;
                    int awardExp      = compProject.Exp;

                    SEAttributes player = SaveSEAttributes.LoadPlayer();
                    SEAttributesController.AdjustCurrency(player, awardCurrency);

                    projects.RemoveProjects(workingOn);
                    Project newProject = generateNewProject(workingOn);
                    projects.AddProject(newProject);
                    int temp = workingOn;
                    stopProject();
                    setSceneActive(temp);
                    setPreviousSceneInactive(temp);
                }
            }
        }
    }
Beispiel #3
0
    // private Sprite chair, chair2, chair3, chair4, chair5;

    // Use this for initialization
    void Start()
    {
        player      = SaveSEAttributes.LoadPlayer();
        moneyAmount = player.PlayerCurrency;
        //moneyAmount = PlayerPrefs.GetInt ("MoneyAmount");

        GameObject initialState = GameObject.Find("Canvas/Chair");

        rend        = initialState.GetComponent <Image>();
        rend.sprite = ChangeChair.chairs[ChangeChair.upgrade + 1];
    }
 private void OnTriggerExit2D(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         playerInRange = false;
         buttonBox.SetActive(false);
         dialogBox.SetActive(false);
         SEAttributes player = SaveSEAttributes.LoadPlayer();
         player.currState = "";
         SaveSEAttributes.SavePlayer(player);
     }
 }
    public void SelectTv()
    {
        SEAttributes player = SaveSEAttributes.LoadPlayer();

        player.currState = "entertainment";
        SaveSEAttributes.SavePlayer(player);
        if (dialogBox.activeInHierarchy)
        {
            dialogBox.SetActive(false);
        }
        else
        {
            dialogBox.SetActive(true);
        }
        dialog.text = "You are now playing Wii..";
    }
    public void SelectSleep()
    {
        SEAttributes player = SaveSEAttributes.LoadPlayer();

        player.currState = "sleeping";
        SaveSEAttributes.SavePlayer(player);
        if (dialogBox.activeInHierarchy)
        {
            dialogBox.SetActive(false);
        }
        else
        {
            dialogBox.SetActive(true);
        }
        dialog.text = "You are now sleeping..";
    }
Beispiel #7
0
    // Start is called before the first frame update
    void Start()
    {
        animator = GetComponent <Animator>();
        rend     = GetComponent <SpriteRenderer>();
        boy      = Resources.Load <Sprite>("boy");
        girl     = Resources.Load <Sprite>("girl");

        SEAttributes player = SaveSEAttributes.LoadPlayer();

        if (player.PlayerGender == "male")
        {
            rend.sprite = boy;
            animator.SetBool("isMale", true);
        }
        else if (player.PlayerGender == "female")
        {
            rend.sprite = girl;
            animator.SetBool("isMale", false);
        }
    }
Beispiel #8
0
    public void CreatePlayer()
    {
        playerName               = inputField.GetComponent <Text>().text;
        newPlayer.PlayerName     = playerName;
        newPlayer.PlayerGender   = playerGender;
        newPlayer.PlayerAge      = 15;
        newPlayer.Mood           = 100;
        newPlayer.Hunger         = 100;
        newPlayer.Tired          = 100;
        newPlayer.Fitness        = 100;
        newPlayer.PlayerCurrency = 5.00;
        newPlayer.currState      = "";
        newPlayer.StartTime      = System.DateTime.Now;
        SaveSEAttributes.SavePlayer(newPlayer);

        // Testing
        newPlayer = SaveSEAttributes.LoadPlayer();
        Debug.Log(newPlayer.PlayerName + newPlayer.PlayerGender + newPlayer.PlayerAge + newPlayer.PlayerCurrency);

        SceneManager.LoadScene("GeneralRoom");
    }
Beispiel #9
0
 // Update is called once per frame
 void Update()
 {
     player = SaveSEAttributes.LoadPlayer();
     GetCurrentFill();
 }
Beispiel #10
0
    // Start is called before the first frame update

    void Start()
    {
        player = SaveSEAttributes.LoadPlayer();
        TombText.GetComponent <Text>().text = player.PlayerName + " you died at " + Math.Round(player.PlayerAge) + " years old" + "with $ " + player.PlayerCurrency;
    }
Beispiel #11
0
    void Start()
    {
        SEAttributes player = SaveSEAttributes.LoadPlayer();

        username = player.PlayerName;
    }
Beispiel #12
0
    // Update is called once per frame
    void Update()
    {
        SEAttributes player = SaveSEAttributes.LoadPlayer();

        TimeStep.TimeEvent((System.DateTime.Now - player.StartTime).Seconds, player);
    }
    public void SelectSave()
    {
        SEAttributes player = SaveSEAttributes.LoadPlayer();

        SaveSEAttributes.SavePlayer(player);
    }