// Use this for initialization public void SetUp(CameraHandler p_camera, SpawnPoint p_spawnPoint, SoundModel p_soundModel) { _rigidBody = GetComponent <Rigidbody2D>(); _animator = GetComponent <Animator>(); _camera = p_camera; _spawnPoint = p_spawnPoint; _originalBugScaleSize = transform.localScale; soundModel = p_soundModel; audioSource = GetComponent <AudioSource>(); _mosquitoMovement = new MosquitoMovement(this, _camera); _mosquitoBloodSucker = new MosquitoBloodSuck(this, transform.Find("BUG_BODY DOWN").GetComponent <Anima2D.SpriteMeshInstance>()); _seperableReporters = GetComponentsInChildren <CollisionReporter>().ToList().FindAll(x => x.isBreakable); foreach (Transform child in transform) { bodyContainer.Add(child.transform.name, new MosquitoBodyContainer(child.transform, child.localPosition, child.localRotation)); } _camera.ForceAlignWithTarget(transform); _subtitleText = transform.Find("world_ui/subtitle").GetComponent <Text>(); _typeWriter = GetComponentInChildren <TextEffect.TypeWriter>(); _typeWriter.AddMessage(_subtitleText, "OK, I'm in"); Init(); }
// Use this for initialization void Start() { guiMenu = GameObject.FindWithTag("GUIMenu"); camWithoutBreath = Camera.main; filters = GameObject.FindObjectOfType<EnablePPFilters>(); mosqMovement = GameObject.FindObjectOfType<MosquitoMovement>(); ps = GetComponent<ParticleSystem>(); }
void Awake() { DontDestroyOnLoad( this ); guiMenu = GameObject.FindWithTag("GUIMenu"); camWithoutBreath = Camera.main; filters = GameObject.FindObjectOfType<EnablePPFilters>(); mosqMovement = GameObject.FindObjectOfType<MosquitoMovement>(); ps = GetComponent<ParticleSystem>(); }