Ejemplo n.º 1
0
 //カメラのリセットを行う
 public virtual void CameraReset()
 {
     //現在使用中のカメラがある場合
     if (_virtualCamera)
     {
         //ノイズの停止
         _perlin.m_NoiseProfile = null;
     }
     //使用するカメラの更新
     _virtualCamera = GetComponent <CameraManager>().GetCullentVCam();
     _perlin        = _virtualCamera.GetCinemachineComponent <Cinemachine.CinemachineBasicMultiChannelPerlin>();
 }
Ejemplo n.º 2
0
        public void Awake()
        {
            this.mainCamera = Camera.main;
            this.mapMask    = LayerMask.GetMask("Map");
            commandInput    = new CommandInput_Move();
            Cinemachine.CinemachineCore.GetInputAxis = AxisInputDelegate;

            ReferenceCollector rc = mainCamera.GetComponent <ReferenceCollector>();

            playerCam = rc.Get <GameObject>("PlayerCam").GetComponent <CinemachineVirtualCamera>();
            Unit      = GetParent <Unit>();
            //playerCam.Follow = Unit.GameObject.transform;
            //playerCam.LookAt = Unit.GameObject.GetComponentInChildren<CameraFollowHelper>().unitHead;
            ResetPosition();
            // playerCam.Follow = Unit.GameObject.transform;
            mainCamera.GetComponent <MonoBehaviorEventHelpr>().appFocusEvent = (b) =>
            {
                incontrol = b;
            };
        }
Ejemplo n.º 3
0
 void Start()
 {
     _vc = GetComponent <Cinemachine.CinemachineVirtualCamera>();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// On Awake we grab our virtual camera
 /// </summary>
 protected virtual void Awake()
 {
     _virtualCamera      = this.gameObject.GetComponent <Cinemachine.CinemachineVirtualCamera>();
     _initialFieldOfView = _virtualCamera.m_Lens.FieldOfView;
 }
Ejemplo n.º 5
0
 // Start is called before the first frame update
 void Start()
 {
     cvc = GetComponent <Cinemachine.CinemachineVirtualCamera>();
     cvc.GetCinemachineComponent <Cinemachine.CinemachineBasicMultiChannelPerlin>().m_AmplitudeGain = 0;
 }
 /// <summary>
 /// On awake we grab our components
 /// </summary>
 protected virtual void Awake()
 {
     _virtualCamera = GameObject.FindObjectOfType <Cinemachine.CinemachineVirtualCamera>();
     _perlin        = _virtualCamera.GetCinemachineComponent <Cinemachine.CinemachineBasicMultiChannelPerlin> ();
 }
Ejemplo n.º 7
0
 // Start is called before the first frame update
 void Start()
 {
     virtCam    = GetComponent <Cinemachine.CinemachineVirtualCamera>();
     cameraZoom = virtCam.GetCinemachineComponent <Cinemachine.CinemachineFramingTransposer>().m_CameraDistance;
 }
Ejemplo n.º 8
0
    // Use this for initialization

    void Start()
    {
        Cinemachine.CinemachineVirtualCamera virtualController = virtualCamera.GetComponent <Cinemachine.CinemachineVirtualCamera>();
        virtualController.m_Follow = this.transform;
    }
Ejemplo n.º 9
0
 // Start is called before the first frame update
 private void Awake()
 {
     c_VirtualCamera = VirtualCam.GetComponent <Cinemachine.CinemachineVirtualCamera>();
     sr = GetComponent <SpriteRenderer>();
 }
Ejemplo n.º 10
0
 public static void ChangeToCamera(Cinemachine.CinemachineVirtualCamera value) => OnChangeToCamera?.Invoke(value);
        private void CreateRigs(CinemachineVirtualCamera[] copyFrom)
        {
            // Invalidate the cache
            m_Rigs     = null;
            mOribitals = null;

            string[] rigNames            = RigNames;
            float[]  softCenterDefaultsV = new float[] { 0.5f, 0.55f, 0.6f };
            for (int i = 0; i < rigNames.Length; ++i)
            {
                CinemachineVirtualCamera src = null;
                if (copyFrom != null && copyFrom.Length > i)
                {
                    src = copyFrom[i];
                }

                CinemachineVirtualCamera rig = null;
                if (CreateRigOverride != null)
                {
                    rig = CreateRigOverride(this, rigNames[i], src);
                }
                else
                {
                    // If there is an existing rig with this name, delete it
                    List <Transform> list = new List <Transform>();
                    foreach (Transform child in transform)
                    {
                        if (child.GetComponent <CinemachineVirtualCamera>() != null &&
                            child.gameObject.name == rigNames[i])
                        {
                            list.Add(child);
                        }
                    }
                    foreach (Transform child in list)
                    {
                        DestroyImmediate(child.gameObject);
                    }

                    // Create a new rig with default components
                    GameObject go = new GameObject(rigNames[i]);
                    go.transform.parent = transform;
                    rig = go.AddComponent <CinemachineVirtualCamera>();
                    if (src != null)
                    {
                        ReflectionHelpers.CopyFields(src, rig);
                    }
                    else
                    {
                        go = rig.GetComponentOwner().gameObject;
                        go.AddComponent <CinemachineOrbitalTransposer>();
                        go.AddComponent <CinemachineComposer>();
                    }
                }

                // Set up the defaults
                rig.InvalidateComponentPipeline();
                CinemachineOrbitalTransposer orbital = rig.GetCinemachineComponent <CinemachineOrbitalTransposer>();
                if (orbital == null)
                {
                    orbital = rig.AddCinemachineComponent <CinemachineOrbitalTransposer>(); // should not happen
                }
                if (src == null)
                {
                    // Only set defaults if not copying
                    orbital.m_Radius       = DefaultRadius[i];
                    orbital.m_HeightOffset = DefaultHeight[i];
                    CinemachineComposer composer = rig.GetCinemachineComponent <CinemachineComposer>();
                    if (composer != null)
                    {
                        composer.m_HorizontalDamping = composer.m_VerticalDamping = 0;
                        composer.m_ScreenX           = 0.5f;
                        composer.m_ScreenY           = softCenterDefaultsV[i];
                        composer.m_DeadZoneWidth     = composer.m_DeadZoneHeight = 0;
                        composer.m_SoftZoneWidth     = composer.m_SoftZoneHeight = 0.8f;
                        composer.m_BiasX             = composer.m_BiasY = 0;
                    }
                }
            }
        }
Ejemplo n.º 12
0
    protected override void Awake()
    {
        base.Awake();


        SetGizmoColor(Color.red);

        _cc    = GetComponentInChildren <CapsuleCollider>();
        _stat  = GetComponent <PlayerStat>();
        _anim  = GetComponentInChildren <Animator>();
        _Sound = GetComponent <PlayerSound>();
        rigid  = GetComponent <Rigidbody>();

        CMvcam2 = GameObject.Find("CMvcam2").GetComponent <Cinemachine.CinemachineVirtualCamera>();

        vignette     = GameObject.Find("mainCam").GetComponent <PostProcessVolume>().profile.GetSetting <Vignette>();
        colorGrading = GameObject.Find("mainCam").GetComponent <PostProcessVolume>().profile.GetSetting <ColorGrading>();

        bloom          = GameObject.Find("mainCam").GetComponent <PostProcessVolume>().profile.GetSetting <Bloom>();
        Attack_Capsule = GameObject.FindGameObjectWithTag("Weapon").GetComponent <CapsuleCollider>();
        Skill3_Capsule = Skill3_Start.GetComponent <CapsuleCollider>();
        enemyHPBar     = GameObject.Find("EnemyHPBar").GetComponent <EnemyHPBar>();
        Skill1Shoots.gameObject.SetActive(false);
        instance     = this;
        isSkill2     = false;
        isInputLock  = false;
        isSpecial    = false;
        isMouseYLock = false;
        try
        {
            Skill3_Start.SetActive(false);
            Skill3_End.SetActive(false);
        }
        catch
        {
        }
        randomShoot = new int[5];

        PlayerState[] stateValues = (PlayerState[])System.Enum.GetValues(typeof(PlayerState));
        foreach (PlayerState s in stateValues)
        {
            System.Type FSMType = System.Type.GetType("Player" + s.ToString());
            FSMState    state   = (FSMState)GetComponent(FSMType);
            if (null == state)
            {
                state = (FSMState)gameObject.AddComponent(FSMType);
            }

            _states.Add(s, state);
            state.enabled = false;
        }

        for (int x = 0; x < _MR.Length; x++)
        {
            materialList.AddRange(_MR[x].materials);
        }
        remainingDash = 3;

        try
        {
            mission = GameObject.Find("Tutorial").GetComponent <MissionTutorial>();
        }
        catch
        {
            mission = null;
        }
    }
Ejemplo n.º 13
0
 // Use this for initialization
 void Start()
 {
     virtualCam = GameObject.FindWithTag("VirtCam").GetComponent <Cinemachine.CinemachineVirtualCamera>();
 }
Ejemplo n.º 14
0
// Use this for initialization
    void Start()
    {
        GameObject vcam = GameObject.Find("CM vcam1");

        virtualCameraScript = GetComponent <Cinemachine.CinemachineVirtualCamera>();
    }
Ejemplo n.º 15
0
 void Awake()
 {
     ballStart    = GetComponentInChildren <BallStart>();
     puzzleCamera = GetComponentInChildren <Cinemachine.CinemachineVirtualCamera>();
 }
Ejemplo n.º 16
0
 public virtual void SwitchCamera()
 {
     _virtualCamera = GameObject.FindGameObjectWithTag("Camera1").GetComponent <Cinemachine.CinemachineVirtualCamera>();
 }
Ejemplo n.º 17
0
 void Start()
 {
     VCam = GameObject.Find("Camera").GetComponentInChildren <Cinemachine.CinemachineVirtualCamera>();
 }
Ejemplo n.º 18
0
 void Start()
 {
     cameraController = Camera.main.GetComponentInChildren <Cinemachine.CinemachineVirtualCamera>();
 }
Ejemplo n.º 19
0
 void Start()
 {
     cinemachineVirtualCamera = GetComponent <Cinemachine.CinemachineVirtualCamera>();
     dolly = cinemachineVirtualCamera.GetCinemachineComponent <Cinemachine.CinemachineTrackedDolly>();
 }
Ejemplo n.º 20
0
        private void UpdateRigCache()
        {
            if (mIsDestroyed)
            {
                return;
            }

            bool isPrefab = RuntimeUtility.IsPrefab(gameObject);

#if UNITY_EDITOR
            // Special condition: Did we just get copy/pasted?
            if (m_Rigs != null && m_Rigs.Length == 3 &&
                m_Rigs[0] != null && m_Rigs[0].transform.parent != transform)
            {
                if (!isPrefab) // can't paste to a prefab
                {
                    var copyFrom = m_Rigs;
                    DestroyRigs();
                    m_Rigs = CreateRigs(copyFrom);
                }
            }
            for (int i = 0; m_Rigs != null && i < 3 && i < m_Rigs.Length; ++i)
            {
                if (m_Rigs[i] != null)
                {
                    CinemachineVirtualCamera.SetFlagsForHiddenChild(m_Rigs[i].gameObject);
                }
            }
#endif

            // Early out if we're up to date
            if (mOrbitals != null && mOrbitals.Length == 3)
            {
                return;
            }

            // Locate existing rigs, and recreate them if any are missing
            if (LocateExistingRigs(RigNames, false) != 3 && !isPrefab)
            {
                DestroyRigs();
                m_Rigs = CreateRigs(null);
                LocateExistingRigs(RigNames, true);
            }

#if UNITY_EDITOR
            foreach (var rig in m_Rigs)
            {
                // Configure the UI
                if (rig == null)
                {
                    continue;
                }
                rig.m_ExcludedPropertiesInInspector = m_CommonLens
                    ? new string[] { "m_Script", "Header", "Extensions", "m_Priority", "m_Transitions", "m_Follow", "m_StandbyUpdate", "m_Lens" }
                    : new string[] { "m_Script", "Header", "Extensions", "m_Priority", "m_Transitions", "m_Follow", "m_StandbyUpdate" };
                rig.m_LockStageInInspector = new CinemachineCore.Stage[] { CinemachineCore.Stage.Body };
            }
#endif

            // Create the blend objects
            mBlendA = new CinemachineBlend(m_Rigs[1], m_Rigs[0], AnimationCurve.Linear(0, 0, 1, 1), 1, 0);
            mBlendB = new CinemachineBlend(m_Rigs[2], m_Rigs[1], AnimationCurve.Linear(0, 0, 1, 1), 1, 0);
        }
Ejemplo n.º 21
0
        [SerializeField][HideInInspector] private Transform m_ComponentOwner = null;   // serialized to handle copy/paste
        void UpdateComponentPipeline()
        {
            bool isPrefab = RuntimeUtility.IsPrefab(gameObject);

#if UNITY_EDITOR
            // Did we just get copy/pasted?
            if (m_ComponentOwner != null && m_ComponentOwner.parent != transform)
            {
                if (!isPrefab) // can't paste to a prefab
                {
                    CinemachineVirtualCamera copyFrom = (m_ComponentOwner.parent != null)
                        ? m_ComponentOwner.parent.gameObject.GetComponent <CinemachineVirtualCamera>() : null;
                    DestroyPipeline();
                    m_ComponentOwner = CreatePipeline(copyFrom);
                }
            }
            if (m_ComponentOwner != null)
            {
                SetFlagsForHiddenChild(m_ComponentOwner.gameObject);
            }
#endif
            // Early out if we're up-to-date
            if (m_ComponentOwner != null && m_ComponentPipeline != null)
            {
                return;
            }

            m_ComponentOwner = null;
            List <CinemachineComponentBase> list = new List <CinemachineComponentBase>();
            foreach (Transform child in transform)
            {
                if (child.GetComponent <CinemachinePipeline>() != null)
                {
                    m_ComponentOwner = child;
                    CinemachineComponentBase[] components = child.GetComponents <CinemachineComponentBase>();
                    foreach (CinemachineComponentBase c in components)
                    {
                        if (c.enabled)
                        {
                            list.Add(c);
                        }
                    }
                }
            }

            // Make sure we have a pipeline owner
            if (m_ComponentOwner == null && !isPrefab)
            {
                m_ComponentOwner = CreatePipeline(null);
            }

            // Make sure the pipeline stays hidden, even through prefab
            if (m_ComponentOwner != null)
            {
                SetFlagsForHiddenChild(m_ComponentOwner.gameObject);
            }
            if (m_ComponentOwner != null && m_ComponentOwner.gameObject != null)
            {
                // Sort the pipeline
                list.Sort((c1, c2) => (int)c1.Stage - (int)c2.Stage);
                m_ComponentPipeline = list.ToArray();
            }
        }
Ejemplo n.º 22
0
 void Awake()
 {
     c_VirtualCamera = GameObject.FindGameObjectWithTag("Cinemachine").GetComponent <Cinemachine.CinemachineVirtualCamera>();
 }
Ejemplo n.º 23
0
        private CinemachineVirtualCamera[] CreateRigs(CinemachineVirtualCamera[] copyFrom)
        {
            // Invalidate the cache
            mOrbitals = null;
            float[] softCenterDefaultsV        = new float[] { 0.5f, 0.55f, 0.6f };
            CinemachineVirtualCamera[] newRigs = new CinemachineVirtualCamera[3];
            for (int i = 0; i < RigNames.Length; ++i)
            {
                CinemachineVirtualCamera src = null;
                if (copyFrom != null && copyFrom.Length > i)
                {
                    src = copyFrom[i];
                }

                if (CreateRigOverride != null)
                {
                    newRigs[i] = CreateRigOverride(this, RigNames[i], src);
                }
                else
                {
                    // Create a new rig with default components
                    GameObject go = new GameObject(RigNames[i]);
                    go.transform.parent = transform;
                    newRigs[i]          = go.AddComponent <CinemachineVirtualCamera>();
                    if (src != null)
                    {
                        ReflectionHelpers.CopyFields(src, newRigs[i]);
                    }
                    else
                    {
                        go = newRigs[i].GetComponentOwner().gameObject;
                        go.AddComponent <CinemachineOrbitalTransposer>();
                        go.AddComponent <CinemachineComposer>();
                    }
                }

                // Set up the defaults
                newRigs[i].InvalidateComponentPipeline();
                CinemachineOrbitalTransposer orbital = newRigs[i].GetCinemachineComponent <CinemachineOrbitalTransposer>();
                if (orbital == null)
                {
                    orbital = newRigs[i].AddCinemachineComponent <CinemachineOrbitalTransposer>(); // should not happen
                }
                if (src == null)
                {
                    // Only set defaults if not copying
                    orbital.m_YawDamping = 0;
                    CinemachineComposer composer = newRigs[i].GetCinemachineComponent <CinemachineComposer>();
                    if (composer != null)
                    {
                        composer.m_HorizontalDamping = composer.m_VerticalDamping = 0;
                        composer.m_ScreenX           = 0.5f;
                        composer.m_ScreenY           = softCenterDefaultsV[i];
                        composer.m_DeadZoneWidth     = composer.m_DeadZoneHeight = 0.1f;
                        composer.m_SoftZoneWidth     = composer.m_SoftZoneHeight = 0.8f;
                        composer.m_BiasX             = composer.m_BiasY = 0;
                    }
                }
            }
            return(newRigs);
        }
        private int LocateExistingRigs(string[] rigNames, bool forceOrbital)
        {
            mOrbitals = new CinemachineOrbitalTransposer[rigNames.Length];
            m_Rigs    = new CinemachineVirtualCamera[rigNames.Length];
            int rigsFound = 0;

            foreach (Transform child in transform)
            {
                CinemachineVirtualCamera vcam = child.GetComponent <CinemachineVirtualCamera>();
                if (vcam != null)
                {
                    GameObject go = child.gameObject;
                    for (int i = 0; i < rigNames.Length; ++i)
                    {
                        if (mOrbitals[i] == null && go.name == rigNames[i])
                        {
                            // Must have an orbital transposer or it's no good
                            mOrbitals[i] = vcam.GetCinemachineComponent <CinemachineOrbitalTransposer>();
                            if (mOrbitals[i] == null && forceOrbital)
                            {
                                mOrbitals[i] = vcam.AddCinemachineComponent <CinemachineOrbitalTransposer>();
                            }
                            if (mOrbitals[i] != null)
                            {
                                mOrbitals[i].m_HeadingIsSlave = true;
                                if (i == 1)
                                {
                                    mOrbitals[i].HeadingUpdater
                                        = (CinemachineOrbitalTransposer orbital, float deltaTime, Vector3 up)
                                          => { return(orbital.UpdateHeading(deltaTime, up, ref m_XAxis)); }
                                }
                                ;
                                m_Rigs[i] = vcam;
                                m_Rigs[i].m_StandbyUpdate = m_StandbyUpdate;
                                ++rigsFound;
                            }
                        }
                    }
                }
            }
            return(rigsFound);
        }

        void PushSettingsToRigs()
        {
            UpdateRigCache();
            for (int i = 0; i < m_Rigs.Length; ++i)
            {
                if (m_Rigs[i] == null)
                {
                    continue;
                }

                if (m_CommonLens)
                {
                    m_Rigs[i].m_Lens = m_Lens;
                }

                // If we just deserialized from a legacy version,
                // pull the orbits and targets from the rigs
                if (mUseLegacyRigDefinitions)
                {
                    mUseLegacyRigDefinitions = false;
                    m_Orbits[i].m_Height     = mOrbitals[i].m_FollowOffset.y;
                    m_Orbits[i].m_Radius     = -mOrbitals[i].m_FollowOffset.z;
                    if (m_Rigs[i].Follow != null)
                    {
                        Follow = m_Rigs[i].Follow;
                    }
                }
                m_Rigs[i].Follow          = null;
                m_Rigs[i].m_StandbyUpdate = m_StandbyUpdate;
                if (!PreviousStateIsValid)
                {
                    m_Rigs[i].PreviousStateIsValid = false;
                    m_Rigs[i].transform.position   = transform.position;
                    m_Rigs[i].transform.rotation   = transform.rotation;
                }
                // Hide the rigs from prying eyes
                if (CinemachineCore.sShowHiddenObjects)
                {
                    m_Rigs[i].gameObject.hideFlags
                        &= ~(HideFlags.HideInHierarchy | HideFlags.HideInInspector);
                }
                else
                {
                    m_Rigs[i].gameObject.hideFlags
                        |= (HideFlags.HideInHierarchy | HideFlags.HideInInspector);
                }

                mOrbitals[i].m_FollowOffset = GetLocalPositionForCameraFromInput(GetYAxisValue());
                mOrbitals[i].m_BindingMode  = m_BindingMode;
                mOrbitals[i].m_Heading      = m_Heading;
                mOrbitals[i].m_XAxis        = m_XAxis;
                mOrbitals[i].m_RecenterToTargetHeading.m_enabled         = (i == 1) ? m_RecenterToTargetHeading.m_enabled : false;
                mOrbitals[i].m_RecenterToTargetHeading.m_WaitTime        = m_RecenterToTargetHeading.m_WaitTime;
                mOrbitals[i].m_RecenterToTargetHeading.m_RecenteringTime = m_RecenterToTargetHeading.m_RecenteringTime;

                // Hack to get SimpleFollow with heterogeneous dampings to work
                if (m_BindingMode == CinemachineTransposer.BindingMode.SimpleFollowWithWorldUp)
                {
                    m_Rigs[i].SetStateRawPosition(State.RawPosition);
                }
            }
        }
Ejemplo n.º 25
0
 void Start()
 {
     VCam        = GetComponentInChildren <Cinemachine.CinemachineVirtualCamera>();
     VCam.Follow = GameObject.Find("Followee").transform;
 }
Ejemplo n.º 26
0
 private void OnValidate()
 {
     UI     = UI ?? GetComponentInChildren <CanvasGroup>();
     Camera = Camera ?? GetComponentInChildren <Cinemachine.CinemachineVirtualCamera>();
 }
Ejemplo n.º 27
0
 void Start()
 {
     cam = GetComponent <CinemachineVirtualCamera>();
 }
Ejemplo n.º 28
0
 void Start()
 {
     cinemachineVirtualCamera = GetComponent <Cinemachine.CinemachineVirtualCamera>();
     dolly = cinemachineVirtualCamera.GetCinemachineComponent <Cinemachine.CinemachineTrackedDolly>();
     //target = GameObject.Find( "BossCameraTarget" ).transform;
 }
Ejemplo n.º 29
0
 private void Awake()
 {
     virtualCamera = GetComponent <Cinemachine.CinemachineVirtualCamera>();
 }
 void Awake()
 {
     Camera        = GetComponent <Camera>();
     VirtualCamera = GetComponent <Cinemachine.CinemachineVirtualCamera>();
 }