void Start() { m_state = State.Living; m_sprite = GetComponentInChildren <SpriteRenderer>(); m_rigidBody = GetComponent <Rigidbody>(); m_suckable = GetComponentInChildren <Suckable>(); m_sprite.sprite = SpriteNormal; }
public void suckObject(Suckable obj) { if(fill >= capacity) { return; } fill += obj.size; GameUI.UpdateUI(); if(fill >= capacity) { //fill = capacity; //GetComponent<AudioSource>().Stop(); CentralAudio.instance.playClip(CentralAudio.instance.filled); /* GetComponent<AudioSource>().clip = filledSFX; GetComponent<AudioSource>().loop = true; GetComponent<AudioSource>().Play(); */ setSucking(false); } }
public void suckObject(Suckable obj) { if (fill >= capacity) { return; } fill += obj.size; GameUI.UpdateUI(); if (fill >= capacity) { //fill = capacity; //GetComponent<AudioSource>().Stop(); CentralAudio.instance.playClip(CentralAudio.instance.filled); /* * GetComponent<AudioSource>().clip = filledSFX; * GetComponent<AudioSource>().loop = true; * GetComponent<AudioSource>().Play(); */ setSucking(false); } }
public void RemoveAffectedObject(Suckable suckable) { m_affectedObjects.Remove(suckable); }
public void AddAffectedObject(Suckable suckable) { m_affectedObjects.Add(suckable); }