Exemple #1
0
        private void Load(bool value)
        {
            Debug.Log("Loaded: " + value);

            timer   = 0;
            loading = null;
            Loaded  = value;
            loadedGraphic.SetActive(Loaded);
            InteractionManager.Instance.ShowProgressBar(false);

            if (Loaded)
            {
                source.PlayOneShot(loadClip);
                stored.amount--;
                if (Using)
                {
                    if (stored.amount < itemNeeded.inventoryMax)
                    {
                        InteractionManager.Instance.ShowBottomText(true);
                        InteractionManager.Instance.SetBottomText(unloadInteraction.GetInteractionMsg());
                    }
                }
            }
            else
            {
                source.PlayOneShot(unloadClip);
                stored.amount++;
                if (Using)
                {
                    if (stored.amount > 0)
                    {
                        InteractionManager.Instance.ShowBottomText(true);
                        InteractionManager.Instance.SetBottomText(loadInteraction.GetInteractionMsg());
                    }
                }
            }

            if (Loaded && !Using)
            {
                InteractionInfo[] info = new InteractionInfo[] { useInteraction, unloadInteraction };
                interaction.SetInteractions(info);
            }
            else if (!Loaded && !Using)
            {
                InteractionInfo[] info = new InteractionInfo[] { useInteraction, loadInteraction };
                interaction.SetInteractions(info);
            }
        }
Exemple #2
0
        private void StopUse()
        {
            Debug.Log("Stop Use");

            CameraControls.Instance.SetParamaters(CameraControls.CameraSetup.DEFAULT);
            CameraControls.Instance.ResetPosition();

            InteractionManager.Instance.ShowBottomText(false);
            InteractionManager.Instance.ShowProgressBar(false);

            Using = false;
            if (Loaded)
            {
                InteractionInfo[] info = new InteractionInfo[] { useInteraction, unloadInteraction };
                interaction.SetInteractions(info);
            }
            else
            {
                InteractionInfo[] info = new InteractionInfo[] { useInteraction, loadInteraction };
                interaction.SetInteractions(info);
            }
        }
Exemple #3
0
        IEnumerator DelayUse()
        {
            CameraControls.Instance.SetParamaters(CameraControls.CameraSetup.CANNON);
            CameraControls.Instance.MatchTransform(playerPosition, adjustX, true);

            yield return(null);

            Debug.Log("Use");

            Using = true;
            InteractionInfo[] info = new InteractionInfo[] { };
            interaction.SetInteractions(info);
            InteractionManager.Instance.ClearInteraction();

            stored = Inventory.Instance.GetStoredFromItem(itemNeeded);

            if (!Loaded)
            {
                if (stored != null)
                {
                    if (stored.amount > 0)
                    {
                        InteractionManager.Instance.ShowBottomText(true);
                        InteractionManager.Instance.SetBottomText(loadInteraction.GetInteractionMsg());
                    }
                }
            }
            else
            {
                if (stored != null)
                {
                    if (stored.amount < itemNeeded.inventoryMax)
                    {
                        InteractionManager.Instance.ShowBottomText(true);
                        InteractionManager.Instance.SetBottomText(unloadInteraction.GetInteractionMsg());
                    }
                }
            }
        }