Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (PlayerInside && Input.GetButtonDown("Interact") && AVG.state == AVGManager.STATE.OFF && FinishTalking)
        {
            AVG.StartAVG(data[TalkTimes], gameObject);
            FinishTalking = false;
            if (TalkTimes < data.Count - 1)
            {
                TalkTimes++;
            }
        }

        AVGManager.STATE NewState = AVG.state;
        if (NewState != LastState && NewState != AVGManager.STATE.OFF)
        {
            MC.UnLock(false);
        }
        else if (NewState != LastState && NewState == AVGManager.STATE.OFF)
        {
            MC.UnLock(true);
        }
        LastState = NewState;

        if (PlayerInside && AVG.state == AVGManager.STATE.OFF)
        {
            Tips.SetActive(true);
        }
        else
        {
            Tips.SetActive(false);
        }
    }
Exemplo n.º 2
0
    private void Update()
    {
        if (PlayerInside && Input.GetButtonDown("Interact") && FinishTalking)
        {
            FinishTalking = false;
            MainController MC   = FindObjectOfType <MainController>();
            Save           save = new Save
            {
                HasSword     = MC.hasSword,
                CanWallJump  = MC.CanWallJump,
                SavePointNum = SavePointNumber,
                AreaNum      = Cam.AreaNum
            };
            MC.currentHP         = MC.MaxHP;
            MC.currentDashEnergy = MC.MaxDashEnergy;
            bool SaveGamesuccess = FindObjectOfType <SaveLoad>().SaveGame(save);
            if (SaveGamesuccess)
            {
                AVG.StartAVG(SuccessData, gameObject);
            }
            else
            {
                AVG.StartAVG(FailData, gameObject);
            }
        }

        AVGManager.STATE NewState = AVG.state;
        if (NewState != LastState && NewState != AVGManager.STATE.OFF)
        {
            MC.UnLock(false);
        }
        else if (NewState != LastState && NewState == AVGManager.STATE.OFF)
        {
            MC.UnLock(true);
        }
        LastState = NewState;

        if (PlayerInside && AVG.state == AVGManager.STATE.OFF)
        {
            Tips.SetActive(true);
        }
        else
        {
            Tips.SetActive(false);
        }
    }