// Update is called once per frame void Update() { if (charScript == null) { charScript = GetComponentInParent <TombiCharacterController>(); } }
// Start is called before the first frame update void Start() { charScript = FindObjectOfType <TombiCharacterController>(); //ikHandler = charScript.GetComponent<IKHandler>(); coll = this.GetComponent <SphereCollider>(); if (charScript != null) { rigidBody = charScript.GetComponent <Rigidbody>(); } camScript = FindObjectOfType <Typo.Utilities.Cameras.BasicCameraController>(); currentActiveRail = FindObjectOfType <PlayerMovementRailV1>(); oldSwingForceMultiplier = swingForceMultiplier; }
protected override void Awake() { base.Awake(); iniRot = transform.eulerAngles; charScript = FindObjectOfType <TombiCharacterController>(); collCapsule = charScript.GetComponent <CapsuleCollider>(); // Set initial rotation and distance Rotation.Rotate(InitialHorizontalRotation, InitialVerticalRotation); _previousDistance = DesiredDistance; // Then let update handle everything UpdateCamera(); CameraTransform.ApplyTo(Camera); Debug.Log("Test"); }
// Start is called before the first frame update void Start() { charScript = FindObjectOfType <TombiCharacterController>(); if (hinge == null) { Debug.LogError("Hinge not assigned to swing object!"); } if (swinger == null) { Debug.LogError("Swinger not found in swing object!"); } if (subCollider1 != null) { subCollider1.transform.position = new Vector3(this.transform.position.x - 1.1f, this.transform.position.y - 0.08f, hinge.transform.position.z); } if (subCollider2 != null) { subCollider2.transform.position = new Vector3(this.transform.position.x + 1.1f, this.transform.position.y - 0.08f, hinge.transform.position.z); } }
// Start is called before the first frame update void Start() { charScript = FindObjectOfType <TombiCharacterController>(); }
// The coroutine runs on its own at the same time as Update() and takes an integer indicating which scene to load. private IEnumerator LoadNewScene(int sceneIndex) { while (fadingOut) { yield return(null); } FindObjectOfType <AudioManager>().StopAllSounds(); // Start an asynchronous operation to load the scene that was passed to the LoadNewScene coroutine. AsyncOperation asyncLoadingScreen = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(2); while (!asyncLoadingScreen.isDone) { yield return(null); } transitionImage.enabled = false; yield return(new WaitForSeconds(1)); AsyncOperation asyncLoadScene = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(sceneIndex); // While the asynchronous operation to load the new scene is not yet complete, continue waiting until it's done. while (!asyncLoadScene.isDone) { yield return(null); } loadScene = false; FindObjectOfType <AudioManager>().UpdateSceneTheme(sceneIndex); TombiCharacterController charScript = FindObjectOfType <TombiCharacterController>(); Typo.Utilities.Cameras.BasicCameraController camScript = FindObjectOfType <Typo.Utilities.Cameras.BasicCameraController>(); LevelInfo lInfo = FindObjectOfType <LevelInfo>(); if (lInfo != null) { if (lInfo.isIsometric) { charScript.movementSettings.lockZMovement = false; charScript.movementSettings.moveOnly = true; camScript.Rotation.SetRotation(45f, 45f); camScript.DesiredDistance = 8; camScript.MaxZoomDistance = 8; camScript.MinZoomDistance = 8; } else { charScript.movementSettings.lockZMovement = true; charScript.movementSettings.moveOnly = false; camScript.DesiredDistance = 6; camScript.MaxZoomDistance = 6; camScript.MinZoomDistance = 6; } } if (scenes[sceneIndex].inTransition) { fadingIn = true; StartCoroutine(FadeIn()); if (camScript != null) { camScript.smoothCameraPosition = false; } while (fadingIn) { yield return(null); } } if (scenes[sceneIndex].skyboxMaterial != null) { RenderSettings.skybox = scenes[sceneIndex].skyboxMaterial; } if (camScript != null) { camScript.smoothCameraPosition = true; } if (sceneIndex == 1) { scene = 5; } }