public static SkillVector2 FsmVector2Popup(GUIContent label, Skill fsm, SkillVector2 fsmVector2) { EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); fsmVector2 = VariableEditor.DoFsmVector2Popup(label, fsm, fsmVector2); VariableEditor.EndVariableEditor(fsmVector2); return(fsmVector2); }
public static SkillVector2 FsmVector2Field(GUIContent label, Skill fsm, SkillVector2 fsmVector2) { EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); if (fsmVector2.get_UseVariable()) { fsmVector2 = VariableEditor.DoFsmVector2Popup(label, fsm, fsmVector2); } else { fsmVector2.set_Value(EditorGUILayout.Vector2Field(label.get_text(), fsmVector2.get_Value(), new GUILayoutOption[0])); } fsmVector2 = (SkillVector2)VariableEditor.VariableToggle(fsmVector2, label.get_text()); VariableEditor.EndVariableEditor(fsmVector2); return(fsmVector2); }
private static SkillVector2 DoFsmVector2Popup(GUIContent label, Skill fsm, SkillVector2 fsmVector2) { ActionEditor.DoVariableSelector(label, fsm, 5, fsmVector2, -1, null); fsmVector2.set_UseVariable(true); return(fsmVector2); }
private static void NetworkSyncVariables(BitStream stream, SkillVariables variables) { SkillInt[] intVariables; SkillQuaternion[] quaternionVariables; SkillVector3[] vector3Variables; SkillColor[] colorVariables; SkillVector2[] vector2Variables; if (stream.get_isWriting()) { SkillString[] stringVariables = variables.StringVariables; for (int i = 0; i < stringVariables.Length; i++) { SkillString fsmString = stringVariables[i]; if (fsmString.NetworkSync) { char[] array = fsmString.Value.ToCharArray(); int num = array.Length; stream.Serialize(ref num); for (int j = 0; j < num; j++) { stream.Serialize(ref array[j]); } } } SkillBool[] boolVariables = variables.BoolVariables; for (int k = 0; k < boolVariables.Length; k++) { SkillBool fsmBool = boolVariables[k]; if (fsmBool.NetworkSync) { bool value = fsmBool.Value; stream.Serialize(ref value); } } SkillFloat[] floatVariables = variables.FloatVariables; for (int l = 0; l < floatVariables.Length; l++) { SkillFloat fsmFloat = floatVariables[l]; if (fsmFloat.NetworkSync) { float value2 = fsmFloat.Value; stream.Serialize(ref value2); } } intVariables = variables.IntVariables; for (int m = 0; m < intVariables.Length; m++) { SkillInt fsmInt = intVariables[m]; if (fsmInt.NetworkSync) { int value3 = fsmInt.Value; stream.Serialize(ref value3); } } quaternionVariables = variables.QuaternionVariables; for (int n = 0; n < quaternionVariables.Length; n++) { SkillQuaternion fsmQuaternion = quaternionVariables[n]; if (fsmQuaternion.NetworkSync) { Quaternion value4 = fsmQuaternion.Value; stream.Serialize(ref value4); } } vector3Variables = variables.Vector3Variables; for (int num2 = 0; num2 < vector3Variables.Length; num2++) { SkillVector3 fsmVector = vector3Variables[num2]; if (fsmVector.NetworkSync) { Vector3 value5 = fsmVector.Value; stream.Serialize(ref value5); } } colorVariables = variables.ColorVariables; for (int num3 = 0; num3 < colorVariables.Length; num3++) { SkillColor fsmColor = colorVariables[num3]; if (fsmColor.NetworkSync) { Color value6 = fsmColor.Value; stream.Serialize(ref value6.r); stream.Serialize(ref value6.g); stream.Serialize(ref value6.b); stream.Serialize(ref value6.a); } } vector2Variables = variables.Vector2Variables; for (int num4 = 0; num4 < vector2Variables.Length; num4++) { SkillVector2 fsmVector2 = vector2Variables[num4]; if (fsmVector2.NetworkSync) { Vector2 value7 = fsmVector2.Value; stream.Serialize(ref value7.x); stream.Serialize(ref value7.y); } } return; } SkillString[] stringVariables2 = variables.StringVariables; for (int num5 = 0; num5 < stringVariables2.Length; num5++) { SkillString fsmString2 = stringVariables2[num5]; if (fsmString2.NetworkSync) { int num6 = 0; stream.Serialize(ref num6); char[] array2 = new char[num6]; for (int num7 = 0; num7 < num6; num7++) { stream.Serialize(ref array2[num7]); } fsmString2.Value = new string(array2); } } SkillBool[] boolVariables2 = variables.BoolVariables; for (int num8 = 0; num8 < boolVariables2.Length; num8++) { SkillBool fsmBool2 = boolVariables2[num8]; if (fsmBool2.NetworkSync) { bool value8 = false; stream.Serialize(ref value8); fsmBool2.Value = value8; } } SkillFloat[] floatVariables2 = variables.FloatVariables; for (int i = 0; i < floatVariables2.Length; i++) { SkillFloat fsmFloat2 = floatVariables2[i]; if (fsmFloat2.NetworkSync) { float value9 = 0f; stream.Serialize(ref value9); fsmFloat2.Value = value9; } } intVariables = variables.IntVariables; for (int i = 0; i < intVariables.Length; i++) { SkillInt fsmInt2 = intVariables[i]; if (fsmInt2.NetworkSync) { int value10 = 0; stream.Serialize(ref value10); fsmInt2.Value = value10; } } quaternionVariables = variables.QuaternionVariables; for (int i = 0; i < quaternionVariables.Length; i++) { SkillQuaternion fsmQuaternion2 = quaternionVariables[i]; if (fsmQuaternion2.NetworkSync) { Quaternion identity = Quaternion.get_identity(); stream.Serialize(ref identity); fsmQuaternion2.Value = identity; } } vector3Variables = variables.Vector3Variables; for (int i = 0; i < vector3Variables.Length; i++) { SkillVector3 fsmVector3 = vector3Variables[i]; if (fsmVector3.NetworkSync) { Vector3 zero = Vector3.get_zero(); stream.Serialize(ref zero); fsmVector3.Value = zero; } } colorVariables = variables.ColorVariables; for (int i = 0; i < colorVariables.Length; i++) { SkillColor fsmColor2 = colorVariables[i]; if (fsmColor2.NetworkSync) { float num9 = 0f; stream.Serialize(ref num9); float num10 = 0f; stream.Serialize(ref num10); float num11 = 0f; stream.Serialize(ref num11); float num12 = 0f; stream.Serialize(ref num12); fsmColor2.Value = new Color(num9, num10, num11, num12); } } vector2Variables = variables.Vector2Variables; for (int i = 0; i < vector2Variables.Length; i++) { SkillVector2 fsmVector4 = vector2Variables[i]; if (fsmVector4.NetworkSync) { float num13 = 0f; stream.Serialize(ref num13); float num14 = 0f; stream.Serialize(ref num14); fsmVector4.Value = new Vector2(num13, num14); } } }