Ejemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     RenderSettings.fog        = false;
     RenderSettings.fogColor   = new Color(0.2f, 0.4f, 0.8f, 0.5f);
     RenderSettings.fogDensity = 0.04f;
     rb = GameObject.Find("FPSController").GetComponent <Rigidbody>();
     MS = GameObject.Find("FPSController").GetComponent <RigidbodyFirstPersonController.MovementSettings>();
 }
Ejemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        //m_origZ = transform.position.z;
        m_translateZ = Speed * (MoveRight? 1f : -1f);

        m_movementSettings = GameObject.FindGameObjectWithTag("Player")
                             .GetComponent <RigidbodyFirstPersonController>()
                             .movementSettings;
    }
Ejemplo n.º 3
0
    public IEnumerator SpeedUp(RigidbodyFirstPersonController.MovementSettings settings)
    {
        Debug.Log("You picked up a speed quirk");
        settings.ForwardSpeed  *= 1.5f;
        settings.BackwardSpeed *= 1.5f;
        settings.StrafeSpeed   *= 1.5f;
        Debug.Log("Forward speed is now" + settings.ForwardSpeed);

        yield return(new WaitForSeconds(5f));

        //Debug.Log("Resetting to default values");
        //mobcontroller.GetComponent<RigidbodyFirstPersonController>().movementSettings.ForwardSpeed /= 1.5f;
        //mobcontroller.GetComponent<RigidbodyFirstPersonController>().movementSettings.BackwardSpeed /= 1.5f;
        //mobcontroller.GetComponent<RigidbodyFirstPersonController>().movementSettings.StrafeSpeed /= 1.5f;
        yield return(null);
    }