Beispiel #1
0
        //private RectTransform m_CachedTransform = null;
        //private CanvasGroup m_CachedCanvasGroup = null;

        /*private Entity m_Owner = null;
         * private int m_OwnerId = 0;
         *
         * public Entity Owner
         * {
         *      get
         *      {
         *              return m_Owner;
         *      }
         * }*/

        //public void Init(Entity owner, Canvas parentCanvas, float fromHPRatio, float toHPRatio)
        public void Init(int index, TypingForm parentform)
        {
            //if (owner == null)
            if (parentform == null)
            {
                Log.Error("Owner is invalid.");
                return;
            }

            //m_ParentCanvas = parentCanvas;
            parentForm = parentform;

            gameObject.SetActive(true);
            StopAllCoroutines();

            /*m_CachedCanvasGroup.alpha = 1f;
             * if (m_Owner != owner || m_OwnerId != owner.Id)
             * {
             *      m_CharKey.value = fromHPRatio;
             *      m_Owner = owner;
             *      m_OwnerId = owner.Id;
             * }*/
            charKeyIndex = index;

            Refresh();

            //StartCoroutine(CharKeyCo(toHPRatio, AnimationSeconds, KeepSeconds, FadeOutSeconds));
        }
        private void Start()
        {
            if (m_CharKeyInstanceRoot == null)
            {
                Log.Error("You must set Page for Character Key instance root first.");
                return;
            }

            //m_CachedCanvas = m_CharKeyInstanceRoot.GetComponent<Canvas>();
            cachedTypingForm        = m_CharKeyInstanceRoot.GetComponentInParent <TypingForm>();
            m_CharKeyItemObjectPool = GameEntry.ObjectPool.CreateSingleSpawnObjectPool <CharKeyItemObject>("CharKeyItem", m_InstancePoolCapacity);
            m_ActiveCharKeyItems    = new List <CharKeyItem>();
        }