Exemplo n.º 1
0
    private BlendedCameraBehavior AddNewBehavior(GameCameraBehavior newGameCamera, CameraLerp lerp)
    {
        if (GetNewestRunningBehaviorIndex() >= 0)                                                                                       // if there are any behaviors currently
        {
            if (GameCameraBehavior.AreInputParametersEqual(_runningBehaviors[GetNewestRunningBehaviorIndex()].behavior, newGameCamera)) // are we trying to add an exact same behavior?
            {
                return(null);                                                                                                           // no need to add a duplicate
            }

            if (BlendedCameraBehavior.IsTransitionImmediate(lerp)) // if it is a cut
            {
                _runningBehaviors.Clear();                         // can remove everything currently in the list as it will not effect output after cutting to new camera
            }
        }

        BlendedCameraBehavior newRunningBehavior = new BlendedCameraBehavior(lerp, newGameCamera);

        _runningBehaviors.Add(newRunningBehavior);

#if UNITY_EDITOR
        if (null != theEditor)
        {
            theEditor.Repaint();
        }
#endif
        return(newRunningBehavior);
    }
Exemplo n.º 2
0
    static public CameraLerp Create()
    {
        CameraLerp model = (CameraLerp)ScriptableObject.CreateInstance <CameraLerp>();

        model.name = InitialName;
        return(model);
    }
Exemplo n.º 3
0
    public void EnterFixedOffsetGameCamera(CameraLerp lerp)
    {
        if (BlendedCameraBehavior.IsTransitionImmediate(lerp))
        {
            _runningBehaviors.Clear();
        }

        AddNewBehavior(_gameCamera, lerp);
    }
Exemplo n.º 4
0
    static public void Stop()
    {
        if (null != activeDialogue)
        {
            // if animation tracks are specified, let that take care of exit animations
            if (!activeDialogue.exitAnimationSequence.ContainsTracks() && !activeDialogue.exitActions.ContainsAnmationTracks())
            {
                TriggerEndAnimations();
            }

            activeDialogue.exitAnimationSequence.Execute();
            activeDialogue.exitActions.Execute();

            Interaction activeInteraction = GetActiveInteraction();
            if (null != activeInteraction)
            {
                activeInteraction.ClearCharacterRotationLocks();
                activeInteraction.SwitchCharactersBackToPreviousTeam();
                activeInteraction.ClearCharacterInfo();
            }

            Dialogue.DialogueData.DialoguePointCamera exitCamera = activeDialogue.GetExitCamera();
            if (null != exitCamera)
            {
                Interaction.SetUpNewCamera(exitCamera, null, activeDialogue.dialoguePoints);
            }
            else if (!activeDialogue.exitActions.ContainsCameraAction() && null != Camera.main)
            {
                CameraBase cameraComponent = Camera.main.gameObject.GetComponent <CameraBase>();
                if (null != cameraComponent)
                {
                    CameraLerp defaultDialogueLerp = GlobalDialogueData.Instance.defaultDialogueLerp;
                    cameraComponent.EnterFixedOffsetGameCamera(defaultDialogueLerp);
                }
            }

            if (!activeDialogue.isDuringGameplay && activeDialogue.removeDialogueHUDOnExit)
            {
                UIStack.Instance.BackStack();
            }
            activeDialogue = null;

            if (null != onInteractionEnd)
            {
                onInteractionEnd();
            }
            EventManager.instance.Raise(new DialogueEvent(DialogueEvent.EventType.stop));
        }
    }
Exemplo n.º 5
0
    public void EnterNpcCameraMotion(GameObject target)
    {
        if (!IsUseCameraEffect)
        {
            return;
        }

        List <GameObject> targets = new List <GameObject>();

        targets.Add(target);
        GameCameraParams gameCameraParams = GlobalCameraData.Instance.FindGameCameraParamsByName("NpcDialogueData");
        CameraLerp       motion_lerp      = GlobalCameraData.Instance.FindGameCameraLerpByName("dialogue lerp"); //npcDialogueCamMotion.cameraLerpOverride

        EnterInteractionCamera(ref targets, ref gameCameraParams, motion_lerp);
        HideMainMenu();
    }
Exemplo n.º 6
0
    public void SwitchToBattleResultCamera()
    {
        EB.Debug.Log("[CombatCamera]SwitchToBattleResultCamera");

        DisableBlurEffect();
        CameraMotion motion = GlobalCameraMotionData.Instance.GetCameraMotion(m_battleResultCameraData);

        if (motion != null)
        {
            List <GameObject> targets = new List <GameObject>();
            targets.Add(m_skill_select_lookat_locator);
            GameCameraParams gameCameraParams = (GameCameraParams)motion.camera;
            CameraLerp       motion_lerp      = motion.cameraLerpOverride;
            EnterInteractionCamera(ref targets, ref gameCameraParams, motion_lerp);
        }
    }
Exemplo n.º 7
0
    protected void UpdateCameraBehaviors(float delatTime)
    {
        //if (Application.isPlaying) // we only want the output from the running behaviors if we're playing
        //{
        for (int running = GetOldestRunningBehaviorIndex(); running <= GetNewestRunningBehaviorIndex(); ++running)
        {
            if (_gameCamera != _runningBehaviors[running].behavior)                     // we don't tick the game camera here, as that is already ticked in the update function
            {
                _runningBehaviors[running].behavior.Update(this, delatTime);
            }

            if (!_runningBehaviors[running].HasLerpStyleBeenSet())
            {
                GameCameraBehavior olderBehavior = (GetOldestRunningBehaviorIndex() == running) ? null : _runningBehaviors[running - 1].behavior;
                _runningBehaviors[running].lerpStyle = CameraLerp.DetermineBestLerpStyle(olderBehavior, _runningBehaviors[running].behavior);
            }

            _runningBehaviors[running].behavior.GetLookAt(ref _runningBehaviorResult.lookAt);
            _runningBehaviors[running].behavior.GetRotation(ref _runningBehaviorResult.rotation);
            _runningBehaviorResult.distFromLookAt = _runningBehaviors[running].behavior.GetDistFromLookAt();

            // oldest camera is always fully blended in
            float lerp = 1f;
            if (NeedCalculateLerp(running))
            {
                lerp = Mathf.Clamp01(_runningBehaviors[running].CalculateLerpValue());
            }
            float smoothedLerp      = 1f;
            float smoothedLerpPitch = 1f;
            float smoothedLerpYaw   = 1f;
            if (NeedSmoothRunningBehavior(running))                     // not the oldest running cam and not fully blended in
            {
                smoothedLerp      = Cinematic.Smooth(lerp, _runningBehaviors[running].lerp.dialogueCameraLerpSmoothing, _runningBehaviors[running].lerp.animationCurve);
                smoothedLerpPitch = Cinematic.Smooth(lerp, _runningBehaviors[running].lerp.pitchLerpSmoothing, _runningBehaviors[running].lerp.curvePitchLerp);
                smoothedLerpYaw   = Cinematic.Smooth(lerp, _runningBehaviors[running].lerp.yawLerpSmoothing, _runningBehaviors[running].lerp.curveYawLerp);
            }
            BlendedCameraBehavior.BlendedCameraOutput.Lerp(ref _blendedResult, ref _blendedResult, ref _runningBehaviorResult,
                                                           _runningBehaviors[running].lerpStyle, smoothedLerp, smoothedLerpPitch, smoothedLerpYaw);
            _gameCameraPosition = _blendedResult.CalculatePosition();
            _gameCameraRotation = _blendedResult.rotation;
        }
        //}
        RemoveRunningBehaviors();
    }
Exemplo n.º 8
0
        private void OnTriggerExit(Collider collision)
        {
            if (!playerController._isLocalPlayer)
            {
                return;
            }
            GameObject other  = collision.gameObject;
            string     npc_id = other.name;

            if (SceneLogicManager.CurrentSceneLogic != null)
            {
                string scene_name = SceneLogicManager.CurrentSceneLogic.CurrentSceneName;
                if (IsFunctionNPC(npc_id, scene_name))
                {
                    if (PlayerController.onCollisionExit != null)
                    {
                        PlayerController.CurNpcCollision = null;
                        PlayerController.onCollisionExit(collision.gameObject.name);
                    }
                }
            }

            LTCameraTrigger ct = other.GetComponent <LTCameraTrigger>();

            if (ct != null)
            {
                Camera mainCam = getMainCamera();
                if (mainCam != null)
                {
                    PlayerCameraComponent pcc = mainCam.GetComponent <PlayerCameraComponent>();
                    if (pcc != null)
                    {
                        //pcc.ResetCameraState();
                        GameCameraParams  gameCameraParams = GlobalCameraData.Instance.FindGameCameraParamsByName("game cam default");
                        CameraLerp        motion_lerp      = GlobalCameraData.Instance.FindGameCameraLerpByName("dialogue lerp");
                        List <GameObject> listGO           = new List <GameObject>();
                        listGO.Add(mDMono.gameObject);
                        pcc.EnterInteractionCamera(ref listGO, ref gameCameraParams, motion_lerp);
                    }
                }
            }
        }
Exemplo n.º 9
0
    public void OnTeamsVictoryListener()
    {
        if (!string.IsNullOrEmpty(m_teamsSpawnCameraData) && m_teams_victory_lookat_locator != null)
        {
            CameraMotion motion = GlobalCameraMotionData.Instance.GetCameraMotion(m_teamsSpawnCameraData);
            if (motion != null)
            {
                try
                {
                    // stop lerp back
                    DOTween.KillAll(true);
                }
                catch (System.IndexOutOfRangeException e)
                {
                    EB.Debug.LogError(e.ToString());
                }

                _runningBehaviors.Clear();
                List <GameObject> targets = new List <GameObject>();
                targets.Add(m_teams_victory_lookat_locator);

                GameCameraParams gameCameraParams = (GameCameraParams)motion.camera;
                if (gameCameraParams == null)
                {
                    Debug.LogError("OnTeamsVictoryListener gameCameraParams is null");
                }
                CameraLerp motion_lerp = motion.cameraLerpOverride;
                if (motion_lerp == null)
                {
                    Debug.LogError("OnTeamsVictoryListener motion_lerp is null");
                }
                else
                {
                    motion_lerp.dialogueCameraLerpTime = 5f;
                    motion_lerp.hangonTime             = int.MaxValue;
                }
                EnterInteractionCamera(ref targets, ref gameCameraParams, motion_lerp);
            }
        }
    }
Exemplo n.º 10
0
        public BlendedCameraBehavior(CameraLerp lerp, GameCameraBehavior behavior)
        {
            if (Application.isPlaying)
            {
                transitionStartTime = Time.time;
            }
            else
            {
                transitionStartTime = Time.realtimeSinceStartup;
            }
            this.lerp = lerp;

            if (null != lerp)
            {
                lerpStyle = lerp.lerpStyle;
            }
            else
            {
                lerpStyle = CameraLerp.LerpStyle.positionToPosition;
            }
            this.behavior = behavior;
        }
Exemplo n.º 11
0
 //  public override void EnterInteractionCamera(ref List<GameObject> targets, ref GameCameraParams gameCamParams, CameraLerp lerp)
 public override BlendedCameraBehavior EnterInteractionCamera(ref List <GameObject> targets, ref GameCameraParams gameCamParams, CameraLerp lerp)
 {
     base.EnterInteractionCamera(ref targets, ref gameCamParams, lerp);
     _gameCameraPosition = transform.position;
     _gameCameraRotation = transform.rotation;
     if (m_lookat_locator != null)
     {
         _blendedResult.lookAt = m_lookat_locator.transform.position;
         Vector3 lookForward = m_lookat_locator.transform.position - transform.position;
         lookForward.Normalize();
         _blendedResult.rotation       = Quaternion.LookRotation(lookForward);
         _blendedResult.distFromLookAt = Vector3.Distance(transform.position, m_lookat_locator.transform.position);
     }
     MainCamera.nearClipPlane = gameCamParams.clipNear;//增加对摄像机近裁剪面的控制
     State = MotionState.Lerping;
     return(null);
 }
Exemplo n.º 12
0
    public virtual BlendedCameraBehavior EnterInteractionCamera(ref List <GameObject> targets, ref GameCameraParams gameCamParams, CameraLerp lerp)
    {
        GameCameraBehavior newGameCamera = new GameCameraBehavior(ref targets, ref gameCamParams, this);

        return(AddNewBehavior(newGameCamera, lerp));
    }
Exemplo n.º 13
0
 static public bool IsTransitionImmediate(CameraLerp lerp)
 {
     return(null == lerp || IsTransitionImmediate(lerp.dialogueCameraLerpTime));
 }
Exemplo n.º 14
0
    // turn on the type of camera we need for this conversation step
    static public void SetUpNewCamera(Dialogue.DialogueData.DialoguePointCamera conversation, CharacterModel inputCaller, List <Dialogue.DialogueData.DialoguePoint> dialoguePoints)
    {
        if (null == conversation.camera)
        {
            return;
        }

        CameraLerp cameraLerp = (null != conversation.cameraLerpOverride) ? conversation.cameraLerpOverride : GlobalDialogueData.Instance.defaultDialogueLerp;

        System.Type cameraType = conversation.camera.GetType();
        if (typeof(GameCameraParams) == cameraType)
        {
            if (null != Camera.main)
            {
                CameraBase cameraComponent = Camera.main.GetComponent <CameraBase>();

                GameCameraParams gameCameraParams = (GameCameraParams)conversation.camera;
                switch (conversation.targets)
                {
                case Dialogue.DialogueData.DialoguePointCamera.CameraTargets.localPlayer:
                    if (gameCameraParams.gameCamera)
                    {
                        cameraComponent.EnterFixedOffsetGameCamera(cameraLerp);
                    }
                    else
                    {
                        PlayerController controller = PlayerManager.LocalPlayerController();
                        if (null != controller)
                        {
                            List <GameObject> target = new List <GameObject>();
                            target.Add(controller.gameObject);
                            cameraComponent.EnterInteractionCamera(ref target, ref gameCameraParams, cameraLerp);
                        }
                    }
                    break;

                case Dialogue.DialogueData.DialoguePointCamera.CameraTargets.all:
                    List <GameObject> targets = new List <GameObject>();
                    Interaction.GetAllInteractionParticipants(ref targets, dialoguePoints);
                    if (targets.Count > 0)
                    {
                        cameraComponent.EnterInteractionCamera(ref targets, ref gameCameraParams, cameraLerp);
                    }
                    break;

                case Dialogue.DialogueData.DialoguePointCamera.CameraTargets.caller:
                    GameObject caller = GlobalUtils.FindCharacter(inputCaller);
                    if (null != caller)
                    {
                        if (inputCaller.isPlayer && gameCameraParams.gameCamera)
                        {
                            cameraComponent.EnterFixedOffsetGameCamera(cameraLerp);
                        }
                        else
                        {
                            List <GameObject> target = new List <GameObject>();
                            target.Add(caller);
                            cameraComponent.EnterInteractionCamera(ref target, ref gameCameraParams, cameraLerp);
                        }
                    }
                    break;

                default: break;
                }
            }
        }
        else if (typeof(CinematicCameraParams) == cameraType)
        {
            if (null != conversation.cinematic)
            {
                if (conversation.IsCinematicAPrefabRequiringInstantiation())
                {
                    GameObject cinematicObject = (GameObject)GameObject.Instantiate(conversation.cinematic);
                    if (null != cinematicObject && cinematicObject.activeInHierarchy)
                    {
                        Cinematic.Play(cinematicObject.GetComponent <Cinematic>(), PlayerManager.LocalPlayerGameObject());
                    }
                }
                else
                {
                    Cinematic.Play(conversation.cinematic.GetComponent <Cinematic>(), PlayerManager.LocalPlayerGameObject());
                }
            }
        }
    }
Exemplo n.º 15
0
    public override BlendedCameraBehavior EnterInteractionCamera(ref List <GameObject> targets, ref GameCameraParams gameCamParams, CameraLerp lerp)
    {
        _curCameraMotion = base.EnterInteractionCamera(ref targets, ref gameCamParams, lerp);

        //_runningBehaviors[1].behavior.SetRotation(targets[0].transform.rotation);
        return(null);
    }
Exemplo n.º 16
0
 private void Awake()
 {
     cl = this;
 }
Exemplo n.º 17
0
        private void OnTriggerEnter(Collider collision)
        {
            if (!playerController._isLocalPlayer || SceneLogicManager.CurrentSceneLogic == null)
            {
                return;
            }
            GameObject other      = collision.gameObject;
            string     npc_id     = other.name;
            string     scene_name = SceneLogicManager.CurrentSceneLogic.CurrentSceneName;

            if (IsFunctionNPC(npc_id, scene_name))
            {
                if (HasUIModel(npc_id, scene_name, "DeliveryDart") && AlliancesManager.Instance.DartData.State == eAllianceDartCurrentState.Transfering)
                {
                    GlobalMenuManager.Instance.CloseMenu("LTApplyHelpUI");
                    NpcColliderUI.DeliveryDart();
                }
                else
                {
                    var ht = Johny.HashtablePool.Claim();
                    ht.Add("npc", npc_id);
                    ht.Add("scene", scene_name);
                    MainLandEncounterTemplate met = SceneTemplateManager.GetMainLandsNPCData(scene_name, npc_id);
                    if (met.role == "area")
                    {
                        ht.Add("area", true);
                    }
                    if (PlayerController.onCollisionOpen != null)
                    {
                        PlayerController.CurNpcCollision = collision;
                        PlayerController.onCollisionOpen(ht);
                    }
                }

                LTCameraTrigger ct = other.GetComponent <LTCameraTrigger>();
                if (ct != null)
                {
                    Camera mainCam = getMainCamera();
                    if (mainCam != null)
                    {
                        PlayerCameraComponent pcc = mainCam.GetComponent <PlayerCameraComponent>();
                        if (pcc != null)
                        {
                            if (!string.IsNullOrEmpty(ct.triggerGameCameraParamName))
                            {
                                GameCameraParams  gameCameraParams = GlobalCameraData.Instance.FindGameCameraParamsByName(ct.triggerGameCameraParamName);
                                CameraLerp        motion_lerp      = GlobalCameraData.Instance.FindGameCameraLerpByName("dialogue lerp");
                                List <GameObject> listGO           = new List <GameObject>();
                                listGO.Add(mDMono.gameObject);
                                pcc.EnterInteractionCamera(ref listGO, ref gameCameraParams, motion_lerp);
                            }
                        }
                    }
                    else
                    {
                        GameObject cam = GameObject.Find("Main Camera");
                        if (cam != null)
                        {
                            PlayerCameraComponent pcc = cam.GetComponent <PlayerCameraComponent>();
                            if (pcc != null)
                            {
                                EB.Debug.Log("Can Find Main Camera!");
                                if (!string.IsNullOrEmpty(ct.triggerGameCameraParamName))
                                {
                                    GameCameraParams  gameCameraParams = GlobalCameraData.Instance.FindGameCameraParamsByName(ct.triggerGameCameraParamName);
                                    CameraLerp        motion_lerp      = GlobalCameraData.Instance.FindGameCameraLerpByName("dialogue lerp");
                                    List <GameObject> listGO           = new List <GameObject>();
                                    listGO.Add(mDMono.gameObject);
                                    pcc.EnterInteractionCamera(ref listGO, ref gameCameraParams, motion_lerp);
                                }
                            }
                        }
                    }
                }
            }
            else if (other.name.Equals("NPCSpawns_F"))                        //与决斗场模型碰撞,需移动到出生点
            {
                playerController.transform.position = SceneManager.HeroStart; //如果是角斗场雕像,跳转到初始位置
            }
            else
            {
                LTCameraTrigger ct = other.GetComponent <LTCameraTrigger>();
                if (ct != null)
                {
                    Camera mainCam = getMainCamera();//Camera.main;

                    if (mainCam != null)
                    {
                        PlayerCameraComponent pcc = mainCam.GetComponent <PlayerCameraComponent>();
                        if (pcc != null)
                        {
                            if (!string.IsNullOrEmpty(ct.triggerGameCameraParamName))
                            {
                                GameCameraParams  gameCameraParams = GlobalCameraData.Instance.FindGameCameraParamsByName(ct.triggerGameCameraParamName);
                                CameraLerp        motion_lerp      = GlobalCameraData.Instance.FindGameCameraLerpByName("dialogue lerp");
                                List <GameObject> listGO           = new List <GameObject>();
                                listGO.Add(mDMono.gameObject);
                                pcc.EnterInteractionCamera(ref listGO, ref gameCameraParams, motion_lerp);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 18
0
    public void BlendCurrentCamera(ref List <GameObject> targets, float distOffset, float pitchOffset, float yawOffset, float heightOffset, CameraLerp lerp)
    {
        GameCameraParams param = ScriptableObject.CreateInstance <GameCameraParams>();

        if (param == null)
        {
            EB.Debug.LogError("Failed to create GameCameraParams instance in CombatCamera.BlendCurrentCamera");
        }

        if (targets == null || targets.Count == 0)
        {
            return;
        }

        Vector3 target_pos = GameUtils.CalculateBoundsWithOffset(targets).center;
        Vector3 camera_pos = transform.position;
        float   dist       = Vector3.Distance(camera_pos, target_pos);

        param.distance     = dist + distOffset;
        param.pitch        = pitchOffset;
        param.yawOffset    = yawOffset;
        param.heightOffset = heightOffset;
        EnterInteractionCamera(ref targets, ref param, lerp);
    }
Exemplo n.º 19
0
        public void Play()
        {
            _played = true;

            //CameraMotionEventProperties info = _event._cameraMotionProperties;

            //if(info._motionTarget == CameraMotionTarget.OriginView)
            //{
            //m_target_pos = CameraMotionPreviewManager.Instance.OriginPos;
            //m_target_angle = CameraMotionPreviewManager.Instance.OriginAngle;
            //}
            //else
            {
                //Vector3 pos_offset = info._posOffset;

                //if(info._useLocalOffset)
                //{
                //m_target_pos = _focusObject.transform.TransformPoint(pos_offset);
                //}
                //else
                //{
                //m_target_pos = _focusObject.transform.position + pos_offset;
                //}

                //m_target_angle = info._targetAngle;
            }


            //CombatCamera combat_camera = CameraMotionPreviewManager.Instance._previewCamera;
            //if(combat_camera != null)
            //{
            //	//combat_camera.OnCameraMotion(m_target_pos, m_target_angle, info._lerpCurve, info._lerpDuration);
            //}


            MoveEditor.CameraMotionEventInfo       info        = _event;
            MoveEditor.CameraMotionEventProperties motionProps = info._cameraMotionProperties;

            //if (motionProps._motionTrigger == MoveEditor.CameraMotionTrigger.LocalPlayerOnly)
            //{
            //    if (Index.TeamIndex != CombatLogic.Instance.LocalPlayerTeamIndex)
            //    {
            //        return;
            //    }
            //}
            //else if (motionProps._motionTrigger == MoveEditor.CameraMotionTrigger.EnemyOnly)
            //{
            //    if (CombatLogic.Instance.IsPlayerOrChallengerSide(Data.TeamId))
            //    {
            //        return;
            //    }
            //    //if (!Data.IsEnemy)
            //    //{
            //    //    return;
            //    //}
            //}

            if (Camera.main != null)
            {
                CombatCamera combat_camera = Camera.main.GetComponent <CombatCamera>();
                //if (!combat_camera.m_enablePlayerOrChallengerMotion && CombatLogic.Instance.IsPlayerOrChallengerSide(Index.TeamIndex))
                //{
                //    return;
                //}
                //if (!combat_camera.m_enableOpponentMotion && CombatLogic.Instance.IsOpponentSide(Index.TeamIndex))
                //{
                //    return;
                //}
                string camera_motion_json = motionProps._motionOptions;
                List <MoveEditor.CameraMotionOption> options = GM.JSON.ToObject <List <MoveEditor.CameraMotionOption> >(camera_motion_json);
                List <GameObject> targets = new List <GameObject>();
                if (motionProps._motionTarget == MoveEditor.CameraMotionTarget.Attacker)
                {
                    targets.Add(_previewGameObject);
                }
                else if (motionProps._motionTarget == MoveEditor.CameraMotionTarget.Defenders)
                {
                    targets.Add(_previewHitGameObject);
                }
                else if (motionProps._motionTarget == MoveEditor.CameraMotionTarget.All)
                {
                    targets.Add(_previewGameObject);
                    targets.Add(_previewHitGameObject);
                }
                else if (motionProps._motionTarget == MoveEditor.CameraMotionTarget.DefendersCameraAnchor)
                {
                    //Debug.LogError("现在不支持DefendersCameraAnchor这种类型");
                    //GameObject anchor = CombatEventReceiver.Instance.defenderSide.Find(CombatEventReceiver.Instance.defenderFormation + "/f2").gameObject;
                    //if (anchor != null)
                    //{
                    //    targets.Add(anchor);
                    //}
                    //else
                    //{
                    //    EB.Debug.LogError("Combatant.OnCameraMotion Can not find DefendersCameraAnchor GameObject");
                    //    return;
                    //}
                }

                if (combat_camera != null)
                {
                    if (motionProps._blendCurrentCamera)
                    {
                        if (motionProps._onlyLookAtTarget)
                        {
                            combat_camera.CurrentCameraLookAt(ref targets, motionProps._hangonDuration);
                        }
                        else
                        {
                            CameraLerp lerp = CameraLerp.Create();
                            lerp.lerpStyle = CameraLerp.LerpStyle.determineAtRunTime;
                            lerp.dialogueCameraLerpSmoothing = motionProps._blendLerpSmoothing;
                            lerp.animationCurve         = motionProps._blendLerpCurve;
                            lerp.dialogueCameraLerpTime = motionProps._lerpDuration;
                            lerp.pitchLerpSmoothing     = motionProps._blendPitchLerpSmoothing;
                            lerp.curvePitchLerp         = motionProps._blendPitchLerpCurve;
                            lerp.yawLerpSmoothing       = motionProps._blendYawLerpSmoothing;
                            lerp.curveYawLerp           = motionProps._blendYawLerpCurve;
                            lerp.hangonTime             = motionProps._hangonDuration;
                            combat_camera.BlendCurrentCamera(ref targets, motionProps._blendDistanceOffset, motionProps._blendPitchOffset,
                                                             motionProps._blendYawOffset, motionProps._blendHeightOffset, lerp);
                        }
                    }
                    else
                    {
                        //int count = options.Count;
                        MoveEditor.CameraMotionOption option = MoveEditor.MoveUtils.GetCamermotionLottery(ref options, false);
                        if (option != null)
                        {
                            //Debug.LogError("OnCameraMotion != null cbt=" + Data.ToString());
                            CameraMotion motion = GlobalCameraMotionData.Instance.GetCameraMotion(option._motionName);
                            if (motion != null)
                            {
                                combat_camera.State = CombatCamera.MotionState.Lerping;
                                //MyFollowCamera.Instance.isActive = false;
                                GameCameraParams gameCameraParams = (GameCameraParams)motion.camera;
                                CameraLerp       motion_lerp      = motion.cameraLerpOverride;
                                motion_lerp.dialogueCameraLerpTime = motionProps._lerpDuration;
                                motion_lerp.hangonTime             = motionProps._hangonDuration;
                                combat_camera.EnterInteractionCamera(ref targets, ref gameCameraParams, motion_lerp);
                            }
                        }
                    }
                }
            }
        }