Beispiel #1
0
    IEnumerator MoveCameraThenLaunch(Actor launchingAgent, float xAngle, float yAngle)
    {
        //wait until the overhead camera has the shot, then launch
        while (!CinemachineCore.Instance.IsLive(launchingAgent.vCamOverhead))
        {
            yield return(new WaitForEndOfFrame());
        }

        yield return(new WaitForSeconds(1f));

        freezeMaster.FreezeRigidBodies(false);

        Transform projectile = launchingAgent.LaunchProjectile(xAngle);

        launchingAgent.vCamOverhead.LookAt = projectile;
        launchingAgent.ClearAiming();  //must be after launch projectile

        //vClearShotCam.LookAt = projectile;
        //foreach (CinemachineVirtualCamera vCam in vClearShotCam.GetComponentsInChildren<CinemachineVirtualCamera>())
        //vCam.LookAt = projectile
    }