コード例 #1
0
    /// <summary>
    /// Creates a Backdrop, a static, visual object.
    /// </summary>
    /// <param name="name"></param>
    /// <param name="spot"></param>
    /// <returns></returns>
    public Backdrop CreateBackdrop(string name, Vector2 spot)
    {
        Roomgrid rg = Roomgrid.Instance();


        GameObject go = _CreateObject(spot);

        go.name = "_backdrop";
        go.transform.localPosition = new Vector3(go.transform.localPosition.x, go.transform.localPosition.y, rg.GroundZ);
        go.transform.localScale    = Vector3.one * 1.0f; // *** Normal size
        go.layer = 8;
        //
        Backdrop b = go.AddComponent <Backdrop>();

        b.AssignSprite(name);
        b.sprite.sr.material = (Material)Resources.Load("GroundMat");
        //


        return(b);
    }