예제 #1
0
 public void LoadFromScriptable(RuntimeRoom _runtimeRoom)
 {
     roomID        = _runtimeRoom.roomID;
     totalLayers   = _runtimeRoom.totalLayers;
     roomName      = _runtimeRoom.roomName;
     creatorName   = _runtimeRoom.creatorName;
     levelType     = _runtimeRoom.levelType;
     roomInPath    = _runtimeRoom.roomInPath;
     roomType      = _runtimeRoom.roomType;
     roomSize      = _runtimeRoom.roomSize;
     roomPosition  = _runtimeRoom.roomPosition;
     roomTilemaps  = _runtimeRoom.roomTilemaps;
     tilesPosition = _runtimeRoom.tilesPosition;
     roomTilemaps  = _runtimeRoom.roomTilemaps;
     //Gets the collision and Trigger layers
     collisionLayer = _runtimeRoom.collisionLayer;
     triggerLayer   = _runtimeRoom.triggerLayer;
 }
예제 #2
0
    public void SaveToScriptable()
    {
        //Create Scriptable Object
        RuntimeRoom newRoom = (RuntimeRoom)ScriptableObjectUtility.CreateAsset <RuntimeRoom>();

        newRoom.roomID        = roomID;
        newRoom.totalLayers   = totalLayers;
        newRoom.roomName      = roomName;
        newRoom.creatorName   = creatorName;
        newRoom.levelType     = levelType;
        newRoom.roomInPath    = roomInPath;
        newRoom.roomType      = roomType;
        newRoom.roomSize      = roomSize;
        newRoom.roomPosition  = roomPosition;
        newRoom.roomTilemaps  = roomTilemaps;
        newRoom.tilesPosition = tilesPosition;
        newRoom.roomTilemaps  = roomTilemaps;
        //Save collision and trigger layers
        newRoom.collisionLayer = collisionLayer;
        newRoom.triggerLayer   = triggerLayer;

        Debug.Log("Created Room Scriptable Object");
    }