コード例 #1
0
    void Start()
    {
        PanelController panel = transform.GetComponent <PanelController>();

        panel.UpdateMe += UpdateMe;
        //foreach(string name in foodColors.GetNames())
        //{
        //    Debug.Log(name);
        //}
        colorSelection.SetList(foodColors.GetNames());
        shapeSelection.SetList(foodShapes.GetNames());
        spiceSelection.SetList(foodSpices.GetNames());
        colorSelection.UpdateSmth = UpdateDisplay;
        shapeSelection.UpdateSmth = UpdateDisplay;
        spiceSelection.UpdateSmth = UpdateDisplay;
        dispenser.onClick.AddListener(DispensePress);
        this.panel = panel.panel;

        hive  = FindObjectOfType <HiveBehaviour>();
        timer = FindObjectOfType <TimerScript>();
        UpdateDisplay();
    }
コード例 #2
0
ファイル: Laser.cs プロジェクト: thvaisa/Asimov
    void Start()
    {
        freeCrossHairs = new Queue <int>();
        usedCrossHairs = new Queue <int>();
        crossHairs     = new List <GameObject>();
        PanelController panel = transform.GetComponent <PanelController>();

        panel.UpdateMe += UpdateMe;

        hive = FindObjectOfType <HiveBehaviour>();

        colorSelection.SetList(laserColors.GetNames());
        shoot.onClick.AddListener(ToggleShoot);

        for (int i = 0; i < 50; ++i)
        {
            freeCrossHairs.Enqueue(i);
            crossHairs.Add(Instantiate(CrossHairPrefab));
            crossHairs[crossHairs.Count - 1].transform.SetParent(transform);
            crossHairs[crossHairs.Count - 1].SetActive(false);
        }
        toggleImage.sprite = toggleOff;
    }