public void Start() { //Application.targetFrameRate = 60; //SetupAnimator(); rb = GetComponent <Rigidbody>(); rb.angularDrag = 1000; rb.drag = 4; rb.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ; gameObject.layer = 8; ignoreLayers = LayerMask.GetMask("Default", "TransparentFX", "Ignore Raycast", "Water", "UI", "Ground", "Climbable"); deathBar = LayerMask.GetMask("deathBar"); player = GetComponent <PlayerMoveController>(); playerObj = GetComponent <Transform>(); cam = GameObject.Find("Main Camera").GetComponent <Camera>(); camMove = GameObject.Find("CameraMoveController").GetComponent <CameraMoveController>(); stamina = GameObject.Find("PlayerStaminaSlider").GetComponent <HealthStaminaScript>(); dataHandler = GameObject.Find("DataHandler").GetComponent <DataHandler>(); stepSFX = GameObject.Find("SFX_Step").GetComponent <AudioSource>(); dataHandler.OnSpawnLoad(); transform.position = dataHandler.data.playerPosition; }
private void OnCollisionEnter(Collision collision) { if (collision.gameObject.tag == "Player") { player = GameObject.FindGameObjectWithTag("PHealth") .GetComponent <HealthStaminaScript>(); player.value -= 10000; } }
void Start() { gameOverScreen = GameObject.Find("GameOverScreen"); player = GameObject.Find("PlayerMoveController"); cam = GameObject.FindGameObjectWithTag("MainCamera"); health = GameObject.Find("PlayerHealthSlider").GetComponent <HealthStaminaScript>(); gameOverImage = GameObject.Find("BackgroundImage").GetComponent <Image>(); arrowCount = GetComponent <ArrowCount>(); dataHandler = GameObject.Find("DataHandler").GetComponent <DataHandler>(); sceneSwitcher = GameObject.Find("LoadTransition").GetComponent <SceneSwitcher>(); gameOverScreen.SetActive(false); gameOverImage.color = new Color(0, 0, 0, 0); Time.timeScale = 1; }
void Start() { health = GameObject.Find("PlayerHealthSlider").GetComponent <HealthStaminaScript>(); }