예제 #1
0
파일: EventManager.cs 프로젝트: Arqu3/Sol
    public void OnPlayerJump(Vector2 position)
    {
        Debug.Log("Event on player jump");
        GameObject go = (GameObject)SolGame.SpawnResourceByName("PlayerJumpParticles", position, 0.5f);

        go.transform.Rotate(-90.0f, 0.0f, 0.0f);
    }
예제 #2
0
파일: EventManager.cs 프로젝트: Arqu3/Sol
    public void OnPlayerDashStart(Player player, Vector2 direction)
    {
        Debug.Log("Event on player dash start");

        ParticleSystem.EmissionModule em = player.GetDashChargeSystem().emission;
        em.enabled = false;

        GameObject go = (GameObject)SolGame.SpawnResourceByName("PlayerDashParticles", player.transform.position, 1.0f);

        go.transform.rotation = Quaternion.FromToRotation(Vector3.forward, -direction);
        go.transform.SetParent(player.transform);
    }
예제 #3
0
파일: Projectile.cs 프로젝트: Arqu3/Sol
    void OnCollisionEnter2D(Collision2D col)
    {
        GameObject particles = (GameObject)SolGame.SpawnResourceByName("ProjectileParticles", col.contacts[0].point, 1.0f);
        Vector2    normal    = col.contacts[0].normal;

        particles.transform.rotation = Quaternion.FromToRotation(Vector3.forward, normal);
        ProjectileParticles pp = particles.GetComponent <ProjectileParticles>();

        if (pp)
        {
            pp.SetColor(GetComponent <SpriteRenderer>().color);
        }

        PhysicsEntity pEntity = col.gameObject.GetComponent <PhysicsEntity>();

        if (pEntity)
        {
            pEntity.OnHit();
        }

        if (m_Bounce)
        {
            if (m_CurBounce >= m_NumBounce)
            {
                Destroy(gameObject);
            }
            else
            {
                ++m_CurBounce;
                m_Rigidbody.velocity = Vector2.Reflect(m_Velocity, normal);
                m_Velocity           = m_Rigidbody.velocity;
            }
        }
        else
        {
            Destroy(gameObject);
        }
    }
예제 #4
0
파일: EventManager.cs 프로젝트: Arqu3/Sol
 public void OnEnemyDeath(Vector2 position)
 {
     Debug.Log("Event on enemy death");
     SolGame.SpawnResourceByName("EnemyDeathParticles", position, 1.0f);
 }