Exemple #1
0
 void Start()
 {
     player       = GameObject.FindGameObjectWithTag("Player");
     playerHealth = player.GetComponent <PlayerHealth>();
     rb           = GetComponent <Rigidbody>();
     boxCollider  = GetComponent <BoxCollider>();
     moveForward  = GetComponent <moveForward>();
 }
Exemple #2
0
    void assign(int plane, string lane)
    {
        string     id  = "Plane" + (plane - 1);
        GameObject obj = GameObject.Find(id);

        if (obj == null)
        {
            return;
        }
        moveScript = obj.GetComponent <moveForward> ();
        selectLane(moveScript, lane);

        Debug.Log("Lane Selected for Plane" + moveScript.index + "is Lane " + lane);
    }
Exemple #3
0
    void selectLane(moveForward mF, string lane)
    {
        switch (lane)
        {
        case "a":
            mF.laneA();
            break;

        case "b":
            mF.laneB();
            break;

        case "c":
            mF.laneC();
            break;
        }
    }
Exemple #4
0
 void Start()
 {
     rb          = GetComponent <Rigidbody>();
     boxCollider = GetComponent <BoxCollider>();
     moveForward = GetComponent <moveForward>();
 }