private void saveFlock()
        {
            //TODO get chickens
            Hen[]          flock   = FindObjectsOfType <Hen>();
            List <HenInfo> records = new List <HenInfo>();

            foreach (Hen obj in flock)
            {
                records.Add(new HenInfo(obj));
            }

            HenInfoPersist.saveList(records);
        }
Beispiel #2
0
    // Start is called before the first frame update
    void Start()
    {
        listItems = new List <StackSelectionListItem>();

        List <HenInfo> henList = HenInfoPersist.loadList();

        foreach (HenInfo info in henList)
        {
            GameObject             listEntry = Instantiate(listItemPrefab) as GameObject;
            StackSelectionListItem item      = listEntry.GetComponent <StackSelectionListItem>();
            listItems.Add(item);
            item.assignHen(info);
            item.toggle.isOn = false;
            item.toggle.onValueChanged.AddListener(delegate { updateStats(); });


            listEntry.transform.SetParent(verticalLayout.transform, false);
        }
    }
Beispiel #3
0
        // Start is called before the first frame update
        void Start()
        {
            List <HenInfo> savedData = HenInfoPersist.loadList();

            // savedData.Clear();
            if (savedData.Count > 0)
            {
                foreach (HenInfo h in savedData)
                {
                    spawnHen(h);
                }
            }
            else
            {
                for (int i = 0; i < 4; i++)
                {
                    spawnHen();
                }
            }
        }
    // Start is called before the first frame update
    void Start()
    {
        nextButton.onClick.AddListener(delegate { selectNext(); });
        lastButton.onClick.AddListener(delegate { selectPrev(); });

        listItems = new List <StackSelectionListItem>();

        henList         = HenInfoPersist.loadList();
        currentHenIndex = 0;
        updateSelection();

        死            = SoundManager.Instance();
        soundOptions = SoundOptions.Instance();
        if (Random.Range(0.0f, 1.0f) > 0.5)
        {
            死.SetBGM(SoundManager.SFX.chickenMarch);
            死.PlayBGM();
        }
        else
        {
            死.SetBGM(SoundManager.SFX.chickenMarchDubstep);
            死.PlayBGM();
        }
    }