Exemplo n.º 1
0
    GameObject GetResource(int resrouce_id)
    {
        MapResourceProxy res = MapResourceCenter.GetResource(resrouce_id);

        resources.Add(res);
        return(res.resource);
    }
Exemplo n.º 2
0
    public void Show(int l)
    {
        if (level == l)
        {
            return;
        }
        level = l;
        if (res != null)
        {
            res.Release();
            res = null;
        }

        if (resource[level] == 0)
        {
            return;
        }

        this.gameObject.SetActive(true);

        res = MapResourceCenter.GetResource(resource[level]);

        res.resource.transform.localPosition = Vector3.zero;
        res.resource.transform.localScale    = Vector3.one * 0.01f;
        res.resource.transform.Rotate(new Vector3(0, Random.Range(0, 360), 0));
        res.resource.transform.SetParent(this.transform, false);

        res.resource.SetActive(true);
    }
Exemplo n.º 3
0
    public void Spawn(int res_obj_id, Vector3 pos)
    {
        MapResourceProxy res = MapResourceCenter.GetResource(res_obj_id);
        MapLODObject     obj = res.resource.GetComponent <MapLODObject>();

        obj.transform.position = pos;
        if (obj.resource[2] != 0)
        {
            obj.p = high_obj_list.AddLast(obj);
        }
        else
        {
            obj.p = obj_list.AddLast(obj);
        }
    }