示例#1
0
    public static GameObject attach(UIObject o)
    {
        Vector2 userPosition = o.getPosition();

        Vector3 correctedPosition
            = new Vector3( userPosition.x, userPosition.y, 1);

        GameObject inst
            = Instantiate(Resources.Load(o.getResourceName()), correctedPosition, Quaternion.identity) as GameObject;

        inst.transform.parent = group.transform;
        inst.transform.localScale = new Vector3(o.getWidth(), o.getHeight(), 1);
        inst.name = o.getName();
        return inst;
    }