Esempio n. 1
0
    private void SetTo(int index)
    {
        foreach (DUITrans DUITrans in transitions[index].duiTransitions)
        {
            DUITrans.Update(1);
        }
        foreach (PanelTrans UITrans in transitions[index].panelTransitions)
        {
            UITrans.SetTarget();
            UITrans.Update(1);
        }

        transitions[index].atomTransition.atom.AdjustScale();
        transitions[index].atomTransition.orbitals?.AdjustScale();
        transitions[index].atomTransition.atom.Interactable = transitions[index].atomTransition.interactable;
        Transitioning = false;
    }
Esempio n. 2
0
    private IEnumerator LerpTo(int index)
    {
        currLerpTime = 0;
        foreach (PanelTrans UITrans in transitions[index].panelTransitions)
        {
            UITrans.SetTarget();
        }
        while (currLerpTime < LERP_TIME)
        {
            currLerpTime += Time.deltaTime;
            if (currLerpTime > LERP_TIME)
            {
                currLerpTime = LERP_TIME;
            }

            float p = currLerpTime / LERP_TIME;
            p = p * p * (3f - 2f * p); //smooth step
            //p = p*p*p*(p*(p*6-15)+10); //smoother step
            //p = Mathf.Pow(p, 1f / 6f);
            foreach (DUITrans DUITrans in transitions[index].duiTransitions)
            {
                DUITrans.Update(p);
            }
            foreach (PanelTrans UITrans in transitions[index].panelTransitions)
            {
                UITrans.Update(p);
            }

            transitions[index].atomTransition.atom.AdjustScale();
            transitions[index].atomTransition.orbitals?.AdjustScale();

            yield return(new WaitForEndOfFrame());
        }

        transitions[index].atomTransition.atom.Interactable = transitions[index].atomTransition.interactable;
        Transitioning = false;
    }