Beispiel #1
0
    public void ApiTick(ISimulationAPI api)
    {
        if (this.position < length)
        {
            switch (this.state)
            {
                case 1:
                    api.ReplaySetPlaySpeed(this.max_value - ease(this.position) + 1, 1);
                    break;
                case -1:
                    api.ReplaySetPlaySpeed( ease(this.position), 1);
                    break;
                default:
                    break;
            }
        }
        else if (this.position >= length+10 && this.state != 0)
        {
            Console.WriteLine("Finished..." + this.state);
            if(this.state == 1)
                api.ReplaySetPlaySpeed( 1, 0);
            else if(this.state == -1)
                api.ReplaySetPlaySpeed( this.max_value, 1);
            this.state = 0; 
        }

        if(this.state != 0)
            position++;
    }
Beispiel #2
0
    public void ApiTick(ISimulationAPI api)
    {
        if (this.position < length)
        {
            switch (this.state)
            {
            case 1:
                api.ReplaySetPlaySpeed(this.max_value - ease(this.position) + 1, 1);
                break;

            case -1:
                api.ReplaySetPlaySpeed(ease(this.position), 1);
                break;

            default:
                break;
            }
        }
        else if (this.position >= length + 10 && this.state != 0)
        {
            Console.WriteLine("Finished..." + this.state);
            if (this.state == 1)
            {
                api.ReplaySetPlaySpeed(1, 0);
            }
            else if (this.state == -1)
            {
                api.ReplaySetPlaySpeed(this.max_value, 1);
            }
            this.state = 0;
        }

        if (this.state != 0)
        {
            position++;
        }
    }
Beispiel #3
0
 private void SwitchCamOrDriver(int driver, int camera)
 {
     if (iRTVOConnection.isServer || !iRTVOConnection.isConnected || !SharedData.remoteClientFollow)
     {
         if (simulationAPI.IsConnected)
         {
             // Only Execute locally IF
             // - i am the server
             // - i am not connected to a server
             // - or i am not following the server
             // Everything else will be handled by the Server
             simulationAPI.SwitchCamera(driver, camera);
             Int32 playspeed = getPlaySpeed();
             Int32 slomo     = 0;
             if (playspeed > 0)
             {
                 slomo = 1;
             }
             else
             {
                 playspeed = Math.Abs(playspeed);
             }
             simulationAPI.ReplaySetPlaySpeed(playspeed, slomo);
         }
     }
     // Broadcast IF
     // - I'm the Server
     // - I follow the Server
     if (SharedData.remoteClientFollow || iRTVOConnection.isServer)
     {
         //                    iRTVOConnection.BroadcastMessage("CAMERA", camera);
         //                    iRTVOConnection.BroadcastMessage("DRIVER", driver);
         iRTVOConnection.BroadcastMessage("SWITCH", driver, camera);
         // iRTVOConnection.BroadcastMessage("PLAYSPEED", ((Int32)API.sdk.GetData("ReplayPlaySpeed")), ((bool)API.sdk.GetData("ReplayPlaySlowMotion") ? 1:0));
     }
 }