private void Start() { originalParent = hookHolder.transform.parent; playerRB = GetComponent <Rigidbody>(); mainCamera = Camera.main; distanceToHook = float.MaxValue; AimCamera = mainCamera.GetComponent <MouseAimCamera>(); if (mainCamera == null) { Debug.LogWarning("No main camera"); } }
private void Start() { // Find the main camera and store a reference to it in myCamera. myCamera = GameObject.Find("MainCamera"); // Get the Rigibody component and store it in rb. rb = GetComponent <Rigidbody>(); // Do this for the camera's MouseAimCamera component as well. mac = myCamera.GetComponent <MouseAimCamera>(); #if CHEATS dnc = GameObject.Find("Sun").GetComponent <DayNightCycle>(); #endif hptext = GameObject.Find("HPCounter").GetComponent <Text>(); ft2 = GameObject.Find("FlavorTextUpper").GetComponent <FlavorText>(); aud = GameObject.Find("AudioController").GetComponent <AudioSource>(); myaud = GetComponent <AudioSource>(); ouch = (AudioClip)Resources.Load("Sound Effects/Yeouch"); jump = 2 * Vector3.up; spottedPlayer = (AudioClip)Resources.Load("Sound Effects/AirHorn"); greenscript = (GameObject)Resources.Load("Prefabs/GreenScript"); canvas = GameObject.Find("HUDCanvas"); UpdateHPText(); }
// Use this for initialization void Start() { mac = GameObject.Find("Camera").GetComponent<MouseAimCamera> (); pausePanel = GameObject.Find("PausePanel"); pausePanel.SetActive (false); }
// Use this for initialization void Start() { Camera = FindObjectOfType <MouseAimCamera>(); target = GameObject.Find("ThirdPersonController"); Vector3 offset = new Vector3(0f, -3f, 5.5f); }