Exemplo n.º 1
0
        public void OnMeteoriteFall()
        {
#if true || UNITY_EDITOR
            Debug.Log("MeteoriteFall");
#endif
            MeteoriteFall?.Invoke();
        }
    void OnTimeOut()
    {
        Vector2 creatPos     = new Vector2(Random.Range(m_shootLeft, m_shootRight), m_shootHeight);
        Vector2 targetOrigin = new Vector2(Random.Range(m_shootLeft, m_shootRight), m_shootHeight);

        RaycastHit2D hit = Physics2D.Raycast(targetOrigin, Vector2.down, 100.0f, m_rayMask);

        if (hit.collider != null)
        {
            MeteoriteFall meteoriteFall = Instantiate(m_meteorite, creatPos, Quaternion.Euler(0, 0, 0));
            meteoriteFall.TargetPoint = hit.point;
        }
        m_shootCD.Start();
    }