Beispiel #1
0
    void OnTriggerEnter(Collider col)
    {
        //if (col.gameObject.tag.Equals("Guard") || col.gameObject.tag.Equals("Killer Guards"))
        //{
        //    SetDestination();
        //}
        //else if (this.gameObject.tag.Equals("Guard") && col.gameObject.layer == 8)
        //{
        //    SetDestination();
        //}

        if (this.gameObject.tag.Equals("Killer Guards") && col.gameObject.layer == 8 && col.gameObject != NewControl.objective)
        {
            // this.anim.SetTrigger("WannaKill");
            //this.anim.SetBool("wannaKill", true);
            Death.AnimDeath(col.gameObject, col.gameObject.transform.position, col.gameObject.transform.rotation);
            RuntimeManager.PlayOneShot("event:/BipedSeek/Player/Death/Death", this.transform.position);
            col.gameObject.GetComponent <PlayerControl>().RespawnCoolDown();
            //  this.anim.SetBool("wannaKill", false);
        }
        else if (this.gameObject.tag.Equals("Killer Guards") && col.gameObject.layer == 8 && col.gameObject == NewControl.objective)
        {
            // this.anim.SetTrigger("WannaKill");
            //this.anim.SetBool("wannaKill", true);
            NewControl.objKilledByGuard = true;
            // Death.AnimDeath(col.gameObject, col.gameObject.transform.position, col.gameObject.transform.rotation);
            //this.anim.SetBool("wannaKill", false);
        }
    }
Beispiel #2
0
    public void Kill(GameObject gO)
    {
        if (gO.gameObject.tag.Equals("Guard") || gO.gameObject.tag.Equals("Killer Guards")) //canviar aixo?
        {
            this.detected           = false;
            this.scoreGeneral      -= 5;
            this.scoreGeneralRound -= 5;

            if (gO.gameObject.tag.Equals("Guard"))
            {
                gO.GetComponent <NPCConnectedPatrol>().Respawn(gO);
            }
            else if (gO.gameObject.tag.Equals("Killer Guards"))
            {
                Destroy(gO.gameObject);
            }
            RuntimeManager.PlayOneShot("event:/BipedSeek/NPC/Death", gO.transform.position);
            RuntimeManager.PlayOneShot("event:/BipedSeek/Player/Death/Death", this.transform.position);
            Death.AnimDeath(this.gameObject, this.gameObject.transform.position, this.gameObject.transform.rotation);
            this.gameObject.GetComponent <PlayerControl>().RespawnCoolDown();
        }
        else if (gO.gameObject.layer == 8 && gO != NewControl.objective)
        {
            this.detected = false;
            gO.gameObject.GetComponent <PlayerControl>().detected = false;
            this.scoreGeneral      += 10;
            this.scoreKills        += 1;
            this.scoreGeneralRound += 10;

            gO.gameObject.GetComponent <PlayerControl>().scoreGeneral      -= 10;
            gO.gameObject.GetComponent <PlayerControl>().scoreGeneralRound -= 10;

            //this.scoreKillsRound += 1;
            RuntimeManager.PlayOneShot("event:/BipedSeek/Player/Death/Death", gO.transform.position);
            gO.gameObject.GetComponent <PlayerControl>().RespawnCoolDown();
        }
        else if (gO.gameObject.layer == 8 && gO == NewControl.objective)
        {
            this.detected = false;
            gO.gameObject.GetComponent <PlayerControl>().detected = false;
            if (!Tutorial_InGame.showIt && !Abilities_Tutorial.show)
            {
                NewControl.parcialWinner = this.gameObject;
                NewControl.objComplete   = true;
            }
            Rondes.timesPlayed++;
            if (!Tutorial_InGame.showIt && !Abilities_Tutorial.show)
            {
                GameObject.Find("Control").GetComponent <EventosMapa>().Default();
            }
            RuntimeManager.PlayOneShot("event:/BipedSeek/Player/Death/Objective_Death", gO.transform.position);
        }
    }
Beispiel #3
0
    private void OnTriggerEnter(Collider other)
    {
        if (this.gameObject.GetComponentInParent <PlayerControl>().wannaKill)
        {
            if (other.gameObject != null && other.gameObject.tag != "Death" && other.gameObject.name != "mixamorig:LeftHand")
            {
                if (other.gameObject != NewControl.objective)
                {
                    Death.AnimDeath(other.gameObject, other.gameObject.transform.position, other.gameObject.transform.rotation);
                }
                this.gameObject.GetComponentInParent <PlayerControl>().Kill(other.gameObject);
            }

            this.gameObject.GetComponentInParent <PlayerControl>().wannaKill = false;
        }
    }