public override void onTrigger(Extendable.Camera obj, string trigger, bool state) { // state = 0 means that a trigger key was released if (state == false) return; // Default player triggers: 0=fire 1=altFire 2=jump GameConnection client = obj.getControllingClient(); string mode = obj["mode"]; switch (mode) { case "Observer": // Do something interesting. break; case "Corpse": if (obj["orbitObj"].isObject()) { Util.cancelAll(obj["orbitObj"]); SceneObject orbitobj = obj["orbitObj"]; orbitobj.schedule("0", "startFade", "1000", "0", "true"); orbitobj.schedule("1000", "delete"); } client.preparePlayer(); this.setMode(obj, "Observer", "", "", ""); break; } }
public override void setMode(Extendable.Camera camera, string mode, SceneObject arg1, string arg2, string arg3) { switch (mode) { case "Observer": camera.setFlyMode(); break; case "Corpse": camera.setOrbitMode(arg1, arg1.getTransform(), (float) 0.5, (float) 4.5, (float) 4.5, false, new Point3F(), false); camera["orbitObj"] = arg1; break; } camera["mode"] = mode; }