void Update()
    {
        if (checkForInteractables)
        {
            RaycastHit hit;
            Vector3    origin = transform.position + (Vector3.up * 1.5f);

            var didHit = Physics.Raycast(origin, transform.forward, out hit, checkDistance, layersToCheck);

            if (didHit)
            {
                var tmp = hit.collider.GetComponent <InteractableSystem>();
                if (tmp != currentInteractable)
                {
                    currentInteractable = tmp;

                    if (currentInteractable != null)
                    {
                        currentInteractable.SetOutlinesEnabled(true);
                    }
                }
            }
            else
            {
                if (currentInteractable != null)
                {
                    currentInteractable.SetOutlinesEnabled(false);
                }

                currentInteractable = null;
            }
        }
    }
Example #2
0
    void Start()
    {
        heroRuntime = new HeroRuntime(GetComponent <SaveGameIdSystem>().SaveGameId, null, null);

        var gameSystem = FindObjectOfType <GameSystem>();

        gameSystem.heroes.Add(this);

        interactableSystem = GetComponent <InteractableSystem>();
        rewiredPlayer      = ReInput.players.GetPlayer(0);
    }
Example #3
0
 public InteractableEvent(InteractableSystem sender, InteractableSystem receiver, EInteractType interactType)
 {
     this.sender       = sender;
     this.receiver     = receiver;
     this.interactType = interactType;
 }