Ejemplo n.º 1
0
    void Update()
    {
        // Debug.Log(gameObject.name + " selec: " + selector);
        // Debug.Log(gameObject.name + " vec3: " + acceleration);
        Debug.Log(gameObject.name + " s:" + selector + "v:" + acceleration + "t:" + Synecdoche.Tempus.GetDateCompact(DateTime.Now));


        if (lifeCount == Tempus.UnixTimeNow())
        {
            // lifeCount = 0;

            // audioSource.clip = audioClips[1];
            // audioSource.loop = true;
            // audioSource.volume = 1f;
            // audioSource.Play();

            // Debug.Log("PLAY!");
        }

        _rotation     = 0;
        _acceleration = 0;

        if (!isLocalPlayer || !_canControl)
        {
            return;
        }

        _rotation = Input.GetAxis("Horizontal");

        float x = (float)Math.Round(Input.acceleration.x, 2);
        float y = (float)Math.Round(Input.acceleration.y, 2);
        float z = (float)Math.Round(Input.acceleration.z, 2);

        // SendReadyToBeginMessage((int) x * 100);

        acceleration = new Vector3(x, y, z);
        CmdAcc(acceleration);

        // _acceleration = Input.GetAxis("Vertical");
        _acceleration = acceleration.x;

        if (Input.GetButton("Jump") && _shootingTimer <= 0)
        {
            _shootingTimer = 0.2f;
            //we call a Command, that will be executed only on server, to spawn a new bullet
            //we pass the position&forward to be sure to shoot from the right one (server can lag one frame behind)
            CmdFire(transform.position, transform.forward, _rigidbody.velocity);
        }

        if (_shootingTimer > 0)
        {
            _shootingTimer -= Time.deltaTime;
        }
    }
Ejemplo n.º 2
0
 public TempusRecordCacheService(Tempus tempusDataService, TempusHubMySqlService mySql, ILogger log)
 {
     _tempusDataService = tempusDataService;
     _mySql             = mySql;
     _log = log;
 }
Ejemplo n.º 3
0
 public void CmdTap()
 {
     timeTap = Tempus.GetDateCompact(DateTime.Now);
 }