예제 #1
0
파일: Fruit.cs 프로젝트: miskara/Projects
    public void FleakCollided(string s)
    {
        if (parent != null)
        {
            parent.GetComponent <Spawn> ().full = false;
        }
        spawns.full--;
        particle      = PoolingSystem.Instance.InstantiateAPS("prtclFrtHit", transform.position);
        particleSplsh = particle.transform.GetChild(0).gameObject;
        particle.particleSystem.renderer.sortingLayerName      = "UI";
        particleSplsh.particleSystem.renderer.sortingLayerName = "UI";
        //particle.particleSystem.startColor = RandomColor (frtHit1, frtHit2);
        //particleSplsh.particleSystem.startColor = RandomColor(frtHitSplash1, frtHitSplash2);
        //string a = s;
        string b = string.Empty;

        for (int i = 0; i < s.Length; i++)
        {
            if (char.IsDigit(s [i]))
            {
                b += s [i];
            }
            if (b.Length > 0)
            {
                val = int.Parse(b);
            }
        }
        particle.particleSystem.startColor      = controller.scoretext[val - 1].color;
        particleSplsh.particleSystem.startColor = controller.splshC[val - 1];
        AddScore(s);
        FMOD_StudioSystem.instance.PlayOneShot("event:/01_sfx/flea_pointcollect", camPos);
        spawns.removeFruit(this.gameObject);
        PoolingSystem.DestroyAPS(this.gameObject);
    }
예제 #2
0
 public void DestroyFleaInstant(GameObject obj)
 {
     if (clone != null)
     {
         PoolingSystem.DestroyAPS(obj);
     }
     bullets -= 1;
     Cooldown();
 }
예제 #3
0
파일: Pinkly.cs 프로젝트: miskara/Projects
	void OnTriggerEnter(Collider other){
		if (!other.name.Contains ("Game")) {
			if (other.gameObject.tag.Contains ("Player")) {
				AddScore (other.name);
				FMOD_StudioSystem.instance.PlayOneShot ("event:/01_sfx/flea_pointcollect", transform.position);
				spawns.removeFruit (this.gameObject);
				PoolingSystem.DestroyAPS (this.gameObject);
				PoolingSystem.DestroyAPS (other.gameObject);
			} 
		}
	}
예제 #4
0
파일: Burpy.cs 프로젝트: miskara/Projects
 public void FruitSwallow(int amount, Collider other)
 {
     if (other.gameObject.GetComponent <Fruit> ())
     {
         eaten.Add(other.gameObject);
         other.gameObject.GetComponent <Fruit> ().dragged = false;
         pot = pot + amount;
         checkPot();
         PoolingSystem.DestroyAPS(other.gameObject);
     }
 }
예제 #5
0
파일: Bullet.cs 프로젝트: miskara/Projects
    public IEnumerator DestroyFlea(float time)
    {
        for (float timer = time; timer >= 0; timer -= Time.deltaTime)
        {
            yield return(null);
        }
        //yield return null;
        FMOD_StudioSystem.instance.PlayOneShot("event:/01_sfx/flea_poof", transform.position);

        PoolingSystem.DestroyAPS(this.gameObject);
        DecreaseBullets();
        yield return(null);
    }
예제 #6
0
파일: Coconut.cs 프로젝트: miskara/Projects
    void OnTriggerEnter(Collider other)
    {
        if (!other.name.Contains("Game"))
        {
            if (other.name.Contains("Fleak"))
            {
                if (hits > maxhits)
                {
                    if (parent != null)
                    {
                        parent.GetComponent <Spawn> ().full = false;
                    }
                    spawns.full--;

                    parseIntfromString(other.name);
                    setParticlesbrkn();

                    //particle.particleSystem.startColor = RandomColor (frtHit1, frtHit2);
                    //particleSplsh.particleSystem.startColor = RandomColor(frtHitSplash1, frtHitSplash2);
                    AddScore(other.name);
                    FMOD_StudioSystem.instance.PlayOneShot("event:/01_sfx/flea_coconut", GameObject.Find("Main Camera").transform.position);
                    other.gameObject.GetComponent <Bullet>().DecreaseBullets();
                    PoolingSystem.DestroyAPS(other.gameObject);
                    PoolingSystem.DestroyAPS(this.gameObject);
                }
                else
                {
                    parseIntfromString(other.name);
                    setParticles();
                    //particle.particleSystem.startColor = RandomColor (frtHit1, frtHit2);
                    other.rigidbody.AddForce(0, bounce, 0, ForceMode.Impulse);                       // make the object bounce away
                    other.collider.enabled = false;
                    FMOD_StudioSystem.instance.PlayOneShot("event:/01_sfx/flea_coconut_break", camPos);
                    //if(Application.loadedLevelName.Contains ("7")){
                    clone = poolingSystem.InstantiateAPS("frtCoconasBrkn", transform.position, transform.rotation, parent);
                    clone.GetComponent <Coconut>().parent = parent;
                    //}
                    //else poolingSystem.InstantiateAPS ("frtCoconasBrkn", transform.position, transform.rotation);
                    PoolingSystem.DestroyAPS(this.gameObject);
                }
            }
        }
    }
예제 #7
0
 public static void DestroyAPS(this GameObject myobject)
 {
     PoolingSystem.DestroyAPS(myobject);
 }
예제 #8
0
 public void removeFruit(GameObject go)
 {
     fruits.Remove(go);
     PoolingSystem.DestroyAPS(go);
 }
예제 #9
0
 public void finishSplosion()
 {
     PoolingSystem.DestroyAPS(this.gameObject);
 }
예제 #10
0
 public void rmFirstFleak()
 {
     PoolingSystem.DestroyAPS(clone);
     launchpad.renderer.material.SetColor("_Color", Color.Lerp(orig, Color.black, 0.5f));
 }