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; } } }
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); }
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; } }
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(); } } }