예제 #1
0
    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;
    }
예제 #2
0
 private void SpawnFinished()
 {
     cineMan.SetCinematicMode(false);
     camController.FreeCameraPosition();
     Destroy(this.gameObject);
 }