private void OnRecvSTrigerOnEnter(IChannel channel, Message message) { STrigerOnEnter msg = message as STrigerOnEnter; if (msg.pressurePad != null) { TrigerOnEnter(msg.pressurePad.name); } if (msg.switchCrystal != null) { TrigerOnEnter(msg.switchCrystal.name); } if (msg.healthBox != null) { TrigerOnEnter(msg.healthBox.name); } }
private void OnRecvTrigerOnEnter(IChannel channel, Message message) { CTrigerOnEnter msg = message as CTrigerOnEnter; STrigerOnEnter response = new STrigerOnEnter(); Player player = channel.GetContent() as Player; if (msg.pressurePad != null) { var pressurePad = World.Instance.PressurePads[msg.pressurePad.name]; if (!pressurePad.used) { response.pressurePad = msg.pressurePad; } pressurePad.used = true; } if (msg.switchCrystal != null) { var switchCrystal = World.Instance.SwitchCrystals[msg.switchCrystal.name]; if (!switchCrystal.used) { response.switchCrystal = msg.switchCrystal; } switchCrystal.used = true; } if (msg.healthBox != null) { var healthBox = World.Instance.HealthBoxes[msg.healthBox.name]; if (!healthBox.used) { response.healthBox = msg.healthBox; } healthBox.used = true; player.currentHP = player.maxHP; } player.Broadcast(response); }