Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        // Get the AudioSource component
        audio      = GetComponent <AudioSource>();
        audio.clip = clockTick;

        formula = cubeContainer.GetComponentsInChildren <Cube>();
        op1     = questionContainer.GetComponentInChildren <LeftSide1>();
        op2     = questionContainer.GetComponentInChildren <RightSide1>();

        // Store original positions of answer boards
        originalPosition = new Vector3[formula.Length];
        for (int i = 0; i < formula.Length; i++)
        {
            originalPosition[i] = new Vector3(formula[i].transform.position.x, formula[i].transform.position.y,
                                              formula[i].transform.position.z);
        }
        SetQuestionLevel1();
    }
Ejemplo n.º 2
0
        private string MakeRightSideStr(EventCommandSentenceResolver resolver,
                                        EventCommandSentenceType type, EventCommandSentenceResolveDesc desc)
        {
            string rightSideStr1;

            if (IsNotReferRight1)
            {
                rightSideStr1 = RightSide1.ToString();
            }
            else
            {
                rightSideStr1 = resolver.GetVariableAddressStringIfVariableAddress(RightSide1, type, desc);
                if (IsUseVariableXRight1)
                {
                    rightSideStr1 = $"V[{rightSideStr1}]";
                }
            }

            string rightSideStr2;

            if (IsNotReferRight2)
            {
                rightSideStr2 = RightSide2.ToString();
            }
            else
            {
                rightSideStr2 = resolver.GetVariableAddressStringIfVariableAddress(RightSide2, type, desc);
                if (IsUseVariableXRight2)
                {
                    rightSideStr2 = $"V[{rightSideStr2}]";
                }
            }

            if (AssignmentOperator == NumberAssignmentOperator.Angle)
            {
                return(string.Format(EventCommandSentenceRightSideAngle,
                                     rightSideStr1, rightSideStr2));
            }

            return(string.Format(EventCommandSentenceRightSideEtc,
                                 rightSideStr1, CalculateOperator.EventCommandSentence, rightSideStr2));
        }