Exemple #1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("LockBoxPuzzleKnobSprite"))
     {
         SarcophagusJarV2 knob = other.transform.parent.GetComponent <SarcophagusJarV2> ();
         knob.currentNode = this;
         SetKnobAtThis(knob);
     }
 }
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Jar"))
        {
            SarcophagusJarV2 knob = other.transform.GetComponent <SarcophagusJarV2> ();
            Debug.Log("Touching other jar -> " + knob);

            knob.ForceMoveBack();
        }
    }
Exemple #3
0
    void SetKnobAtThis(SarcophagusJarV2 knob)
    {
        Vector3 pieceNewTransform = this.transform.position;

        pieceNewTransform       = new Vector3(pieceNewTransform.x, pieceNewTransform.y, pieceNewTransform.z - 1);
        knob.transform.position = pieceNewTransform;
        if (LockBoxNodeOccupiedAction != null)
        {
            LockBoxNodeOccupiedAction(this);
        }
    }