Example #1
0
    public void SetToFlyingController()
    {
        SetController(flyingController);
        GameObject growWingsParticle = growWingsPool.Spawn();

        growWingsParticle.transform.localPosition = new Vector3(0, 0, 0);
        growWingsParticle.GetComponent <RexParticle>().Play();
    }
Example #2
0
    public void CreateHitSparkAtPosition(Vector2 position, Type type)
    {
        RexParticle spark = (type == Type.DamagedSpark) ? damagedSparkPool.Spawn().GetComponent <RexParticle>() : notDamagedSparkPool.Spawn().GetComponent <RexParticle>();

        spark.transform.position         = position;
        spark.transform.localEulerAngles = new Vector3(0, 0, RexMath.RandomFloat(0, 360));
        spark.Play();
    }
Example #3
0
        protected void SpawnLandingParticle()
        {
            GameObject particle = landingParticlePool.Spawn();

            ParentHelper.Parent(particle, ParentHelper.ParentObject.Particles);
            particle.transform.position = new Vector3(landingParticlePool.transform.position.x + particleOffset.x, landingParticlePool.transform.position.y + particleOffset.y, 0.0f);
            particle.GetComponent <RexParticle>().Play();
        }
Example #4
0
        protected void GenerateExitSplash(Vector2 location, Transform actor)
        {
            if (exitSplashPool)
            {
                GameObject splash = exitSplashPool.Spawn().gameObject;
                splash.GetComponent <RexParticle>().Play();
                splash.transform.position = new Vector3(location.x, location.y, splash.transform.position.z);
            }

            if (CameraHelper.CameraContainsPoint(actor.position, 1.5f))
            {
                PlaySplashSound();
            }
        }
        public void ShowNumber(int damageAmount, Vector2 _position)
        {
            DamageNumber damageNumber = spawnPool.Spawn().GetComponent <DamageNumber>();

            damageNumber.Show(damageAmount, _position, spawnPool);
        }