Ejemplo n.º 1
0
    void init()
    {
        floorSpeed = 0.7f;
        currFloor  = 1;
        destFloor  = currFloor;
        movingUp   = false;
        movingDown = false;
        doorOpen   = false;

        elevatorController = GameObject.Find("GameController").GetComponent <ElevatorControllerScript> ();
        gameController     = GameObject.Find("GameController").GetComponent <GameControllerScript>();
        doorCollider       = gameObject.GetComponent <BoxCollider2D> ();

        anim = GetComponent <Animator> ();

        rand = new System.Random((int)System.DateTime.Now.Ticks & 0x0000FFFF);

        // Add elevator rooms to list
        elevatorRoom = new List <Transform> ();
        elevatorRoom.Add(transform.GetChild(0));
        elevatorRoom.Add(transform.GetChild(1));

        // Add indicators to elevator
        indicatorPos1 = gameObject.transform.FindChild("indicatorPos1").gameObject;
        indicatorPos2 = gameObject.transform.FindChild("indicatorPos2").gameObject;

        triggerIndicators();
    }
    // Initialize shared global variables here
    void init()
    {
        rand   = new System.Random((int)System.DateTime.Now.Ticks & 0x0000FFFF);
        coins += score;
        score  = 0;

        elevatorController = GetComponent <ElevatorControllerScript> ();
    }
    // Use this for initialization
    void Start()
    {
        elevatorLane  = 0;
        elevatorFloor = 0;

        elevatorController = GameObject.Find("GameController").GetComponent <ElevatorControllerScript> ();

        initBtns();
    }