Example #1
0
        private void Awake()
        {
            _cinematic          = GetComponent <Cinematic>();
            _interactionManager = GameObject.FindWithTag("InteractionManager").GetComponent <InteractionManager>();
            _spriteRenderer     = GetComponentInParent <SpriteRenderer>();
            if (wanderingWhispers.Length > 0)
            {
                eventInstance = RuntimeManager.CreateInstance(wanderingWhispers);
            }

            var child = GetComponentInChildren <ObjectProximity>();

            if (child != null)
            {
                child.objectEnum = objectEnum;
            }
            else
            {
                Debug.LogError(
                    $"{nameof(ObjectInteraction)} {objectEnum} has no child with component {typeof(ObjectProximity)}");
            }
        }