Beispiel #1
0
    void nextPoint()
    {
        //checks if has next point
        if (!hasNext())
        {
            GameObject.FindGameObjectWithTag("LevelEnd").GetComponent <LevelEnd>().onTrigger();
        }

        //deactivates old gameobject
        currentPoint.SetActive(false);

        //gets gameobject
        index++;
        currentPoint = LevelPoints[index];

        //activates
        currentPoint.SetActive(true);

        //get levelpoint
        TutorialLevelPoint point = currentPoint.GetComponent <TutorialLevelPoint>();

        //activates if point can be triggered
        if (point.TriggerOnActivate)
        {
            point.onActivate();
        }

        //checks if timed
        if (point.isTimed)
        {
            isTiming = true;
            timeLeft = point.timeToWait;
        }
    }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        foreach (GameObject objects in LevelPoints)
        {
            objects.SetActive(false);
        }

        //activates first point
        currentPoint = LevelPoints[0];
        currentPoint.SetActive(true);

        //get levelpoint
        TutorialLevelPoint point = currentPoint.GetComponent <TutorialLevelPoint>();

        //activates if point can be triggered
        if (point.TriggerOnActivate)
        {
            point.onActivate();
        }

        //checks if timed
        if (point.isTimed)
        {
            isTiming = true;
            timeLeft = point.timeToWait;
        }
    }