예제 #1
0
    protected override void Initialise()
    {
        if (damager == null)
        {
            damager = GetComponent <Damager>();
        }

        SearchOverlapPlatforms(m_Box, out m_SpikeTriggers, 30);

        for (int i = 0; i < m_SpikeTriggers.Length; i++)
        {
            if (m_SpikeTriggers[i].isMovingAtStart == isMovingAtStart)
            {
                m_SameSpikes.Add(m_SpikeTriggers[i]);
            }
        }

        if (isMovingAtStart)
        {
            m_Started = true;
            damager.EnableOnDamage();
        }
        else
        {
            m_Started = false;
            damager.DisableOnDamage();
        }

        m_PlatformType        = PlatformType.SPIKE_TRIGGER;
        m_CurrentTriggerState = TriggerState.EXIT;
        m_Box.isTrigger       = true;
    }