Ejemplo n.º 1
0
        private void TryEquipItem()
        {
            var item = Player.EquippedItem.Get();

            if (item == null)
            {
                return;
            }

            foreach (var obj in m_Objects)
            {
                if (obj.ObjectName == item.Name)
                {
                    obj.gameObject.SetActive(true);

                    obj.On_Draw(item);

                    m_EquippedObject = obj;
                    m_EquippedWeapon = m_EquippedObject as FPWeaponBase;
                    //m_EquippedObjMotion = m_EquippedObject.GetComponent<FPMotion>();

                    m_FPCamera.fieldOfView = m_EquippedObject.TargetFOV;

                    break;
                }
            }
        }
Ejemplo n.º 2
0
        protected virtual void Awake()
        {
            m_Object = GetComponent <FPObject>();

            m_Object.Draw.AddListener(On_Draw);
            m_Object.Holster.AddListener(On_Holster);
            Player.Sleep.AddStopListener(OnStop_Sleep);
            Player.Respawn.AddListener(On_Respawn);

            m_Animator.SetFloat("Draw Speed", m_DrawSpeed);
            m_Animator.SetFloat("Holster Speed", m_HolsterSpeed);
        }
Ejemplo n.º 3
0
        private void Awake()
        {
            m_Object = GetComponent <FPObject>();
            m_Weapon = m_Object as FPWeaponBase;
            m_Object.Draw.AddListener(On_Draw);
            m_Object.Holster.AddListener(On_Holster);

            SetupTransforms();

            Player.Land.AddListener(On_Land);
            m_CurrentOffset = m_IdleOffset;
        }
Ejemplo n.º 4
0
        private void TryDisableObject(GameObject obj, bool isCurrent = false)
        {
            if (obj == null)
            {
                return;
            }

            obj.gameObject.SetActive(true);
            obj.gameObject.SetActive(false);

            if (isCurrent)
            {
                //m_EquippedObjMotion = null;
                m_EquippedObject = null;
                m_EquippedWeapon = null;
            }
        }