private void Start() { cineMan = GameManager.instance.cinematicManager; GetCoordinates(); if (!cineMan.areCinematicsEnabled) { GameManager.instance.gridManagement.SpawnBlock(spatioportID, coordinates); DestroyImmediate(gameObject); return; } camController = FindObjectOfType <CameraController>(); cameraShake = cineMan.gameObject.GetComponent <CameraShake>(); endPosition = camController.gameDummy.transform.position; endRotation = camController.gameDummy.transform.rotation; camController.FreezeCameraPosition(); camController.SetCameraPositionAndRotation(cameraDummy.transform.position, cameraDummy.transform.rotation); cineMan.SetCinematicMode(true); GetComponent <Animator>().SetTrigger("StartAnimation"); transform.position = GameManager.instance.gridManagement.IndexToWorldPosition(coordinates); shipGameObject = transform.Find("Ship").gameObject; }
private void SpawnFinished() { cineMan.SetCinematicMode(false); camController.FreeCameraPosition(); Destroy(this.gameObject); }