Exemple #1
0
        public static void RunFunction(ConversationOutput toRun, Data parameters, BaseCharacterController speaker, BaseCharacterController listener)
        {
            switch (toRun)
            {
            case ConversationOutput.None:
                break;

            case ConversationOutput.TransferMoney:
                TransferMoney(speaker, listener, parameters.iVal);
                break;

            case ConversationOutput.Heal:
                HealListener(listener, parameters.iVal);
                break;

            case ConversationOutput.GiveAbility:
                GiveAbility(listener, parameters.sVal);
                break;

            case ConversationOutput.BuyAbility:
                GiveAbility(listener, parameters.sVal);
                TransferMoney(speaker, listener, parameters.iVal);
                break;
            }
        }
Exemple #2
0
        private void OptionFieldData(ref Rect currentContentRect, int dataIndex, Data data, ref string intTemp, ref string floatTemp)
        {
            GUI.Label(currentContentRect, new GUIContent("ConversationOutput " + dataIndex + " values"));
            currentContentRect.y += currentContentRect.height + 10;

            GUI.Label(currentContentRect, new GUIContent("ConversationOutput " + dataIndex + " string value"));
            currentContentRect.y += currentContentRect.height + 5;
            data.sVal             = GUI.TextField(currentContentRect, data.sVal);
            currentContentRect.y += currentContentRect.height + 5;

            GUI.Label(currentContentRect, new GUIContent("ConversationOutput " + dataIndex + "  int value"));
            currentContentRect.y += currentContentRect.height + 5;
            intTemp = GUI.TextField(currentContentRect, intTemp);
            if (int.TryParse(intTemp, out int ival))
            {
                data.iVal = ival;
            }
            currentContentRect.y += currentContentRect.height + 5;

            data.bVal             = GUI.Toggle(currentContentRect, data.bVal, new GUIContent("ConversationOutput " + dataIndex + " bool value"));
            currentContentRect.y += currentContentRect.height + 5;

            GUI.Label(currentContentRect, new GUIContent("ConversationOutput  " + dataIndex + " float value"));
            currentContentRect.y += currentContentRect.height + 5;
            floatTemp             = GUI.TextField(currentContentRect, floatTemp);
            if (float.TryParse(floatTemp, out float fval))
            {
                data.fVal = fval;
            }
            currentContentRect.y += currentContentRect.height + 5;
        }