示例#1
0
文件: VesselSC.cs 项目: cabera2/PLS
    IEnumerator _VesselGet()
    {
        Time.timeScale = 0f;
        GameObject _FadeObj = StageManagerSC._CanvasInst.GetComponent <PauseSC>()._FadeObj;
        UIFaderSC  _UIFader = _FadeObj.GetComponent <UIFaderSC>();

        _UIFader._FadeSpeed   = 1;
        _UIFader._TargetAlpha = 0.5f;
        _FadeObj.SetActive(true);
        while (_FadeObj.GetComponent <CanvasGroup>().alpha < 0.5f)
        {
            yield return(null);
        }
        GameObject _GetVesselAniInst = Instantiate(_GetVesselAni);

        _GetVesselAniInst.transform.SetParent(_FadeObj.transform.parent);
        _GetVesselAniInst.transform.position   = _FadeObj.transform.position;
        _GetVesselAniInst.transform.localScale = new Vector3(1, 1, 1);
        Animator _GetAni = _GetVesselAniInst.GetComponent <Animator>();

        if (StageManagerSC._LSC._HaveVessel == false)
        {
            StageManagerSC._LSC._HaveVessel = true;
            _GetAni.SetTrigger("_Half");
            yield return(new WaitForSecondsRealtime(3f));
        }
        else
        {
            StageManagerSC._LSC._HaveVessel = false;
            _GetAni.SetTrigger("_Whole");
            LumiaHitboxSC _HBSC = StageManagerSC._LSC._Hitbox.GetComponent <LumiaHitboxSC>();
            _HBSC._HP_Max += 1;
            yield return(new WaitForSecondsRealtime(3f));

            StageManagerSC._CanvasInst.GetComponent <PauseSC>()._UpdateMaxHp();
            _HBSC._HP_Current = _HBSC._HP_Max;
            StageManagerSC._CanvasInst.GetComponent <PauseSC>()._UpdateCurrentHp();
        }
        if (GetComponent <MapSaverSC>() != null)
        {
            GetComponent <MapSaverSC>()._SaveStatus();
        }

        _UIFader._TargetAlpha = 1f;
        _UIFader._FadeOut();
        Transform _Child = transform.GetChild(0);

        _Child.GetComponent <SpriteRenderer>().enabled = false;
        _Child.GetComponent <ParticleSystem>().Stop();
        _Child.GetChild(0).gameObject.SetActive(false);
        Time.timeScale = 1f;
    }
示例#2
0
文件: Lumia_SC.cs 项目: cabera2/PLS
    void OnTriggerEnter2D(Collider2D col)
    {
        if (col.gameObject.tag == "RespawnArea")
        {
            _RespawnPoint = col.gameObject.GetComponent <RespawnAreaSC>()._RespawnPoint;
        }
        else if (col.gameObject.tag == "Gate" && _CanControl == true && _AutoJumping == false && _RB.constraints == RigidbodyConstraints2D.FreezeRotation)
        {
            _CanControl  = false;
            _PassingGate = true;
            GateSC     _GSC     = col.gameObject.GetComponent <GateSC>();
            GameObject _FadeObj = _Canvas.GetComponent <PauseSC>()._FadeObj;
            UIFaderSC  _UIFSC   = _FadeObj.GetComponent <UIFaderSC>();
            StartCoroutine(_LoadScene(_GSC._TargetScene, true));
            _GateNumber = _GSC._TargetGateNumber;
            if (_Canvas.GetComponent <PauseSC>()._FadeObj.activeSelf == false)
            {
                _Canvas.GetComponent <PauseSC>()._FadeObj.SetActive(true);
            }
            else
            {
                _UIFSC.StopAllCoroutines();
                _UIFSC._Working     = false;
                _UIFSC._TargetAlpha = 1;
                _UIFSC._FadeSpeed   = 1;
                _UIFSC.OnEnable();
            }

            if (_GSC._WallGate == true)
            {
                _AutoWalk = _SR.flipX == false ? 1 : _SR.flipX == true ? -1 : 0;
            }
            else if (_GSC._WallGate == false)
            {
                if (_RB.velocity.y > 0)
                {
                    _AutoJumping = true;
                    _JumpGate    = true;
                    _JumpGateDir = _GSC._ForceDir;
                }
            }
        }
    }