예제 #1
0
 void Energization( )
 {
     if (_thunder.getFlag( ) == false)
     {
         if (top != null)
         {
             if (top.tag == "Iron_Thunder")
             {
                 _thunder.setFlag(true);
             }
         }
         if (under != null)
         {
             if (under.tag == "Iron_Thunder")
             {
                 _thunder.setFlag(true);
             }
         }
         if (right != null)
         {
             if (right.tag == "Iron_Thunder")
             {
                 _thunder.setFlag(true);
             }
         }
         if (left != null)
         {
             if (left.tag == "Iron_Thunder")
             {
                 _thunder.setFlag(true);
             }
         }
     }
 }
예제 #2
0
    void Energization( )
    {
        if (_thunder.getElergization( ))
        {
            if (first)
            {
                on_off = !on_off;
            }
            first = false;
            return;
        }

        if (_thunder.getFlag( ) == false)
        {
            if (top != null)
            {
                if (top.tag == "Iron_Thunder")
                {
                    if (first)
                    {
                        on_off = !on_off;
                    }
                    _thunder.setFlag(true);
                    first = false;
                    return;
                }
            }
            if (under != null)
            {
                if (under.tag == "Iron_Thunder")
                {
                    if (first)
                    {
                        on_off = !on_off;
                    }
                    _thunder.setFlag(true);
                    first = false;
                    return;
                }
            }
            if (right != null)
            {
                if (right.tag == "Iron_Thunder")
                {
                    if (first)
                    {
                        on_off = !on_off;
                    }
                    _thunder.setFlag(true);
                    first = false;
                    return;
                }
            }
            if (left != null)
            {
                if (left.tag == "Iron_Thunder")
                {
                    if (first)
                    {
                        on_off = !on_off;
                    }
                    _thunder.setFlag(true);
                    first = false;
                    return;
                }
            }
            first = true;
        }
    }