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; } } }
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); }
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; }
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; } }