Esempio n. 1
0
    public void CallEvent(typeOfObject objectType)
    {
        typeOfObject[] currentRoomSequence = GetCurrentRoomSequence();
        _lastClickedObject = objectType;


        // Debug.Log("Object : " + _lastClickedObject + " Room : " + currentRoom + " Sequence Index :" + _currentSequenceIndex);

        if (_lastClickedObject == currentRoomSequence[_currentSequenceIndex])
        {
            //We made it to the end of the sequence, so move to the next room
            if (_currentSequenceIndex + 1 >= currentRoomSequence.Length)
            {
                //We are moving the player toward room 1 A.K.A. freedom
                FreezePlayerActions();
                NewTextManager.Instance.CallTextBox(typeOfDialog.Room, _currentSequenceIndex, true, Color.white);
                RoomChange(true);
            }
            else
            {
                //Debug.Log("Success" + " " + currentSequenceIndex);
                FreezePlayerActions();
                NewTextManager.Instance.CallTextBox(typeOfDialog.Room, _currentSequenceIndex);
                _currentSequenceIndex++;
            }
        }
        else
        {
            _numberOfPlayerFailures++;

            if (_lastClickedObject == typeOfObject.Pills)
            {
                _numberOfPills++;
            }

            if (_numberOfPills > 3)
            {
                GameOver();
            }

            //Fail the player
            //Screen shake
            mainCamera.GetComponent <NewScreenShake>().SetShake();
            FreezePlayerActions();
            NewTextManager.Instance.CallTextBox(typeOfDialog.Failure, _currentSequenceIndex);

            if (_numberOfPlayerFailures > maxPNumberOfPlayerFailures)
            {
                //TODO: Add the screen transitions
                FreezePlayerActions();
                NewTextManager.Instance.CallTextBox(typeOfDialog.GoBack, _currentSequenceIndex, true, Color.black);
                RoomChange(false);
            }
        }
    }
Esempio n. 2
0
 public PrintJobNavigationNodeTag(typeOfObject objectType, int modelIndex, long objectIndex)
 {
     this.ObjectType  = objectType;
     this.ModelIndex  = modelIndex;
     this.ObjectIndex = objectIndex;
 }
Esempio n. 3
0
 //Returns the right Sprite to render by the clickable object by typeOfObject
 public Sprite GetObjectSprite(typeOfObject objectType)
 {
     return(_objectSprite[objectType]);
 }
 void Start()
 {
     _obj = new typeOfObject();
 }