void Start()
    {
        _virtualCam = GetComponent <CinemachineMixingCamera>();
        ResetCamWeights();

        TrackPlayer();
    }
Beispiel #2
0
 private void Start()
 {
     volume         = GetComponent <WeightVolume>();
     brain          = Camera.main.GetComponent <CinemachineBrain>();
     mixer          = GetComponent <CinemachineMixingCamera>();
     mixer.Priority = 99;
     mixer.enabled  = false;
 }
Beispiel #3
0
 void Start()
 {
     if (followTarget)
     {
         _vcam           = GetComponent <CinemachineMixingCamera>();
         _vcam.m_Weight0 = initialBottomWeight;
     }
 }
 private void Start()
 {
     CamActive = 0;
     MixCam    = GetComponent <CinemachineMixingCamera>();
     MixCam.SetWeight(0, 1);
     for (int i = 1; i < MixCam.ChildCameras.Length; i++)
     {
         MixCam.SetWeight(i, 0);
     }
 }
    private void Start()
    {
        volume = GetComponent <WeightVolume>();

        if (mixer == null)
        {
            mixer = (CinemachineMixingCamera)gameObject.AddComponent(typeof(CinemachineMixingCamera));
        }
        mixer.Priority = 99;
        mixer.enabled  = false;

        cameraADefaultParent = cameraA.transform.parent;
        cameraBDefaultParent = cameraB.transform.parent;
    }
    void Start()
    {
        _virtualCam           = GetComponent <CinemachineMixingCamera>();
        _virtualCam.m_Weight0 = 1.0f;
        _virtualCam.m_Weight1 = 0.0f;

        _blend = 0.0f;

        if (PlayerManager.CurrentPlayer)
        {
            followTarget = PlayerManager.CurrentPlayer.transform;
        }

        AddFollowToTargetGroups();
    }
Beispiel #7
0
    private void Start()
    {
        mixingCamera = GetComponent <CinemachineMixingCamera>();
        BC           = GetComponent <BoxCollider>();

        BC.isTrigger = true;
        switch (mode)
        {
        case (Axis.XAxis):
            boxWidth = BC.size.x / 2;
            break;

        case (Axis.YAxis):
            boxWidth = BC.size.y / 2;
            break;

        case (Axis.ZAxis):
            boxWidth = BC.size.z / 2;
            break;
        }
    }
    private void OnTriggerEnter(Collider other)
    {
        if (mixer == null)
        {
            mixer = (CinemachineMixingCamera)gameObject.AddComponent(typeof(CinemachineMixingCamera));
        }
        mixer.enabled = true;

        float weight = volume.GetWeight();

        cameraA.transform.SetParent(transform, true);
        cameraA.enabled = true;

        cameraB.transform.SetParent(transform, true);
        cameraB.enabled = true;


        var x = mixer.ChildCameras;

        mixer.SetWeight(cameraA, 1f - weight);
        mixer.SetWeight(cameraB, weight);
    }
Beispiel #9
0
 private void Start()
 {
     mixer  = GetComponent <CinemachineMixingCamera>();
     volume = GetComponent <WeightVolume>();
 }
 void Start()
 {
     mixin = GetComponent <CinemachineMixingCamera>();
 }
 public void Awake()
 {
     mixingCam = GetComponent <CinemachineMixingCamera>();
 }
Beispiel #12
0
 // Start is called before the first frame update
 void Start()
 {
     mixingCamera       = GetComponent <CinemachineMixingCamera>();
     previousCameraOrto = new float[mixingCamera.ChildCameras.Length];
     CapturePrevCameraOrt();
 }
Beispiel #13
0
    private void Start()
    {
        brain         = Camera.main.GetComponent <CinemachineBrain>();
        mixer         = GetComponent <CinemachineMixingCamera>();
        BCamera       = mixer.ChildCameras[0];
        mixer.enabled = false;

        Collider collider = GetComponent <Collider>();

        if (collider != null)
        {
            collider.isTrigger = true;

            if (collider.GetType() == typeof(SphereCollider))
            {
                if (type != Type.Focus)
                {
                    Debug.LogError("Type is set to " + type.ToString() + " and has a Sphere Collider attached. Sphere Colliders only work with focus volumes.", this);
                    Debug.Break();
                }

                colliderType = ColliderType.sphere;
                blendRange   = GetComponent <SphereCollider>().radius;
            }
            else if (collider.GetType() == typeof(BoxCollider))
            {
                colliderType = ColliderType.box;
                blendRange   = GetComponent <BoxCollider>().size.z / 2;
            }
            else if (collider.GetType() == typeof(MeshCollider))
            {
                if (type != Type.Composite)
                {
                    Debug.LogError("Type is set to " + type.ToString() + " and has a Mesh Colliders attached. Mesh Colliders only work with composite volumes.", this);
                    Debug.Break();
                }

                colliderType = ColliderType.mesh;
            }
        }
        else
        {
            Debug.LogError(name + " needs a collider. The Mixing Volume type is set to " + type + ". Add an appropriate Collider.", this);
            Debug.Break();
        }

        if (type == Type.Curve)
        {
            path = GetComponent <CinemachinePathBase>();

            if (path == null)
            {
                Debug.LogError("The MixingVolume type is set to Curve. Add an CinemachinePath component.", this);
                Debug.Break();
            }
            else
            {
                blendRange = path.MaxPos;
            }
        }
    }