示例#1
0
 private void Awake()
 {
     _tpc = FindObjectOfType <MyTPCharacter>();
     _cm  = GetComponent <CameraMovement>();
     _cam = _cm.GetCamera();
     _rb  = GetComponent <Rigidbody>();
 }
    // La función Awake se llama antes que Start, y es donde se inicializan todos los parámetros de la clase
    private void Awake()
    {
        cfl = FindObjectOfType <CinemachineFreeLook>();
        ppv = FindObjectOfType <PostProcessVolume>();
        ppv.profile.TryGetSettings <ColorGrading>(out pp_cg);
        pp_cg.enabled.value = true;
        ppv.profile.TryGetSettings <LensDistortion>(out pp_ld);
        pp_ld.enabled.value = true;

        tpc = FindObjectOfType <MyTPCharacter>();
        SetCameraMode(CAMERA_MODE.BASE);

        GameObject l = GameObject.FindGameObjectWithTag("Lights");

        lights = new List <Light>(l.GetComponentsInChildren <Light>());

        _hideFX = Instantiate(_hideFXPrefab, transform);

        _canvas  = FindObjectOfType <Canvas>();
        _stamina = _canvas.transform.GetChild(0).GetComponent <Image>();
        _stamina.gameObject.SetActive(false);

        _state = PLAYER_STATE.NORMAL;
    }
示例#3
0
 // Start is called before the first frame update
 void Start()
 {
     minTimeBetweenPunches = GetMaxHitTime();
     tpc = FindObjectOfType <MyTPCharacter>();
     _cm = GetComponent <CameraMovement>();
 }