public void setChangeCam(InteractiveItemChangeCamera change)
 {
     changeCam = change;
 }
Exemplo n.º 2
0
        public IEnumerator EnterRoom(string levelIndex)
        {
            DoorBetweenLevels           door    = (DoorBetweenLevels)doors[levelIndex];
            InteractiveItemChangeCamera doorCam = null;

            if (door == null)
            {
                SetInCutScene(true, CutsceneTools.Type.ZoomIn, transform.position + Vector3.up * advCamera.yFollowOffset, false);

                if (!staticCharacter)
                {
                    ChangeStateToIdleBasedOnDirection();
                }

                if (!scene.stayInCutsceneAfterInitialState)
                {
                    SetInCutScene(false);
                }
            }
            else
            {
                autoPilotSpeed     = door.walkInOutSpeed;
                transform.position = door.gameObject.transform.position + door.outsideOffset;

                ProcessDirectionAndScale();
                doorCam = door.gameObject.GetComponent <InteractiveItemChangeCamera>();

                if (doorCam)
                {
                    StartCoroutine(doorCam.ProcessArrivedAt());
                }

                heldItem   = combiningItem = null;
                targetItem = null;

                Vector3 cameraPos = transform.position + Vector3.up * advCamera.yFollowOffset;

                cameraPos.z = -5;

                advCamera.Move(new Vector3(cameraPos.x, advCamera.transform.position.y, cameraPos.z), true);

                if (door.zoomoutCircleTransformPosition != null)
                {
                    SetInCutScene(true, CutsceneTools.Type.ZoomIn, door.zoomoutCircleTransformPosition.position, false, 0.01f, false);
                }
                else
                {
                    SetInCutScene(true, CutsceneTools.Type.ZoomIn, transform.position + Vector3.up * advCamera.yFollowOffset, false, 0.01f, false);
                }

                if (door.openCloseAnimator)
                {
                    transform.position = door.gameObject.transform.position + door.outsideOffset;
                    door.openCloseAnimator.SetBool("open", true);
                    ChangeStateToIdleBasedOnWalkAnimation(door.animationWalkIn);
                    yield return(new WaitForSeconds(0.7f));
                }

                if (!staticCharacter)
                {
                    ChangeState(door.animationWalkIn);   //mr 18.11.2014 to enable walk in front in
                }
                autoPilotTarget = door.insideOffset + door.gameObject.transform.position;

                autoPilotDelta = (door.insideOffset - door.outsideOffset);

                isInAutopilot = true;

                direction = transform.position.x < (autoPilotTarget.x) ? 1 : -1;

                ProcessDirectionAndScale(false);
                yield return(new WaitForSeconds(1 / autoPilotSpeed));

                isInAutopilot = false;
                if (!staticCharacter)
                {
                    ChangeStateToIdleBasedOnDirection();
                }

                InteractiveItem interactiveItemDoor = door.GetComponent <InteractiveItem>();
                if (interactiveItemDoor == null || interactiveItemDoor.realyStayInCutscene != true)
                {
                    SetInCutScene(false);
                }

                advCamera.CenterOnElroy();

                if (door.openCloseAnimator)
                {
                    door.openCloseAnimator.SetBool("open", false);
                }
            }
        }