コード例 #1
0
        }//function : animateBaselineHeading(float valueInc)

        public IEnumerator animateBaseline()
        {
            float b1z = baselineHeading1.transform.localScale.z;
            float b2z = baselineHeading2.transform.localScale.z;
            yield return GraphController.animate(new processAnimate(animateBaselineHeading), 0.5f, 0.0f, baselineHeading1.transform.localScale.z);
            baselineHeading1.transform.localScale = new Vector3(baselineHeading1.transform.localScale.x, baselineHeading1.transform.localScale.y, b1z);
            baselineHeading2.transform.localScale = new Vector3(baselineHeading1.transform.localScale.x, baselineHeading1.transform.localScale.y, b2z);
        }//function : animateBaseline()
コード例 #2
0
        }//function : animatePopUpScale(float valueInc)

        public IEnumerator initAnimatePopUp()
        {
            yield return(GraphController.animate(new processAnimate(animatePopUp), 0.3f, 0.0f, infoPopUpMarginFromBar));

            BarPopUpStick.transform.localScale    = new Vector3(BarPopUpStick.transform.localScale.x, infoPopUpMarginFromBar, BarPopUpStick.transform.localScale.z);
            BarPopUpBoard.transform.localPosition = new Vector3(BarPopUpBoard.transform.localPosition.x, valueAfterScale + infoPopUpMarginFromBar - 0.01f, BarPopUpBoard.transform.localPosition.z);

            yield return(GraphController.animate(new processAnimate(animatePopUpScale), 0.08f, 1.0f, 1.2f));

            yield return(GraphController.animate(new processAnimate(animatePopUpScale), 0.08f, 1.2f, 1.0f));

            BarPopUpBoardInfo.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f);
        }//function : initAnimatePopUp()
コード例 #3
0
        }//funciton : animateBarValuePos(float valueInc)

        public IEnumerator initAnimateBarValue()
        {
            StartCoroutine(GraphController.animate(new processAnimate(animateBarValuePos), 0.08f, valueAfterScale, valueAfterScale + heigthOnFocus));
            yield return(GraphController.animate(new processAnimate(animateBarValue), 0.16f, smallFont, bigFont));

            //yield return GraphController.animate(new processAnimate(animateBarValue), 0.16f, smallFont, bigFont + 0.2f);
            //yield return GraphController.animate(new processAnimate(animateBarValue), 0.08f, bigFont + 0.2f, bigFont);

            BarValue.GetComponent <RectTransform>().localPosition = new Vector3(0.0f, valueAfterScale + heigthOnFocus, 0.0f);
            BarValue.GetComponent <TextMeshPro>().fontSize        = bigFont;
            BarUnit.GetComponent <TextMeshPro>().fontSize         = bigFont / 1.5f;
            BarValue.GetComponent <RectTransform>().sizeDelta     = new Vector2((bigFont / 17.0f) * totalLetter, BarValue.GetComponent <RectTransform>().sizeDelta.y);

            if (!focused)
            {
                focused = true;
                onUnFocus();
            }
        }//function : initAnimateBarValue()
コード例 #4
0
        }//function : animatePopUpScale(float valueInc)

        public IEnumerator initAnimatePopUp(bool isbaselineHeading1)
        {
            if(isbaselineHeading1)
            {
                baseLinePopUp1Board.transform.localPosition = new Vector3(- dashLineLength, baseLinePopUp1Board.transform.localPosition.y, baseLinePopUp1Board.transform.localPosition.z);
                baseLineDashLine1.transform.localPosition = new Vector3(-dashLineLength, baseLineDashLine1.transform.localPosition.y, baseLineDashLine1.transform.localPosition.z);

                StartCoroutine(GraphController.animate(new processAnimate(animateDashline1Scale), 0.3f, 0.0f, 1.0f));
                yield return GraphController.animate(new processAnimate(animatePopUp1), 0.3f, 0.0f, infoPopUpMarginFromBaseLine);

                baseLineDashLine1.transform.localScale = new Vector3(1.0f, baseLineDashLine1.transform.localScale.y, baseLineDashLine1.transform.localScale.z);
                baseLineDashLine1.transform.localPosition = new Vector3(0.0f, baseLineDashLine1.transform.localPosition.y, baseLineDashLine1.transform.localPosition.z);
                baseLinePopUp1Board.transform.localPosition = new Vector3(0.0f, baseLinePopUp1Board.transform.localPosition.y, baseLinePopUp1Board.transform.localPosition.z);

                baseLinePopUp1Stick.transform.localScale = new Vector3(baseLinePopUp1Stick.transform.localScale.x, infoPopUpMarginFromBaseLine, baseLinePopUp1Stick.transform.localScale.z);
                baseLinePopUp1Board.transform.localPosition = new Vector3(baseLinePopUp1Board.transform.localPosition.x, infoPopUpMarginFromBaseLine - 0.01f, baseLinePopUp1Board.transform.localPosition.z);

                yield return GraphController.animate(new processAnimate(animatePopUpScale1), 0.08f, 1.0f, 1.2f);
                yield return GraphController.animate(new processAnimate(animatePopUpScale1), 0.08f, 1.2f, 1.0f);
                baseLinePopUp1BoardInfo.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f);
            }
            else
            {
                baseLinePopUp2Board.transform.localPosition = new Vector3(-dashLineLength, baseLinePopUp2Board.transform.localPosition.y, baseLinePopUp2Board.transform.localPosition.z);
                baseLineDashLine2.transform.localPosition = new Vector3(-dashLineLength, baseLineDashLine2.transform.localPosition.y, baseLineDashLine2.transform.localPosition.z);

                StartCoroutine(GraphController.animate(new processAnimate(animateDashline2Scale), 0.3f, 0.0f, 1.0f));
                yield return GraphController.animate(new processAnimate(animatePopUp2), 0.3f, 0.0f, infoPopUpMarginFromBaseLine);

                baseLineDashLine2.transform.localScale = new Vector3(1.0f, baseLineDashLine2.transform.localScale.y, baseLineDashLine2.transform.localScale.z);
                baseLineDashLine2.transform.localPosition = new Vector3(0.0f, baseLineDashLine1.transform.localPosition.y, baseLineDashLine1.transform.localPosition.z);
                baseLinePopUp2Board.transform.localPosition = new Vector3(0.0f, baseLinePopUp2Board.transform.localPosition.y, baseLinePopUp2Board.transform.localPosition.z);

                baseLinePopUp2Stick.transform.localScale = new Vector3(baseLinePopUp2Stick.transform.localScale.x, infoPopUpMarginFromBaseLine, baseLinePopUp2Stick.transform.localScale.z);
                baseLinePopUp2Board.transform.localPosition = new Vector3(baseLinePopUp2Board.transform.localPosition.x, infoPopUpMarginFromBaseLine - 0.01f, baseLinePopUp2Board.transform.localPosition.z);

                yield return GraphController.animate(new processAnimate(animatePopUpScale2), 0.08f, 1.0f, 1.2f);
                yield return GraphController.animate(new processAnimate(animatePopUpScale2), 0.08f, 1.2f, 1.0f);
                baseLinePopUp1BoardInfo.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f);
            }
        }//function : initAnimatePopUp(bool isbaselineHeading1)
コード例 #5
0
        }//function : setMat(Material nor, Material focus, Material sel)

        public IEnumerator Initialize()
        {
            if (!isGrowthValue)
            {
                valueAfterScale = shortValue / graph.barHeightScale[graph.curBid];
                if (valueAfterScale == 0.0f)
                {
                    valueAfterScale = 0.00001f;
                }
                BarMain.SetActive(true);

                yield return(StartCoroutine(GraphController.animate(new processAnimate(animateBarScale), 0.6f, 0.0f, valueAfterScale + 0.1f)));

                yield return(StartCoroutine(GraphController.animate(new processAnimate(animateBarScale), 0.6f, valueAfterScale + 0.1f, valueAfterScale - 0.06f)));

                yield return(StartCoroutine(GraphController.animate(new processAnimate(animateBarScale), 0.6f, valueAfterScale - 0.06f, valueAfterScale)));

                BarMain.transform.localScale = new Vector3(BarMain.transform.localScale.x, valueAfterScale, BarMain.transform.localScale.z);
            }
            else
            {
                if (shortValue < 0)
                {
                    shortValue = -shortValue;
                    BarMain.transform.localRotation = Quaternion.Euler(180.0f, 0.0f, 0.0f);

                    if (graph.graphName == "E Commerce")
                    {
                        isPopUpInfoAvailable = true;
                        BarPopUpBoardInfo.GetComponentInChildren <TextMeshPro>().text = "E-Commerce Decreased due to negative Twitter sentiment";
                    }
                    else if (graph.graphName == "Net Sales")
                    {
                        isPopUpInfoAvailable = true;
                        BarPopUpBoardInfo.GetComponentInChildren <TextMeshPro>().text = "Net Sales Decreased due to devaluation of Yuan";
                    }
                }
                else
                {
                    if (graph.graphName == "E Commerce")
                    {
                        isPopUpInfoAvailable = true;
                        BarPopUpBoardInfo.GetComponentInChildren <TextMeshPro>().text = "E-Commerce Increased due to positive Twitter sentiment";
                    }
                }
                assignMaterialToGrowthBar();

                //Growth Bar Scale only depends on Z axis Width10
                float scaleX = BarMain.transform.localScale.x;
                BarMain.transform.localScale = new Vector3(scaleX, scaleX, scaleX);
                BarMain.SetActive(true);

                valueAfterScale /= graph.barHeightScale[graph.curBid];
                //valueAfterScale += scaleX;
                valueAfterScale /= 2;

                yield return(StartCoroutine(GraphController.animate(new processAnimate(animateGrwothPosition), 1.8f, scaleX / 2.0f, valueAfterScale - (scaleX / 2.0f))));

                BarMain.transform.localPosition = new Vector3(0.0f, valueAfterScale - (scaleX / 2.0f), 0.0f);
            }


            totalLetter = ((int)shortValue).ToString().Length;
            BarValue.GetComponent <RectTransform>().sizeDelta     = new Vector2((smallFont / 17.0f) * totalLetter, BarValue.GetComponent <RectTransform>().sizeDelta.y);
            BarValue.GetComponent <RectTransform>().localPosition = new Vector3(0.0f, valueAfterScale, 0.0f);
            BarValue.GetComponent <TextMeshPro>().text            = "" + (int)shortValue;
            BarUnit.GetComponent <TextMeshPro>().text             = unit;
            BarValue.SetActive(true);

            //setting for PopUp
            BarPopUpBoard.transform.localPosition = defaultPosPopUp + new Vector3(0.0f, valueAfterScale, 0.0f);

            onUnFocus();
            yield return(null);
        }//function : Initialize()