Hello eveyone,
At the moment I am trying to workout the best of making and implementing a lift system for the gameplay enviroment. It will be reaching 4 differnt floors (including groundfloor). I have worked on the sudo code and I am struggling on how to start actully making the code now.
using UnityEngine;
using System.Collections;
public class Lift : MonoBehaviour {
//empty gameobjects at different floor heights
GameObject floor1height;
GameObject floor2height;
GameObject floor3height;
GameObject floor4height;
// current Floor Number
int currentfloor;
// Floor desitination
int floordes;
// inside buttons for pressing floors
GameObject input1;
GameObject input2;
GameObject input3;
GameObject input4;
// outside buttons
GameObject floor1input;
GameObject floor2input;
GameObject floor3input;
GameObject floor4input;
// Use this for initialization
void Start () {
int currentfloor = 1;
}
// Update is called once per frame
void Update () {
//if (input1 or floorinput1 is pressed){
// floordes=1;
//}
//if (input2 or floorinput2 is pressed){
// floordes=2;
//}
//if (input3 or floorinput3 is pressed){
// floordes=3;
//}
//if (input 4 or floorinput4 is pressed){
// floordes=4;
//}
//if (floordes=1){
// wait for 3 seconds;
// head to floorheight1;
//}
//if (floordes=2){
// wait for 3 seconds;
// head to floorheight2;
//}
//if (floordes=3){
// wait for 3 seconds;
// head to floorheight3;
//}
//if (floordes=4){
// wait for 3 seconds;
// head to floorheight4;
//}
}
}
If anyone has anyways I could improve the system please feel free to comment.