Exemple #1
0
 public override void Interact()
 {
     if (pcFunctions == null)
     {
         pcFunctions = FindObjectOfType <HomePCInteractions>();
     }
     if (currentPC == null)
     {
         currentPC = pcFunctions.gameObject.GetComponent <Interactivity>();
     }
     currentPC.OpenMenu();
 }
Exemple #2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(instance);
         instance = null;
         instance = this;
     }
 }
Exemple #3
0
        public override void FinishUsing(bool cancel)
        {
            ResetObjectState(cancel);
            if (pcFunctions == null)
            {
                pcFunctions = FindObjectOfType <HomePCInteractions>();
            }
            pcFunctions.FinishActions();

            void ResetAction()
            {
                SpriteControler.Instance.ChangeSortingOrder(0);
                GetComponent <SpriteRenderer>().sortingOrder = 0;
            }

            PlayerAnimationHelper.ResetAnimations();
            PlayerCommands.WalkBackToLastPosition(ResetAction);
            GamePauseHandler.UnSubscribeCloseEvent(EscCloseEvent);
        }
Exemple #4
0
        public void TrueInteract(Action action)
        {
            var result = TrySetCurrentAction("Sit");

            if (result)
            {
                SpriteControler.Instance.ChangeSortingOrder(1);
                GetComponent <SpriteRenderer>().sortingOrder = 2;
                if (pcFunctions == null)
                {
                    pcFunctions = FindObjectOfType <HomePCInteractions>();
                }
                PlayerCommands.MoveTo(this, () => { BeginUsing(); action(); });
            }
            else
            {
                result.PrintErrorMessage();
            }
        }
Exemple #5
0
 private void Start()
 {
     pcFunctions = FindObjectOfType <HomePCInteractions>();
     currentPC   = pcFunctions.gameObject.GetComponent <Interactivity>();
 }