示例#1
0
    void FixedUpdate()
    {
        float h = Input.GetAxisRaw("LeftJoyHorizontal" + playerNumber);
        float v = Input.GetAxisRaw("LeftJoyVertical" + playerNumber);

        Move(h, v);
        Turning();
        Animating(h, v);

        timeRemaining -= Time.deltaTime;
        if (timeRemaining <= 0)
        {
            float distance = Vector3.Distance(this.transform.position, anotherPlayer.transform.position);
            LogManager.AddPlayerMovementLog(playerNumber, this.transform);
            LogManager.AddPlayerDistanceLog(playerNumber, distance);
            timeRemaining = timeToLog;
        }
    }