コード例 #1
0
    void GetProp(GCGarbageItem prop)
    {
        if (isDebug)
        {
            print("Get " + prop.name);
        }

        closePropList.Remove(prop);
        Destroy(prop.gameObject);
    }
コード例 #2
0
    public void CreateItem()
    {
        float   x         = Random.Range(-1f, 1f);
        float   z         = Random.Range(-1f, 1f);
        Vector3 direction = new Vector3(x, 0, z);

        GameObject obj = Instantiate(createItemPrefab) as GameObject;

        obj.transform.position = transform.position + Random.Range(0, distance) * direction;
        obj.transform.parent   = transform;

        createItem = obj.GetComponent <GCGarbageItem>();
    }
コード例 #3
0
    void ChangeSelectProp(GCGarbageItem targetProp, bool direct = true)
    {
        if (targetProp == null)
        {
            curSelectProp = null;
            return;
        }

        if (direct)
        {
            GetProp(targetProp);

            return;
        }

        if (curSelectProp != targetProp)
        {
            curSelectProp = targetProp;
        }
    }
コード例 #4
0
    public void OnLostProp(GCGarbageItem item)
    {
        closePropList.Remove(item);

        SelectInPropsList();
    }
コード例 #5
0
    public void OnCloseProp(GCGarbageItem item)
    {
        closePropList.Add(item);

        SelectInPropsList();
    }