Пример #1
0
        /// <summary>
        /// Handles interacting with various level objects such as respawn points.
        /// </summary>
        /// <returns>Is the interaction successful</returns>
        public bool HandleInteractionInput()
        {
            bool input = Input.GetInteractInput();

            if (input && InteractionTarget != null)
            {
                // TODO: No more energy charges.

                // Checks whether the energy cost is not too high
                if (World.Instance.CurrentEnergyCharges >=
                    InteractionTarget.EnergyCost)
                {
                    if (InteractionTarget.Interact())
                    {
                        //if (InteractionTarget.EnergyCost != 0)
                        //{
                        //    // Removes the energy cost from the players
                        //    EnergyCollector.ChangeCharges(-1 * InteractionTarget.EnergyCost);
                        //}

                        // Makes the interaction target forget the player
                        InteractionTarget.TryRemoveInteractorAfterInteraction();

                        return(true);
                    }
                }
            }

            return(false);
        }