Exemplo n.º 1
0
    void judge()
    {
        Entity_ player = FindObjectOfType <Entity_>();

        if (player.prefer == 50)
        {
            Debug.Log("ending!");
            while (true)
            {
                ;
            }
        }
    }
Exemplo n.º 2
0
    public void ShowHide(Entity_ player)
    {
        if (show)
        {
            gameObject.SetActive(false);
            foreach (GameObject cross in list)
            {
                Destroy(cross);
            }

            list.Clear();
        }
        else
        {
            gameObject.SetActive(true);
            bool[] a = new bool[10];
            foreach (Item_ item in player.inventory)
            {
                for (int i = 0; i < 10; i++)
                {
                    if (itemList[i].Equals(item.n))
                    {
                        a[i] = true;
                        break;
                    }
                }
            }

            for (int i = 0; i < 10; i++)
            {
                Vector3 v = transform.position;
                if (!a[i])
                {
                    GameObject cross = Instantiate(nothing) as GameObject;
                    cross.transform.position = new Vector3(v.x + 3.5f * (i / 5), v.y + -2 * (i % 5));
                    cross.SetActive(true);
                    list.Add(cross);
                }
            }
        }

        show = !show;
    }
Exemplo n.º 3
0
 void Start()
 {
     player = FindObjectOfType <Entity_>();
 }