Ejemplo n.º 1
0
    private void OnTargetSelect(EventInfo pInfo)
    {
        CameraTargetSelectEventInfo info = pInfo as CameraTargetSelectEventInfo;

        if (info != null)
        {
            //If the next and previous points are identical, keep the next but set the previous to the camera's current postion
            //Useful on start since the camera has not yet focused a roomset before
            info.FocalA.position = info.FocalA.position == info.FocalB.position  ? cam.transform.position : info.FocalA.position;
            Vector3[] list = new Vector3[] { info.FocalA.position, info.FocalB.position, info.FocalB.position };

            for (int i = 0; i < targetList.Length; i++)
            {
                float zoom = i < targetList.Length - 1 ? Settings.VAL_CAMERA_ZOOM_DISTANCE : 0.0f;
                Debug.Log("Setting zoom for pos " + i + " to: " + zoom);
                SetTargetList(i, list[i], zoom);
            }

            handler += MoveToTarget;
        }
        else
        {
            //Notifies the user that this event is not being acted upon correctly since the EventInfo cannot be cast and lists the current method and class for easy back-searching
            Debug.Log(
                System.String.Format(EventSystem.STR_INCORRECT_EVENT_TYPE_CAST, System.Reflection.MethodBase.GetCurrentMethod().Name, GetType().FullName));
        }
    }
Ejemplo n.º 2
0
    private void OnNextRoomCommand(EventInfo pInfo)
    {
        currentRoom.y = currentRoom.x;
        currentRoom.x++;
        Mathf.Clamp(currentRoom.x, 0, Settings.SYS_VAL_MAX_NUMBER_ROOM_FOCALS);
        //Focal A is current. Focal B is next. Current[New, Old]
        CameraTargetSelectEventInfo newInfo = new CameraTargetSelectEventInfo(EventSystem.DESC_EVENT_CAMERA_TARGET, roomFocalPoints[currentRoom.y], roomFocalPoints[currentRoom.x]);

        EventSystem.ExecuteEvent(EventType.CAMERA_TARGET_SELECT, newInfo);
    }