예제 #1
0
    private void Update()
    {
        if (gameObject.activeInHierarchy)
        {
            rValueText.text = RValue.ToString();
            gValueText.text = GValue.ToString();
            bValueText.text = BValue.ToString();

            newColor = new Color32(System.Convert.ToByte(RValue), System.Convert.ToByte(GValue), System.Convert.ToByte(BValue), 255);

            colorPreview.color = newColor;
        }

        if (timer > 0)
        {
            timer -= Time.deltaTime;
        }
        else
        {
            if (mouseDownIncrease)
            {
                IncreaseColorValue((int)rGB);
            }
            if (mouseDownDecrease)
            {
                DecreaseColorValue((int)rGB);
            }
        }
    }
예제 #2
0
        public override string ToString()
        {
            string op = "";

            switch (Operation)
            {
            case Opcode.EQ: op = "==";   break;

            case Opcode.LT: op = "<";    break;

            case Opcode.LE: op = "<=";   break;

            case Opcode.ADD: op = "+";   break;

            case Opcode.SUB: op = "-";   break;

            case Opcode.MUL: op = "*";   break;

            case Opcode.DIV: op = "/";   break;

            case Opcode.AND: op = "and"; break;

            case Opcode.OR: op = "or";   break;

            case Opcode.POW: op = "^";   break;
            }
            string assignVal = mAssignmentLvalue != null ? mAssignmentLvalue + " = " : "";
            string retVal    = String.Format("{0}{1} {2} {3}", assignVal, LValue.ToString().Trim(), op, RValue.ToString().Trim());

            if (mAssignmentLvalue != null)
            {
                retVal += "\n";
            }
            if (assignVal == "" && LocalName != null)
            {
                return(LocalName);
            }
            return(retVal);
        }
예제 #3
0
 public override string ToAssemblyString()
 {
     return("add " + LValue.Name + ", -" + RValue.ToString());
 }
예제 #4
0
 public override void ToString(NodeStringBuilder strBuilder)
 {
     LValue.ToString(strBuilder);
     strBuilder.Append($" {OperatorToken} ");
     RValue.ToString(strBuilder);
 }
예제 #5
0
 public override void ToString(NodeStringBuilder strBuilder)
 {
     LValue.ToString(strBuilder);
     strBuilder.Append($" {AssignmentToken} ");
     RValue.ToString(strBuilder);
 }