Пример #1
0
 public void ShowChoices(string _answerA, string _answerB, bool hangUp, bool hold, int[] referral)
 {
     Debug.Log("Show choices");
     answerA = _answerA;
     answerB = _answerB;
     if (answerA.Length > 0)
     {
         answer1.gameObject.SetActive(true);
         answer1.transform.GetChild(0).GetComponent <Text>().text = answerA.ToUpper();
     }
     else
     {
         if (referral.Length > 0 && referral[0] > 0)
         {
             answer1.gameObject.SetActive(true);
             answer1.transform.GetChild(0).GetComponent <Text>().text = "...";
         }
         else
         {
             answer1.gameObject.SetActive(false);
         }
     }
     if (answerB.Length > 0)
     {
         answer2.gameObject.SetActive(true);
         answer2.transform.GetChild(0).GetComponent <Text>().text = answerB.ToUpper();
     }
     else
     {
         answer2.gameObject.SetActive(false);
     }
     HangUp.GetComponent <Image>().color = HangUp ? Color.white : Color.grey;
     Hold.GetComponent <Image>().color   = hold ? Color.white : Color.grey;
     ChoiceContainer.SetActive(true);
 }
Пример #2
0
    List <Vector3> GetColliderPoints()
    {
        Vector2[]      pts   = hold.GetComponent <PolygonCollider2D>().points;
        List <Vector3> final = new List <Vector3>();

        for (int i = 0; i < pts.Length; i++)
        {
            final.Add(new Vector3(pts[i].x, pts[i].y, 0));
        }
        return(final);
    }