Beispiel #1
0
        private void Start()
        {
            target = gameObject;
            getTarget();
            StartCoroutine(HitAnim());
            CombatViewBase component = GetComponent <CombatViewBase>();
            Transform      parent    = transform.parent;

            while (parent != null && (component = parent.GetComponent <CombatViewBase>()) == null)
            {
                parent = parent.parent;
            }
            if (component != null)
            {
                m_listener = component.gameObject.AddComponent <MonsterEventListener>();
                m_listener.SetEventListener(this);
                FXTags component2 = component.GetComponent <FXTags>();
                if (component2 != null)
                {
                    m_hitSpots = component2.Find("HitSpot");
                    if (m_hitSpots == null || m_hitSpots.Length == 0)
                    {
                        m_hitSpots = new GameObject[]
                        {
                            gameObject
                        };
                    }
                }
            }
            else
            {
                Debug.LogError("CelestialArmorMonsterBuffFX: CombatViewBase not found!");
            }
        }
        private void Start()
        {
            CombatViewBase component = GetComponent <CombatViewBase>();
            Transform      parent    = transform.parent;

            while (parent != null && (component = parent.GetComponent <CombatViewBase>()) == null)
            {
                parent = parent.parent;
            }
            if (component != null)
            {
                m_listener = component.gameObject.AddComponent <SpawnPrefabOnMonsterEventListener>();
                m_listener.SetSpawnPrefabOnMonsterEventScript(this);
            }
            else
            {
                Debug.LogError("SpawnPrefabOnMonsterEvent: CombatViewBase not found!");
            }
        }