// *************************************************************************************************************
    // find the next level, and calculate the position of the destination
    // *************************************************************************************************************
    public void Next()
    {
        nextLevel = elevator.Next();

        destPos.x = transform.position.x;
        destPos.y = nextLevel.gameObject.transform.position.y;
        destPos.z = transform.position.z;
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        // make dictionary
        MakeDictionary();

        // find platform in children
        if (!platform)
        {
            platform = gameObject.GetComponentInChildren<Elevator_Platform>();
        }

        // initial the next level
        nextLevel = levels[startAtLevelIndex];
    }
Exemplo n.º 3
0
 void RecalculateNext()
 {
     // in this case just loop the levels, use the start at level index as the current index
     startAtLevelIndex = (startAtLevelIndex + 1) % levels.Length;
     nextLevel = levels[startAtLevelIndex];
 }