Exemplo n.º 1
0
 void onTriggerEnter(Collider other)
 {
     if (other.CompareTag("Enemy"))
     {
         camera.Shake(new Vector3(8, 8, 0));
     }
 }
Exemplo n.º 2
0
 public void Damage(float damage)
 {
     camera.Shake(new Vector3(Random.Range(-5, 5), 5, 0));
     health -= Mathf.Abs(damage);
     if (health <= 0)
     {
         Die();
     }
 }
Exemplo n.º 3
0
    private void CreateScrapEffect(int scrapAmount)
    {
        m_Animator.SetTrigger("Hit");
        m_Camera.Shake(.05f, .05f);                                                     //shake camera
        var instantScrapEffect = Instantiate(m_ScrapEffect);                            //create scraps effect on scene

        instantScrapEffect.transform.position = transform.position;                     //place created scraps effect on this gameobject

        var player = GameMaster.Instance.m_Player.transform.GetChild(0).transform;      //get player transform

        instantScrapEffect.GetComponent <ScrapObject>().SetTarget(player, scrapAmount); //move scraps to player
    }
Exemplo n.º 4
0
 public bool Bonk(Vector2 dir, float duration, int bonkingTeamNum = -1)
 {
     if (bonkingTeamNum == me.teamNum)
     {
         return(false);
     }
     bonkSFX = GameManager.instance.sfx["BonkSFX"];
     DropAll(dir);
     rb.velocity = dir.normalized * 0.5f;
     // fx and stuff
     // play tweety bird animation
     setMovHandle(0.004f, duration);
     setStarsActive(duration);
     setMovSpeed(speed * 0.2f, duration);
     bonkSFX.Play();
     camScript.Shake(0.35f);
     return(true);
 }