32 lines
653 B
C#
32 lines
653 B
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class TriggerDoor : DetectionZone
|
||
|
{
|
||
|
public string DoorOpenAnimatorParamName = "DoorOpen";
|
||
|
|
||
|
Animator animator;
|
||
|
|
||
|
void Start(){
|
||
|
animator = GetComponent<Animator>();
|
||
|
}
|
||
|
|
||
|
void Update() {
|
||
|
if(detectedObjs.Count > 0) {
|
||
|
animator.SetBool(DoorOpenAnimatorParamName, true);
|
||
|
} else {
|
||
|
animator.SetBool(DoorOpenAnimatorParamName, false);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public void triggerDoor()
|
||
|
{
|
||
|
animator = GetComponent<Animator>();
|
||
|
|
||
|
animator.SetBool(DoorOpenAnimatorParamName, true);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|