Exemple #1
0
    // Use this for initialization
    void Awake()
    {
        models = new GameObject[transform.childCount];
        for (int i = 0; i < transform.childCount; i++)
        {
            models[i] = transform.GetChild(i).gameObject;
            models[i].SetActive(false);
        }
        models[Random.Range(0, models.Length - 1)].SetActive(true);

        GetComponent <Rigidbody> ().velocity = new Vector3();

        displayText = GetComponentInChildren <Text>();
        locationID  = Info.getRandomLocation();

        Canvas canvas = this.gameObject.AddComponent <Canvas>();

        canvas.renderMode = RenderMode.WorldSpace;
        GameObject go = new GameObject("LetterText");

        go.transform.SetParent(canvas.transform);
        displayText = go.AddComponent <Text>();

        Font morris = Resources.Load <Font>("MorrisRoman-Black");

        displayText.font = morris;

        displayText.transform.localScale    = new Vector3(0.01f, 0.01f, 1);
        displayText.transform.localPosition = new Vector3(0, 0, 0);
        displayText.fontSize  = 20;
        displayText.alignment = TextAnchor.UpperCenter;
        setStartData(locationID);
        StartCoroutine("Timer");
    }
Exemple #2
0
 public void addLetter(Letter l)
 {
     if (_laden)
     {
         Debug.Log("Birb is carrying too much");
     }
     else
     {
         letterLocation = (Info.Location)l.getLocation();
         l.transform.SetParent(gameObject.transform);
         setBirbLaden(true);
         l.gameObject.SetActive(false);
         source.PlayOneShot(attachObjectSound);
     }
 }
Exemple #3
0
 public void setLocation(Info.Location loc)
 {
     letterLocation = loc;
 }
Exemple #4
0
 void setStartData(Info.Location id)
 {
     this.displayDestination = Info.getRandomSender(id);
     displayText.text        = displayDestination;
 }