Exemplo n.º 1
0
        /// <summary>
        /// The character perspective between first and third person has changed.
        /// </summary>
        /// <param name="firstPersonPerspective">Is the character in a first person perspective?</param>
        protected override void OnChangePerspectives(bool firstPersonPerspective)
        {
            base.OnChangePerspectives(firstPersonPerspective);

            var active = m_FlashlightPerpectiveProperties.Light.activeSelf;

            m_FlashlightPerpectiveProperties.Light.SetActive(false);
            m_FlashlightPerpectiveProperties = m_ActivePerspectiveProperties as IFlashlightPerspectiveProperties;
            if (active)
            {
                m_FlashlightPerpectiveProperties.Light.SetActive(true);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initialize the default values.
        /// </summary>
        protected override void Awake()
        {
            base.Awake();

            m_FlashlightPerpectiveProperties = m_ActivePerspectiveProperties as IFlashlightPerspectiveProperties;

            if (m_BatteryModifier != null)
            {
                if (m_BatteryModifier.Initialize(m_GameObject))
                {
                    EventHandler.RegisterEvent(m_BatteryModifier.Attribute, "OnAttributeReachedDestinationValue", OnBatteryEmpty);
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initialize the visible object transform.
        /// </summary>
        protected override void Start()
        {
            base.Start();

            if (m_FlashlightPerpectiveProperties == null)
            {
                m_FlashlightPerpectiveProperties = m_ActivePerspectiveProperties as IFlashlightPerspectiveProperties;

                if (m_FlashlightPerpectiveProperties == null)
                {
                    Debug.LogError("Error: The First/Third Person Flashlight Item Properties component cannot be found for the Item " + name + "." +
                                   "Ensure the component exists and the component's Action ID matches the Action ID of the Item (" + m_ID + ")");
                }
            }
        }