Beispiel #1
0
    public void PopulateEndView()
    {
        scrollContainer = new GameObject();

        EventShower[]      eventViews = FindObjectsOfType <EventShower>();
        List <EventShower> lst        = new List <EventShower>(eventViews);

        lst.Sort((lhs, rhs) =>
        {
            return(lhs.eventOrder - rhs.eventOrder);
        });
        eventViews = lst.ToArray();



        for (int i = 0; i < eventViews.Length; ++i)
        {
            EventShower controller = eventViews[i];
            controller.transform.parent        = scrollContainer.transform;
            controller.transform.localPosition = startPoint + (-i * Vector3.up * scale);
        }


        endText.transform.parent        = scrollContainer.transform;
        endText.transform.localPosition = startPoint + (-eventViews.Length * Vector3.up * (scale)) + (2.5f * Vector3.up);
        ;

        //scrollContainer.transform.Translate(Vector3.left * 100.0f);
        Camera.main.transform.Translate(Vector3.left * 200.0f);
        time = 0.0f;

        shouldScroll = true;
    }
    public void SetEvent(Event theEvent)
    {
        GameObject newEventShower;

        newEventShower = (GameObject)Instantiate(viewer);

        if (currentEventShower != null)
        {
            currentEventShower.MoveOn();
        }

        currentEventShower = newEventShower.GetComponent <EventShower> ();
        currentEventShower.SetEvent(theEvent);
        currentEventShower.MoveIn();
        currentEventShower.eventOrder = counter;
        ++counter;

        newEventSound.Play();
    }
 void Start()
 {
     currentEventShower = null;
     counter            = 0;
 }