Beispiel #1
0
 public void Interact(C_DisplayImage currentDisplay)
 {
     if (displayimage.CurrentWall < 10)
     {
         Debug.Log("turn off");
         displayimage.CurrentWall += 10;
         if (door.cat.activeSelf == true)
         {
             Invoke("Catlight", 3);
         }
         lightproperty = LightProperty.off;
         if (puzzlecontrol.puzzle > 10 && door.DoorProperty == C_DoorInteraction.DoorState.close)
         {
             last.gameObject.SetActive(true);
             first.gameObject.SetActive(false);
             canvas.gameObject.SetActive(false);
             Debug.Log("clear!");
         }
     }
     else if (displayimage.CurrentWall > 10)
     {
         Debug.Log("turn on");
         displayimage.CurrentWall -= 10;
         lightproperty             = LightProperty.on;
     }
 }
Beispiel #2
0
 public void Interact(C_DisplayImage currentDisplay)
 {
     pot.SetActive(false);
     movedpot.SetActive(true);
     this.gameObject.layer = 2;
     puzzlecontrol.puzzle++;
     Debug.Log("Puzzle=" + puzzlecontrol.puzzle);
 }
Beispiel #3
0
    public void Interact(C_DisplayImage currentDisplay)
    {
        currentDisplay.GetComponent <SpriteRenderer>().sprite =
            Resources.Load <Sprite>("Sprites/" + SpriteName);
        currentDisplay.CurrentState = C_DisplayImage.State.ChangedView;

        Camera.main.orthographicSize   = initialCameraSize;
        Camera.main.transform.position = initialCameraPosition;
    }
Beispiel #4
0
    public void Interact(C_DisplayImage currentDisplay)
    {
        Camera.main.orthographicSize  *= ZoomRatio;
        Camera.main.transform.position = new Vector3(this.transform.position.x, this.transform.position.y,
                                                     Camera.main.transform.position.z);
        gameObject.layer            = 2;
        currentDisplay.CurrentState = C_DisplayImage.State.zoom;

        ConstrainCamera();
    }
Beispiel #5
0
 public void Interact(C_DisplayImage currentDisplay)
 {
     if (inventory.GetComponent <C_Inventory>().currentSelectedSlot.gameObject.transform.GetChild(0).GetComponent <Image>().sprite.name == "c_trash")
     {
         Debug.Log("trash destroy");
         inventory.GetComponent <C_Inventory>().currentSelectedSlot.GetComponent <C_Slot>().ClearSlot();
         puzzlecontrol.puzzle++;
         Debug.Log("Puzzle=" + puzzlecontrol.puzzle);
     }
 }
Beispiel #6
0
    public void Interact(C_DisplayImage currentDisplay)
    {
        transform.parent.GetComponent <C_NumberLock>().currentIndividualIndex[transform.GetSiblingIndex()]++;

        if (transform.parent.GetComponent <C_NumberLock>().currentIndividualIndex[transform.GetSiblingIndex()] > 9)
        {
            transform.parent.GetComponent <C_NumberLock>().currentIndividualIndex[transform.GetSiblingIndex()] = 0;
        }

        this.gameObject.GetComponent <SpriteRenderer>().sprite =
            transform.parent.GetComponent <C_NumberLock>().numberSprites[transform.parent.GetComponent <C_NumberLock>().currentIndividualIndex[transform.GetSiblingIndex()]];
    }
Beispiel #7
0
 void Start()
 {
     currentdisply = GameObject.Find("displayImage").GetComponent <C_DisplayImage>();
     if (currentdisply.CurrentWall < 10 && Property == property.type2)
     {
         Offobject.SetActive(false);
     }
     else
     {
         Offobject.SetActive(true);
     }
 }
Beispiel #8
0
 public void Interact(C_DisplayImage currentDisplay)
 {
     if (inventory.GetComponent <C_Inventory>().currentSelectedSlot.gameObject.transform.GetChild(0).GetComponent <Image>().sprite.name == "c_cat_food")
     {
         inventory.GetComponent <C_Inventory>().currentSelectedSlot.GetComponent <C_Slot>().ClearSlot();
         Audio.SetActive(false);
         StartCoroutine(Coroutine());
         this.gameObject.SetActive(false);
         puzzlecontrol.puzzle++;
         Debug.Log("Puzzle=" + puzzlecontrol.puzzle);
     }
 }
Beispiel #9
0
 public void Interact(C_DisplayImage currentDisplay)
 {
     if (Property == InteractionProperty.close)
     {
         openbed.SetActive(true);
         Property = InteractionProperty.open;
     }
     else if (Property == InteractionProperty.open)
     {
         openbed.SetActive(false);
         Property = InteractionProperty.close;
     }
 }
Beispiel #10
0
 public void Interact(C_DisplayImage currentDisplay)
 {
     if (inventory.GetComponent <C_Inventory>().currentSelectedSlot.gameObject.transform.GetChild(0).GetComponent <Image>().sprite.name == UnlockItem || UnlockItem == "")
     {
         ChangedStateSprite.SetActive(true);
         this.gameObject.layer = 2;
         puzzlecontrol.puzzle++;
         Debug.Log("Puzzle=" + puzzlecontrol.puzzle);
         if (UnlockItem == "")
         {
             return;
         }
         inventory.GetComponent <C_Inventory>().currentSelectedSlot.GetComponent <C_Slot>().ClearSlot();
     }
 }
Beispiel #11
0
    public void Interact(C_DisplayImage currentDisplay)
    {
        if (Property == InteractionProperty.locked)
        {
            if (inventory.GetComponent <C_Inventory>().currentSelectedSlot.gameObject.transform.GetChild(0).GetComponent <Image>().sprite.name == UnlockItem && Property == InteractionProperty.locked)
            {
                Debug.Log("Unlock!");
                Audio.SetActive(false);
                ChangedStateSprite.SetActive(true);
                inventory.GetComponent <C_Inventory>().currentSelectedSlot.GetComponent <C_Slot>().ClearSlot();
                Property     = InteractionProperty.unlocked;
                DoorProperty = DoorState.open;

                if (numberlock.isOpen == true)
                {
                    numberlock.MovedCat.SetActive(true);
                    puzzlecontrol.puzzle++;
                    Debug.Log("Puzzle=" + puzzlecontrol.puzzle);
                }
                else
                {
                    cat.SetActive(true);
                    iscat = true;
                }
            }
        }

        else if (Property == InteractionProperty.unlocked)
        {
            if (DoorProperty == DoorState.open)
            {
                Debug.Log("close!");
                ChangedStateSprite.SetActive(false);
                DoorProperty = DoorState.close;
            }

            else if (Property == InteractionProperty.unlocked && DoorProperty == DoorState.close)
            {
                Debug.Log("open!");
                ChangedStateSprite.SetActive(true);
                // this.gameObject.layer = 2;
                DoorProperty = DoorState.open;
            }
        }
    }
Beispiel #12
0
 public void Interact(C_DisplayImage currentDisplay)
 {
     ItemPickUp();
 }
Beispiel #13
0
 void Start()
 {
     currentDisplay = GameObject.Find("displayImage").GetComponent <C_DisplayImage>();
 }
Beispiel #14
0
 void Start()
 {
     currentDisplay        = GameObject.Find("displayImage").GetComponent <C_DisplayImage>();
     initialCameraSize     = Camera.main.orthographicSize;
     initialCameraPosition = Camera.main.transform.position;
 }
Beispiel #15
0
 void Start()
 {
     displayimage  = GameObject.Find("displayImage").GetComponent <C_DisplayImage>();
     door          = GameObject.Find("door interact").GetComponent <C_DoorInteraction>();
     puzzlecontrol = GameObject.Find("puzzlecontrol").GetComponent <C_Puzzlecontrol>();
 }