示例#1
0
    public IEnumerator goalExplode(float fadeTime, Fermion fermion)
    {
        Vector3 scale = transform.localScale;

        for (float t = 0; t < fadeTime; t += Time.deltaTime)
        {
            float s = (m_lastSize - 1f) * t / fadeTime + 1f;
            scale.x = scale.y = s;
            transform.localScale = scale;

            yield return(null);
        }
    }
示例#2
0
    private void Start()
    {
        m_countToggle = 0.0f;
        m_countGoal   = 0f;

        m_fermion = transform.GetComponentInChildren <Fermion>();
        m_boson   = transform.GetComponentInChildren <Boson>();

        m_isToggling = false;
        m_isGoaling  = false;
        m_canToggle  = true;

        //最初はフェルミオンで始まる
        m_boson.trulyUsedMaxSpeed = m_fermion.trulyUsedMaxSpeed = m_fermion.uniqueMaxSpeed();
        m_boson.gameObject.layer  = LayerMask.NameToLayer("NotUsedActor");
    }
示例#3
0
    private void correctFpos(ref Fermion f)
    {
        if (!f.isUtilized)
        {
            return;
        }
        Camera  c   = Camera.main;
        Vector2 min = c.ViewportToWorldPoint(new Vector2(0f, 0f));
        Vector2 max = c.ViewportToWorldPoint(new Vector2(1f, 1f));

        Vector2 pos = f.transform.position;

        pos.x = Mathf.Clamp(pos.x, min.x, max.x);
        f.transform.position = pos;
        if (pos.y < min.y - 3f)
        {
            int    stageNo = TransitionManager.Instance.stageNo;
            string s       = "scene_stage0" + stageNo;
            TransitionManager.Instance.transite(s, 0.5f, 0.2f);
        }
    }
    private void Update()
    {
        if (!m_fermion)
        {
            return;
        }
        Fermion fermion = m_fermion.GetComponent <Fermion>();

        m_fermionHPgauge.GetComponent <Image>().fillAmount = (float)fermion.HP / (float)fermion.maxHP;

        Boson boson = m_boson.GetComponent <Boson>();

        m_bosonHPgauge.GetComponent <Image>().fillAmount = (float)boson.HP / (float)boson.maxHP;

        if (fermion.childFermionNumber > 0)
        {
            m_childFermionUI.SetActive(true);
            m_textMesh.SetActive(true);

            string text = "X " + fermion.childFermionNumber;
            m_textMesh.GetComponent <TextMeshProUGUI>().text = text;
        }
    }
    private IEnumerator salvation(float fadeOutTime, float fadeInTime)
    {
        float time = 0;

        isSalvated = true;


        while (true)
        {
            Color color = m_fadePlane.GetComponent <Image>().color;
            color.a = time / fadeOutTime;
            m_fadePlane.GetComponent <Image>().color = color;
            time += Time.deltaTime;

            if (color.a > 1f)
            {
                color.a = 1f;
                break;
            }
            yield return(null);
        }



        //問答無用
        Fermion f = FindObjectOfType <Fermion>();
        Boson   b = FindObjectOfType <Boson>();

        if (f != null)
        {
            f.transform.position = StageManager.Instance.startPos[stageNo];
            //  f.enabled = true;
        }
        if (b != null)
        {
            b.transform.position = StageManager.Instance.startPos[stageNo];
            // b.enabled = true;
        }

        Color c = m_fadePlane.GetComponent <Image>().color;

        c.a = 0f;
        m_fadePlane.GetComponent <Image>().color = c;
        //だんだん明るく

        time = 0;
        while (true)
        {
            Color color = m_fadePlane.GetComponent <Image>().color;
            color.a = 1f - time / fadeInTime;
            m_fadePlane.GetComponent <Image>().color = color;
            time += Time.deltaTime;

            if (color.a < 0f)
            {
                color.a = 0f;
                break;
            }
            yield return(null);
        }


        isSalvated = false;
    }
示例#6
0
 private void Start()
 {
     m_isInterpolationg = false;
     m_fermion          = FindObjectOfType <Fermion>();
     m_countLerp        = 0f;
 }
 private void Start()
 {
     m_count   = 0.0f;
     m_fermion = transform.GetComponentInParent <Fermion>();
 }