コード例 #1
0
    //private void DoSelectEvent(Vector3 hitPoint)
    //{
    //    Event e = Event.current;
    //    if (e.type != EventType.MouseDown && e.type != EventType.MouseDrag)
    //        return;
    //}

    private void CreateTileIntoMap(int x, int y, Sprite sprite)
    {
        SrpgTile oldTile = _currMap.GetTile(_currLayer, x, y);

        if (oldTile != null)
        {
            Undo.DestroyObjectImmediate(oldTile.gameObject);
        }

        SrpgTile newTile = _currMap.CreateTileInto(_currLayer, sprite, x, y);

        Undo.RegisterCreatedObjectUndo(newTile.gameObject, newTile.name);
        EditorUtility.SetSelectedRenderState(newTile.GetComponent <Renderer>(), EditorSelectedRenderState.Hidden);
    }
コード例 #2
0
 public bool IsSameTile(SrpgTile other)
 {
     return(GetComponent <SpriteRenderer>().sprite.GetInstanceID()
            == other.GetComponent <SpriteRenderer>().sprite.GetInstanceID());
 }