Ejemplo n.º 1
0
    void _Idling()
    {
        _velocity.y -= 0.5f;
        _pos        += _velocity;

        // check hitting all bees on the scene
        //GameObject[] bees = GameObject.FindGameObjectsWithTag("bee");
        foreach (GameObject e in SsGameTest._instance._bees)
        {
            BeeObject bo = e.GetComponent <BeeObject>();
            if (bo.IsFalling())
            {
                continue;
            }
            if (bo._sprite.IntersectsByBounds(_sprite, true))
            {
                bo.OnHit();
                if (!SsGameTest._instance._penetratableFire && !_beChameleon)
                {
                    Object.Destroy(gameObject);
                }
                break;
            }
        }
    }
Ejemplo n.º 2
0
 void AnimeFinished(SsSprite sprite)
 {
     // all bees in visible now are fell out of the scene.
     foreach (GameObject e in SsGameTest._instance._bees)
     {
         BeeObject bo = e.GetComponent <BeeObject>();
         if (bo.IsFalling())
         {
             continue;
         }
         bo.OnHit();
     }
     // vaporize
     Object.Destroy(gameObject);
 }
Ejemplo n.º 3
0
    void Awake()
    {
        // enable access to database inside each sprite object.
        SpriteObject._ssDatabase = _ssDatabase;

        _player = new GameObject("player");
        _player.AddComponent <PlayerObject>();

        _bees = new GameObject[_numOfBees];
        for (int i = 0; i < _bees.Length; ++i)
        {
            _bees[i] = new GameObject("bee");
            BeeObject bo = _bees[i].AddComponent <BeeObject>();
            bo._player = _player;
        }
    }
Ejemplo n.º 4
0
 void _Swinging()
 {
     // check hitting all bees on the scene
     //GameObject[] bees = GameObject.FindGameObjectsWithTag("bee");
     foreach (GameObject e in SsGameTest._instance._bees)
     {
         BeeObject bo = e.GetComponent <BeeObject>();
         if (bo.IsFalling())
         {
             continue;
         }
         if (bo._sprite.IntersectsByBounds(_sprite, true))
         {
             bo.OnHit();
         }
     }
 }