public override void Tick() { base.Tick(); SM.SceneRoom room = SM.RandomRoomLevel.Singleton.LookupRoom(RoomId); if (null != room) { SM.Gate curGateData = room.GetGateByID(mGateId); if (null != curGateData) { switch (mGateActiveType) { case GateActiveType.enOpen: if (curGateData.OutIsActive) { IsEnabled = true; } break; case GateActiveType.enClose: if (!curGateData.OutIsActive) { IsEnabled = true; } break; default: break; } } } }
public override bool Execute() { if (IsEnabled) { SM.SceneRoom room = SM.RandomRoomLevel.Singleton.LookupRoom(RoomGUID); SM.Gate gate = room.GetGateByID(gateId); room.RoomOperateGate(gate, gate.gateDirectionIndex, gateActive); } return(true); }