// Update is called once per frame

        void Start()
        {
            if (NoInputs)
            {
                MalbersInput input = null;
                for (int i = 0; i < targets.Length; i++)
                {
                    input = targets[i].GetComponent <MalbersInput>();
                    if (input)
                    {
                        input.enabled = false;
                    }
                }

                m = GetComponent <MFreeLookCamera>();
                if (m)
                {
                    input = m.Target.GetComponent <MalbersInput>();
                    if (input)
                    {
                        input.enabled = true;
                    }

                    for (int i = 0; i < targets.Length; i++)
                    {
                        if (targets[i] == m.Target)
                        {
                            current = i;
                            break;
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        private void Start()
        {
            M_FreeLookCamera = GetComponent <MFreeLookCamera>();

            ResetWithState();

            m_RayHitComparer = new RayHitComparer();         // create a new RayHitComparer

            M_FreeLookCamera.OnStateChange.AddListener(SetOriginalDist);
        }
Esempio n. 3
0
        public void SetCamera(MFreeLookCamera Freecamera)
        {
            mCamera = Freecamera;
            if (mCamera)
            {
                cam = mCamera.Cam.GetComponent <Camera>();
            }
            ChangeStates = StateTransition(transition);

            currentState  = null;
            NextState     = null;
            Mounted       = null;
            MountedTarget = null;
        }
Esempio n. 4
0
        // Update is called once per frame

        void Start()
        {
            if (NoInputs)
            {
                IInputSource input = null;

                for (int i = 0; i < targets.Length; i++)
                {
                    if (targets[i])
                    {
                        input = targets[i].GetComponent <IInputSource>();
                        if (input != null)
                        {
                            input.Enable(false);
                        }
                    }
                }

                m = GetComponent <MFreeLookCamera>();
                if (m && m.Target)
                {
                    input = m.Target.GetComponent <IInputSource>();
                    if (input != null)
                    {
                        input.Enable(true);
                    }

                    for (int i = 0; i < targets.Length; i++)
                    {
                        if (targets[i] == m.Target)
                        {
                            current = i;
                            break;
                        }
                    }
                }
            }
        }
Esempio n. 5
0
 public void SetCamera(MFreeLookCamera Freecamera) => mCamera = Freecamera;