Пример #1
0
 protected override void CheckCanPlace(RaycastHit hit, Interaction main)
 {
     if (main.Currents().Count > 1 || main.Currents()[0].CompareTag(tag))
     {
         Debug.Log("Not Allowed!");
     }
     else
     {
         GenericInteraction current = main.Currents()[0];//will always be this as the first element
         current.SetDesination(transform.position + yDist);
         current.SetCell(localCell);
         current.SetParent(this);
         localInteractions.Add(current);
         StartCoroutine(main.OnPutDown(current));
     }
 }
Пример #2
0
 protected override void CheckCanPlace(RaycastHit hit, Interaction main)
 {
     if (main.Currents().Count > 1 || main.Currents()[0].CompareTag(tag))//more than one object in hand
     {
         Debug.Log("Cant do that");
     }
     else
     {
         DynamicCell cell = GetPosition(dynamicPositions, hit.point);
         if (cell != null)
         {
             GenericInteraction current = main.Currents()[0];
             current.SetDesination(cell.transform.position);
             current.SetParent(this);
             current.SetCell(cell);
             localInteractions.Add(current);
             StartCoroutine(main.OnPutDown(current));
         }
         else
         {
             Debug.Log("slot Taken");
         }
     }
 }