Example #1
0
    void OnTriggerExit(Collider collider)
    {
        IAvoider avoider = collider.gameObject.GetComponent <IAvoider>();

        if (avoider != null)
        {
            avoider.RemoveObjectToAvoid(this);
        }
    }
    // Start is called before the first frame update
    void Start()
    {
        this.avoiderComponent = this.GetComponent <Avoider>();

        this.movement = this.GetComponent <NPCMovement>();

        Animator animator = this.GetComponent <Animator>();

        headTransform = animator.GetBoneTransform(HumanBodyBones.Head);

        this.isShyNPC = Random.Range(0.0f, 1.0f) > 0.5f;
        this.preferredLookAwayDirection = new Vector3(Random.Range(-20f, 20f), Random.Range(-20f, 20f), 0.0f);
    }
Example #3
0
 public AvoidanceManager()
 {
     Avoider = new DefaultAvoider();
 }
 void Start()
 {
     this.avoiderComponent = this.GetComponent <Avoider>();
 }