Exemple #1
0
 public void OnTriggerExit2D(Collider2D C2D)
 {
     if (C2D.GetComponent <InputArea>() && C2D.GetComponent <InputArea>() == CurrentArea)
     {
         Deactivate();
     }
     if (C2D.GetComponent <InterObject>())
     {
         InterObject IO = C2D.GetComponent <InterObject>();
         if (InterObjects.Contains(IO))
         {
             InterObjects.Remove(IO);
         }
     }
     if (C2D.GetComponent <ChoiceRenderer>())
     {
         ChoiceRenderer CR = C2D.GetComponent <ChoiceRenderer>();
         if (CRs.Contains(CR))
         {
             CRs.Remove(CR);
         }
     }
     if (C2D.GetComponent <NPC>() && SelectingNPC == C2D.GetComponent <NPC>())
     {
         SelectingNPC = null;
     }
 }
Exemple #2
0
 public void OnTriggerEnter2D(Collider2D C2D)
 {
     if (Room.Current)
     {
         if (C2D.GetComponent <InputArea>())
         {
             CanInput    = true;
             CurrentArea = C2D.GetComponent <InputArea>();
         }
         if (C2D.GetComponent <InterObject>())
         {
             InterObject IO = C2D.GetComponent <InterObject>();
             if (!InterObjects.Contains(IO))
             {
                 InterObjects.Add(IO);
             }
         }
         if (C2D.GetComponent <ChoiceRenderer>())
         {
             ChoiceRenderer CR = C2D.GetComponent <ChoiceRenderer>();
             if (!CRs.Contains(CR))
             {
                 CRs.Add(CR);
             }
         }
         if (C2D.GetComponent <NPC>())
         {
             SelectingNPC = C2D.GetComponent <NPC>();
         }
     }
 }
Exemple #3
0
        public void CreateChoicesPanel(InterObject IO)
        {
            GameObject G = Instantiate(ChoicesPanelPrefab, IO.GetPanelTransform());

            G.transform.position = IO.GetPanelPosition();
            G.GetComponent <ChoicesPanel>().IO = IO;
            IO.CP = G.GetComponent <ChoicesPanel>();
        }
Exemple #4
0
        public void StartInterObject(InterObject IO)
        {
            string s = IO.GetCharacterAnimKey();

            if (s != "")
            {
                SetBoolAnim(s);
            }
        }
Exemple #5
0
 public void DisruptInterObject()
 {
     TargetInterObject = null;
     StopCoroutine("IODelayAnim");
     if (ActiveInterObject)
     {
         AC.StopInterObject();
         ActiveInterObject.Disable();
         ActiveInterObject = null;
     }
 }
Exemple #6
0
        public void SetTargetInterObject(InterObject IO)
        {
            if (!IO || TargetInterObject == IO)
            {
                return;
            }

            TargetInterObject = IO;
            if (IO.GetInterPosition().x < transform.position.x)
            {
                MoveTargetDirection = Direction.Left;
            }
            else if (IO.GetInterPosition().x > transform.position.x)
            {
                MoveTargetDirection = Direction.Right;
            }
            MoveTargeting = true;
        }
Exemple #7
0
        public InterObject GetSelectingInterObject()
        {
            if (InterObjects.Count <= 0)
            {
                return(null);
            }
            InterObject Temp = null;
            float       a    = float.PositiveInfinity;

            for (int i = InterObjects.Count - 1; i >= 0; i--)
            {
                if (!InterObjects[i] || !InterObjects[i].IsActive())
                {
                    continue;
                }
                if ((transform.position - InterObjects[i].transform.position).magnitude < a)
                {
                    Temp = InterObjects[i];
                    a    = (transform.position - InterObjects[i].transform.position).magnitude;
                }
            }
            return(Temp);
        }
Exemple #8
0
 public void ActivateInterObject(InterObject IO)
 {
     AC.StartInterObject(IO);
     ActiveInterObject = IO;
     IO.Activate();
 }