Esempio n. 1
0
    public IEnumerator stabTarget(Collider2D other)
    {
        Debug.Log("TRYING TO STAB THIS F'ING TARGET");
        switchAnim(anim, 2);
        yield return(new WaitForSeconds(0.6f));

        setTarget(null);
        setAttacking(false);
        StartCoroutine(other.gameObject.GetComponent <Character> ().reactToGetHit(this.gameObject.GetComponent <Collider2D>(), myQueue_Script.myItemObjects [0]));
        myQueue_Script.removeUsedObjectFromOwnerQueue();
        myQueue_Script.displayNewQueueVisualFromOwnerQueueList();
        setLiability(false);
        switchAnim(anim, 0);
//		if(!iAmDead && !other.gameObject.GetComponent<Character>().getStabBack()){
//			StartCoroutine (walkBackToStartPosition (myStartPosition, 0.0f));
//		}
//		else if(!iAmDead && other.gameObject.GetComponent<Character>().getStabBack()){
//			yield return new WaitForSeconds(2.0f);
//			StartCoroutine (walkBackToStartPosition (myStartPosition, 0.0f));
//		}
    }
Esempio n. 2
0
 void OnMouseUp()
 {
     iAmBeingMoved = false;
     if (touchingWhereIWantToBe)
     {
         transform.position = itemGoesToThisSpot;
         //for Tutorial
         tapOnSyringeCounter++;
     }
     else
     {
         QueueScript1 myQueueScript = GetComponentInParent <QueueScript1>();
         myQueueScript.myItemObjects.Insert(positionICameFrom, this.GetComponent <Item_Set>());
         myQueueScript.displayNewQueueVisualFromOwnerQueueList();
         transform.position = (Vector2)startPosition;
     }
 }
Esempio n. 3
0
 public void previewNewQueue(Collider2D coll)
 {
     if (coll.gameObject.name == "Orange_Spot1")
     {
         Debug.Log("TOUCHING ORANGE SPOT 1");
         QueueScript1 orangeQueueScript = coll.GetComponentInParent <QueueScript1>();
         orangeQueueScript.myItemObjects.Insert(0, this.GetComponent <Item_Set>());
         orangeQueueScript.displayNewQueueVisualFromOwnerQueueList();
         touchingWhereIWantToBe = true;
         itemGoesToThisSpot     = (Vector2)coll.transform.position;
     }
     else if (coll.gameObject.name == "Orange_Spot2")
     {
         Debug.Log("TOUCHING ORANGE SPOT 2");
         QueueScript1 orangeQueueScript = coll.GetComponentInParent <QueueScript1>();
         if (orangeQueueScript.myItemObjects.Count > 0)
         {
             Debug.Log("GOING INTO ORANGE SPT 2");
             orangeQueueScript.myItemObjects.Insert(1, this.GetComponent <Item_Set>());
             itemGoesToThisSpot = (Vector2)coll.transform.position;
         }
         else if (orangeQueueScript.myItemObjects.Count == 0)
         {
             orangeQueueScript.myItemObjects.Insert(0, this.GetComponent <Item_Set>());
             itemGoesToThisSpot = (Vector2)orangeQueueScript.myQSpots[0].transform.position;
         }
         orangeQueueScript.displayNewQueueVisualFromOwnerQueueList();
         touchingWhereIWantToBe = true;
     }
     else if (coll.gameObject.name == "Orange_Spot3")
     {
         Debug.Log("TOUCHING ORANGE SPOT 3");
         QueueScript1 orangeQueueScript = coll.GetComponentInParent <QueueScript1>();
         if (orangeQueueScript.myItemObjects.Count >= 2)
         {
             orangeQueueScript.myItemObjects.Insert(2, this.GetComponent <Item_Set>());
             itemGoesToThisSpot = (Vector2)coll.transform.position;
         }
         else if (orangeQueueScript.myItemObjects.Count == 1)
         {
             orangeQueueScript.myItemObjects.Insert(1, this.GetComponent <Item_Set>());
             itemGoesToThisSpot = (Vector2)orangeQueueScript.myQSpots[1].transform.position;
         }
         else
         {
             orangeQueueScript.myItemObjects.Insert(0, this.GetComponent <Item_Set>());
             itemGoesToThisSpot = (Vector2)orangeQueueScript.myQSpots[0].transform.position;
         }
         orangeQueueScript.displayNewQueueVisualFromOwnerQueueList();
         touchingWhereIWantToBe = true;
     }
     else if (coll.gameObject.name == "Blue_Spot1")
     {
         Debug.Log("TOUCHING Blue SPOT 1");
         QueueScript1 blueQueueScript = coll.GetComponentInParent <QueueScript1>();
         blueQueueScript.myItemObjects.Insert(0, this.GetComponent <Item_Set>());
         blueQueueScript.displayNewQueueVisualFromOwnerQueueList();
         touchingWhereIWantToBe = true;
         itemGoesToThisSpot     = (Vector2)coll.transform.position;
     }
     else if (coll.gameObject.name == "Blue_Spot2")
     {
         Debug.Log("TOUCHING Blue SPOT 2");
         QueueScript1 blueQueueScript = coll.GetComponentInParent <QueueScript1>();
         if (blueQueueScript.myItemObjects.Count > 0)
         {
             Debug.Log("GOING INTO BLUE SPT 2");
             blueQueueScript.myItemObjects.Insert(1, this.GetComponent <Item_Set>());
             itemGoesToThisSpot = (Vector2)coll.transform.position;
         }
         else
         {
             blueQueueScript.myItemObjects.Insert(0, this.GetComponent <Item_Set>());
             itemGoesToThisSpot = (Vector2)blueQueueScript.myQSpots[0].transform.position;
         }
         blueQueueScript.displayNewQueueVisualFromOwnerQueueList();
         touchingWhereIWantToBe = true;
     }
     else if (coll.gameObject.name == "Blue_Spot3")
     {
         Debug.Log("TOUCHING Blue SPOT 3");
         QueueScript1 blueQueueScript = coll.GetComponentInParent <QueueScript1>();
         if (blueQueueScript.myItemObjects.Count >= 2)
         {
             blueQueueScript.myItemObjects.Insert(2, this.GetComponent <Item_Set>());
             itemGoesToThisSpot = (Vector2)coll.transform.position;
         }
         else if (blueQueueScript.myItemObjects.Count == 1)
         {
             blueQueueScript.myItemObjects.Insert(1, this.GetComponent <Item_Set>());
             itemGoesToThisSpot = (Vector2)blueQueueScript.myQSpots[1].transform.position;
         }
         else
         {
             blueQueueScript.myItemObjects.Insert(0, this.GetComponent <Item_Set>());
             itemGoesToThisSpot = (Vector2)blueQueueScript.myQSpots[0].transform.position;
         }
         blueQueueScript.displayNewQueueVisualFromOwnerQueueList();
         touchingWhereIWantToBe = true;
     }
     else if (coll.gameObject.name == "Green_Spot1")
     {
         Debug.Log("TOUCHING green SPOT 1");
         QueueScript1 greenQueueScript = coll.GetComponentInParent <QueueScript1>();
         greenQueueScript.myItemObjects.Insert(0, this.GetComponent <Item_Set>());
         greenQueueScript.displayNewQueueVisualFromOwnerQueueList();
         touchingWhereIWantToBe = true;
         itemGoesToThisSpot     = (Vector2)coll.transform.position;
     }
     else if (coll.gameObject.name == "Green_Spot2")
     {
         Debug.Log("TOUCHING green SPOT 2");
         QueueScript1 greenQueueScript = coll.GetComponentInParent <QueueScript1>();
         itemGoesToThisSpot = (Vector2)startPosition;
         if (greenQueueScript.myItemObjects.Count > 0)
         {
             Debug.Log("GOING INTO GREEN SPT 2");
             greenQueueScript.myItemObjects.Insert(1, this.GetComponent <Item_Set>());
             itemGoesToThisSpot = (Vector2)coll.transform.position;
         }
         else
         {
             greenQueueScript.myItemObjects.Insert(0, this.GetComponent <Item_Set>());
             itemGoesToThisSpot = (Vector2)greenQueueScript.myQSpots[0].transform.position;
         }
         greenQueueScript.displayNewQueueVisualFromOwnerQueueList();
         touchingWhereIWantToBe = true;
     }
     else if (coll.gameObject.name == "Green_Spot3")
     {
         Debug.Log("TOUCHING green SPOT 3");
         QueueScript1 greenQueueScript = coll.GetComponentInParent <QueueScript1>();
         itemGoesToThisSpot = (Vector2)startPosition;
         if (greenQueueScript.myItemObjects.Count >= 2)
         {
             greenQueueScript.myItemObjects.Insert(2, this.GetComponent <Item_Set>());
             itemGoesToThisSpot = (Vector2)coll.transform.position;
         }
         else if (greenQueueScript.myItemObjects.Count == 1)
         {
             greenQueueScript.myItemObjects.Insert(1, this.GetComponent <Item_Set>());
             itemGoesToThisSpot = (Vector2)greenQueueScript.myQSpots[1].transform.position;
         }
         else
         {
             greenQueueScript.myItemObjects.Insert(0, this.GetComponent <Item_Set>());
             itemGoesToThisSpot = (Vector2)greenQueueScript.myQSpots[0].transform.position;
         }
         greenQueueScript.displayNewQueueVisualFromOwnerQueueList();
         touchingWhereIWantToBe = true;
     }
 }
Esempio n. 4
0
    public void removePreview(Collider2D coll)
    {
        itemGoesToThisSpot = (Vector2)startPosition;

        if (coll.gameObject.name == "Orange_Spot1")
        {
            Debug.Log("Removing from ORANGE SPOT 1");
            QueueScript1 orangeQueueScript = coll.GetComponentInParent <QueueScript1>();
            orangeQueueScript.myItemObjects.Remove((Item_Set)this.GetComponent <Item_Set>());
            orangeQueueScript.displayNewQueueVisualFromOwnerQueueList();
            itemGoesToThisSpot     = (Vector2)startPosition;
            touchingWhereIWantToBe = false;
        }
        else if (coll.gameObject.name == "Orange_Spot2")
        {
            Debug.Log("Removing from ORANGE SPOT 2!!!!");
            QueueScript1 orangeQueueScript = coll.GetComponentInParent <QueueScript1>();
            orangeQueueScript.myItemObjects.Remove((Item_Set)this.GetComponent <Item_Set>());
            orangeQueueScript.displayNewQueueVisualFromOwnerQueueList();
            itemGoesToThisSpot     = (Vector2)startPosition;
            touchingWhereIWantToBe = false;
        }
        else if (coll.gameObject.name == "Orange_Spot3")
        {
            Debug.Log("Removing from ORANGE SPOT 3");
            QueueScript1 orangeQueueScript = coll.GetComponentInParent <QueueScript1>();
            orangeQueueScript.myItemObjects.Remove((Item_Set)this.GetComponent <Item_Set>());
            orangeQueueScript.displayNewQueueVisualFromOwnerQueueList();
            itemGoesToThisSpot     = (Vector2)startPosition;
            touchingWhereIWantToBe = false;
        }
        else if (coll.gameObject.name == "Blue_Spot1")
        {
            Debug.Log("removing from Blue SPOT 1");
            QueueScript1 blueQueueScript = coll.GetComponentInParent <QueueScript1>();
            blueQueueScript.myItemObjects.Remove((Item_Set)this.GetComponent <Item_Set>());
            blueQueueScript.displayNewQueueVisualFromOwnerQueueList();
            itemGoesToThisSpot     = (Vector2)startPosition;
            touchingWhereIWantToBe = false;
        }
        else if (coll.gameObject.name == "Blue_Spot2")
        {
            Debug.Log("Removing from Blue SPOT 2");
            QueueScript1 blueQueueScript = coll.GetComponentInParent <QueueScript1>();
            blueQueueScript.myItemObjects.Remove((Item_Set)this.GetComponent <Item_Set>());
            blueQueueScript.displayNewQueueVisualFromOwnerQueueList();
            itemGoesToThisSpot     = (Vector2)startPosition;
            touchingWhereIWantToBe = false;
        }
        else if (coll.gameObject.name == "Blue_Spot3")
        {
            Debug.Log("Removing From Blue SPOT 3");
            QueueScript1 blueQueueScript = coll.GetComponentInParent <QueueScript1>();
            blueQueueScript.myItemObjects.Remove((Item_Set)this.GetComponent <Item_Set>());
            blueQueueScript.displayNewQueueVisualFromOwnerQueueList();
            itemGoesToThisSpot     = (Vector2)startPosition;
            touchingWhereIWantToBe = false;
        }
        else if (coll.gameObject.name == "Green_Spot1")
        {
            Debug.Log("Removing from green SPOT 1");
            QueueScript1 greenQueueScript = coll.GetComponentInParent <QueueScript1>();
            greenQueueScript.myItemObjects.Remove((Item_Set)this.GetComponent <Item_Set>());
            greenQueueScript.displayNewQueueVisualFromOwnerQueueList();
            itemGoesToThisSpot     = (Vector2)startPosition;
            touchingWhereIWantToBe = false;
        }
        else if (coll.gameObject.name == "Green_Spot2")
        {
            Debug.Log("Removing from green SPOT 2");
            QueueScript1 greenQueueScript = coll.GetComponentInParent <QueueScript1>();
            greenQueueScript.myItemObjects.Remove((Item_Set)this.GetComponent <Item_Set>());
            greenQueueScript.displayNewQueueVisualFromOwnerQueueList();
            itemGoesToThisSpot     = (Vector2)startPosition;
            touchingWhereIWantToBe = false;
        }
        else if (coll.gameObject.name == "Green_Spot3")
        {
            Debug.Log("Removing from green SPOT 3");
            QueueScript1 greenQueueScript = coll.GetComponentInParent <QueueScript1>();
            greenQueueScript.myItemObjects.Remove((Item_Set)this.GetComponent <Item_Set>());
            greenQueueScript.displayNewQueueVisualFromOwnerQueueList();
            itemGoesToThisSpot     = (Vector2)startPosition;
            touchingWhereIWantToBe = false;
        }
    }