예제 #1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Player" && !meshesEnabled)
        {
            TurnOnMesh();
            meshesEnabled = true;
            other.GetComponent <Player>().currentRoom = this.transform;
        }

        //Temporary solution, should probably have something to call in Gregg instead of setting directly
        //Really need to update the logic better so that its not dependant on the room, but positioning
        if (other.tag == "Killer")
        {
            Gregg killer = other.GetComponent <Gregg>();
            killer.currentRoom = this;

            if (meshesEnabled || (litByFlashlight && Player.flashlightOn))
            {
                killer.TurnOnMesh();
            }
            else
            {
                killer.TurnOffMesh();
            }

            //if (hasActiveInteracts)
            //{
            //    foreach (InteractSetTrigger trigger in interacts)
            //    {
            //        trigger.state = InteractParent.State.Disabled;
            //        hasActiveInteracts = false;
            //    }
            //}
        }
    }
예제 #2
0
파일: Weapon.cs 프로젝트: hmoss333/RoomTest
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Killer")
        {
            Gregg killer = other.GetComponent <Gregg>();
            //Debug.Log("Hit the killer");
            if (!killer.stunned)
            {
                killer.StartStunTimer();
            }

            if (isMachette)
            {
                killer.health--;
            }
        }
    }
예제 #3
0
    public override void Interact()
    {
        if (!killerTeleported)
        {
            if (GameManager.step != 6)
            {
                killer = GameObject.FindObjectOfType <Gregg>();

                player.weaponPrefab = weapon;
                //GameManager.UpdateStep();
            }

            base.Interact();
            //TO DO: killer fight logic here
            Debug.Log("Do secret ending here");
            killerTeleported = true;
            StartCoroutine(TeleportKiller(killerSpawnTime));
        }
    }