コード例 #1
0
ファイル: Room.cs プロジェクト: shohan4556/ProjectPorcupine
        public bool DesignateRoomBehavior(RoomBehavior objInstance)
        {
            if (objInstance == null)
            {
                return(false);
            }

            if (RoomBehaviors.ContainsKey(objInstance.Type))
            {
                return(false);
            }

            if (objInstance.IsValidRoom(this) == false)
            {
                UnityDebugger.Debugger.LogError("Tile", "Trying to assign a RoomBehavior to a room that isn't valid!");
                return(false);
            }

            objInstance.Control(this);

            RoomBehaviors.Add(objInstance.Type, objInstance);

            return(true);
        }
コード例 #2
0
ファイル: Room.cs プロジェクト: shohan4556/ProjectPorcupine
 public bool HasRoomBehavior(string behaviorKey)
 {
     return(RoomBehaviors.ContainsKey(behaviorKey));
 }