Ejemplo n.º 1
0
    private void OnTriggerExit(Collider other)
    {
        var player = other.gameObject.GetComponent <CharacterController>();

        if (player != null)
        {
            ModificationSystem.MakeChange(parent, changeType);
        }
    }
Ejemplo n.º 2
0
    private void Update()
    {
        SightZone sightZone   = GlobalState.get().sightZone;
        bool      inSightZone = sightZone.GetComponent <Collider>().bounds.Intersects(GetComponent <Collider>().bounds);

        if (holder.held == null && inSightZone && !gameObject.GetComponent <Renderer>().isVisible)
        {
            ModificationSystem.MakeChange(this, sightZone.changeType);
        }
    }
Ejemplo n.º 3
0
    public override void OnInteract()
    {
        bool inFacesZone = GlobalState.get().facesZone.GetComponent <Collider>().bounds.Intersects(parent.GetComponent <Collider>().bounds);

        if (parent.holder.held == null && inFacesZone)
        {
            ModificationSystem.MakeChange(parent, changeType);
        }
        parent.OnFace();
    }
Ejemplo n.º 4
0
 private void Update()
 {
     foreach (var box in countdowns.Keys.ToList())
     {
         var state = countdowns[box];
         if (!state.changing)
         {
             countdowns.Remove(box);
             continue;
         }
         state.countdown -= Time.deltaTime;
         if (state.countdown <= 0)
         {
             countdowns.Remove(box);
             ModificationSystem.MakeChange(box, changeType);
         }
     }
 }
Ejemplo n.º 5
0
    public void OnTriggerExit(Collider other)
    {
        Triggerable triggerable = other.GetComponent <Triggerable>();

        if (triggerable == null || countdown > 0)
        {
            return;
        }
        if (Input.GetKey(KeyCode.W))
        {
            countdown = cooldownSeconds;
            ModificationSystem.MakeChange(triggerable, forwardChange);
        }
        else if (Input.GetKey(KeyCode.S))
        {
            countdown = cooldownSeconds;
            ModificationSystem.MakeChange(triggerable, backwardChange);
        }
    }