Exemplo n.º 1
0
 public void AddEntry(HUDSideInfoBase p_entry)
 {
     ENTRIES_ROOT.AddChildAlignOrigin(p_entry.transform);
     p_entry.transform.localScale = Vector3.one;
     SetEntryLocalPosition(p_entry, m_highestEntryPosition + ENTRY_HEIGHT + ENTRY_HEIGHT_OFFSET);
     m_entries.Add(p_entry);
 }
Exemplo n.º 2
0
        private void SetEntryLocalPosition(HUDSideInfoBase p_entry, Single p_locHeight)
        {
            Vector3 localPosition = p_entry.transform.localPosition;

            localPosition.y = p_locHeight;
            p_entry.transform.localPosition = localPosition;
        }
Exemplo n.º 3
0
        protected virtual void Update()
        {
            for (Int32 i = m_entries.Count - 1; i >= 0; i--)
            {
                HUDSideInfoBase hudsideInfoBase = m_entries[i];
                if (hudsideInfoBase == null || !hudsideInfoBase.IsUsed())
                {
                    Destroy(hudsideInfoBase.gameObject);
                    m_entries.RemoveAt(i);
                }
            }
            m_isSlidingAnimationPlaying = false;
            Single num = -(Single)(ENTRY_HEIGHT + ENTRY_HEIGHT_OFFSET);

            for (Int32 j = 0; j < m_entries.Count; j++)
            {
                HUDSideInfoBase hudsideInfoBase2 = m_entries[j];
                if (hudsideInfoBase2.IsAlignedToBottom)
                {
                    Single entryHeight = GetEntryHeight(j);
                    if (entryHeight != hudsideInfoBase2.transform.localPosition.y && num + (ENTRY_HEIGHT + ENTRY_HEIGHT_OFFSET) < hudsideInfoBase2.transform.localPosition.y)
                    {
                        SetEntryLocalPosition(hudsideInfoBase2, hudsideInfoBase2.transform.localPosition.y - Time.deltaTime * SLIDE_DOWN_SPEED);
                        if (entryHeight > hudsideInfoBase2.transform.localPosition.y)
                        {
                            SetEntryLocalPosition(hudsideInfoBase2, entryHeight);
                        }
                        else
                        {
                            m_isSlidingAnimationPlaying = true;
                        }
                    }
                }
                num = hudsideInfoBase2.transform.localPosition.y;
            }
            m_highestEntryPosition = num;
            if (m_conversationWasOpen != LegacyLogic.Instance.ConversationManager.IsOpen)
            {
                MoveOnConversation();
            }
            foreach (HUDSideInfoBase hudsideInfoBase3 in m_entries)
            {
                if (hudsideInfoBase3.IsUsed())
                {
                    hudsideInfoBase3.UpdateEntry();
                }
            }
        }