void Start() { objectCollider = gameObject.GetComponent <Collider>(); sp = GameObject.FindGameObjectWithTag("Player").GetComponent <ShootPortal> (); rb = GetComponent <Rigidbody>(); efc = GetComponent <ExtendedFlycam> (); npb = GetComponent <NewPlayerBehaviour> (); bluePortal = GameObject.FindGameObjectWithTag("BluePortal"); orangePortal = GameObject.FindGameObjectWithTag("OrangePortal"); }
void Start() { objectCollider = gameObject.GetComponent <Collider>(); sp = GameObject.FindGameObjectWithTag("Player").GetComponent <ShootPortal>(); rb = GetComponent <Rigidbody>(); efc = GetComponent <ExtendedFlycam>(); npb = GetComponent <NewPlayerBehaviour>(); co = GameObject.Find("NewPlayer").GetComponent <CarryObject>(); targetTransform = GameObject.Find("TargetPosition").transform; startPosition = Camera.main.transform.InverseTransformPoint(targetTransform.position); bluePortal = GameObject.FindGameObjectWithTag("BluePortal"); orangePortal = GameObject.FindGameObjectWithTag("OrangePortal"); print(startPosition); }
// Start is called before the first frame update void Start() { gm = GetComponent <GameManager>(); camController = Camera.main.GetComponent <ExtendedFlycam>(); timeScaleSliderText = timeScaleSlider.GetComponentInChildren <Text>(); spawnNumSliderText = spawnNumSlider.GetComponentInChildren <Text>(); moveNumSliderText = moveNumSlider.GetComponentInChildren <Text>(); mutationRateSliderText = mutationRateSlider.GetComponentInChildren <Text>(); sensitivitySliderText = sensitivitySlider.GetComponentInChildren <Text>(); goalDistanceSliderText = goalDistanceSlider.GetComponentInChildren <Text>(); goal = GameObject.FindGameObjectWithTag("Goal").transform; SetTimeScale(); SetSpawnNum(); SetMoveNum(); SetMutationRate(); SetSensitivity(); SetGoalDistance(); }
// Update is called once per frame void Update() { // + mors // Изменение режима if (Input.GetKeyUp(KeyCode.F12)) { // Тут нужно поменять на событие. GlobalOptions.SwitchMode(); CameraRotationAroundMotor motor1 = Camera.main.GetComponent <CameraRotationAroundMotor>(); ExtendedFlycam motor2 = Camera.main.GetComponent <ExtendedFlycam>(); if (GlobalOptions.isEditMode) { motor1.enabled = false; } else { motor1.enabled = true; } motor2.enabled = !motor1.enabled; } // - mors if (GlobalOptions.isPlayMode) { PlayModeControl(); return; } if (GlobalOptions.isEditMode) { EditModeControl(); return; } }
private void Start() { CurrentIndicator = Instantiate(IndicatorPrefab, Vector3.zero, Quaternion.identity); ExtendedFlycam = Camera.main.GetComponent <ExtendedFlycam>(); }