// Update is called once per frame
 void Update()
 {
     if(transition.blockMoney)
         return;
     if(placingItems && !waitingForInventory && openDelay > openDelayTime && Input.GetButtonDown ("Back")){
         EndPlacement ();
     }
     if(placingItems && !waitingForInventory){
         openDelay += Time.deltaTime;
         if(input.tickUp){
             currentPosition.Deselect ();
             currentPosition = currentPosition.up.GetComponent<ItemPositionScript>();
             currentPosition.Select ();
         }
         if(input.tickDown){
             currentPosition.Deselect ();
             currentPosition = currentPosition.down.GetComponent<ItemPositionScript>();
             currentPosition.Select ();
         }
         if(input.tickLeft){
             currentPosition.Deselect ();
             currentPosition = currentPosition.left.GetComponent<ItemPositionScript>();
             currentPosition.Select ();
         }
         if(input.tickRight){
             currentPosition.Deselect ();
             currentPosition = currentPosition.right.GetComponent<ItemPositionScript>();
             currentPosition.Select ();
         }
         if(openDelay > openDelayTime && Input.GetButtonDown ("Select")){
             waitingForInventory = true;
             inventory.GetItem ("position", gameObject);
         }
     }
 }
Exemplo n.º 2
0
 public void SetPosition(ItemPositionScript p)
 {
     pos = p;
     transform.position = p.transform.position;
 }
 // Use this for initialization
 void Start()
 {
     transition = GameObject.FindGameObjectWithTag("Transition").GetComponent<TransitionScript>();
     eventManager = GameObject.FindGameObjectWithTag("EventManager").GetComponent<EventManagerScript>();
     input = GameObject.Find ("EventManager").GetComponent<InputManagerScript>();
     inventory = GameObject.Find ("EventManager").GetComponent<InventoryScript>();
     currentPosition = start.GetComponent<ItemPositionScript>();
     positions = new ItemPositionScript[transform.childCount];
     for(int i = 0; i < transform.childCount; i++){
         positions[i] = transform.GetChild (i).GetComponent<ItemPositionScript>();
     }
 }
Exemplo n.º 4
0
 public void RemovePosition()
 {
     pos = null;
     transform.position = new Vector3(999f, 999f, 999f);
 }