示例#1
0
 public void CameraSetMode(coCamera camera, string mode, string arg1 = "", string arg2 = "", string arg3 = "")
     {
     coSimDataBlock t = camera.getDataBlock();
     System.Console.WriteLine(t.getName());
     console.Call_Classname(camera.getDataBlock().AsString(), "setMode", new string[] { camera, mode, arg1, arg2, arg3 });
     // Punt this one over to our datablock
     }
示例#2
0
        public void ObserverObserverOnTrigger(coCameraData cameradata, coCamera camera, 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
            coGameConnection client = camera.getControllingClient();
            string mode = camera["mode"];
            switch (mode)
                {
                case "Observer":
                    // Do something interesting.
                    break;
                case "Corpse":
                    //Here is a winner... if you send the prepare too soon, it will crash out the client.  The GameConnectionOnControlObjectChange needs
                    //time to run, and since it's still processing the first change (Switch to camera) this second change (Camera->player) will crash
                    //out the client.
                    //ServerCmdSetEditorCameraStandard(client);
                    //ServerCmdDropCameraAtPlayer(client);
                    camera.setFlyMode();
                    client.setControlObject(camera);
                    GameConnectiOnPreparePlayer(client);
                    break;
                }
            }
示例#3
0
 public void CameraOnAdd(coCamera camera, string obj)
     {
     CameraSetMode(camera, camera["mode"]);
     }
示例#4
0
 public void ObserverObserverSetMode(coCamera camera, string mode, coSceneObject 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;
     }