public override void UpdateTask(MAnimalBrain brain, int index) { if (MTools.ElapsedTime(brain.TasksTime[index], Delay)) { Raise.Invoke(); brain.TaskDone(index); } }
public string deleteRepture(string idPlan, string ReptureNum) { DataTable dt = Configs._query.executeProc("RDV_deleteRepture", "idPlan@int@" + idPlan + "#ReptureNum@int@" + ReptureNum); if (MTools.verifyDataTable(dt)) { return(dt.Rows[0][0].ToString()); } return("0"); }
//Repture public string addRepture(string idPlan, string periode) { DataTable dt = Configs._query.executeProc("RDV_addRepture", "idPlan@int@" + idPlan + "#periode@string@" + periode); if (MTools.verifyDataTable(dt)) { return(dt.Rows[0][0].ToString()); } return("0"); }
public string savePackage(string id, string otid, string numero, string ddc, string weight, string volume, string status, string emp, string lstPrest, string optional, string numPalette, string RecepID = "0") { string res = "-1"; //if (id == "0") //{ // DataTable dtVerify = Configs._query.executeProc("PRC_verifyPack", "numero@string@" + numero); // if (MTools.verifyDataTable(dtVerify)) // res = "-2"; // return res; //} string[] tabs = lstPrest != "" ? lstPrest.Split('|') : new string[] { }; string ReceptionID = Session["loginReceptionID"] == null ? null : Session["loginReceptionID"].ToString(); string auteurAction = Session["userID"].ToString(); string CurrentUAgenceID = Session["agenceID"].ToString(); DataTable dtVerify = Configs._query.executeProc("packGetOTDetailPackageLines", "ID@int@" + id); string param = "id@int@" + id + "#otid@int@" + otid + "#numero@string@" + numero + "#weight@float@" + weight + "#volume@float@" + volume + "#ddc@string@" + ddc + "#status@string@" + status + (string.IsNullOrEmpty(emp) ? "" : "#emp@int@" + emp) + "#optional@int@" + optional + "#numPalette@string@" + numPalette + (ReceptionID == null ? "" : "#RecepID@int@" + ReceptionID) + "#auteurAction@int@" + auteurAction + "#RecepIDMod@int@" + RecepID + "#CurrentUAgenceID@int@" + CurrentUAgenceID; DataTable dt = Configs._query.executeProc("packSavePackge", param); if (MTools.verifyDataTable(dt)) { res = dt.Rows[0][0].ToString(); lstPrest = lstPrest.Replace('|', ','); Configs._query.executeProc("packDeleteDetailPackageRelation", "PackageID@int@" + res + "#DetailIDs@string@" + lstPrest); for (int i = 0; i < tabs.Length; i++) { Configs._query.executeProc("packInsertDetailPackageRelation", "PackageID@int@" + res + "#DetailID@int@" + tabs[i]); } } if (Int64.Parse(res) > 0) { res = "0"; } return(res); }
public string SaveNPAgence(string id, string AgenceID) { string param = "ID@int@" + id + "#AgenceID@int@" + AgenceID; DataTable dt = Configs._query.executeProc("AgenceSaveNPAgence", param, true); if (MTools.verifyDataTable(dt)) { return(dt.Rows[0][0].ToString()); } return("0"); }
/// <summary>Sets the weapon equipped by an External Source</summary> public virtual void Equip_External(GameObject WeaponGo) { if (Active && UseInventory && !Paused && CheckRidingOnly) { var Next_Weapon = WeaponGo?.GetComponent <MWeapon>(); if (!MTools.CompareOR(Mathf.Abs(WeaponAction), WA.Idle, WA.None)) { return; //If is not on any of these states then Dont Equip.. } StopAllCoroutines(); if (Next_Weapon == null) //That means Store the weapon { Store_Weapon(); if (debug) { Debug.Log("Active Weapon is Empty or is not Compatible Store the Active Weapon"); } } else if (Weapon == null) //Means there's no weapon active so draw it { TryInstantiateWeapon(Next_Weapon); Holster_SetActive(Weapon.HolsterID); Draw_Weapon(); } else if (Weapon.Equals(Next_Weapon)) //You are trying to draw the same weapon { if (!CombatMode) { Draw_Weapon(); if (debug) { Debug.Log("Active weapon is the same as the NEXT Weapon and we are NOT in Combat so DRAW"); } } else { Store_Weapon(); if (debug) { Debug.Log("Active weapon is the same as the NEXT Weapon and we ARE in Combat so STORE"); } } } else //If the weapons are different Swap it { StartCoroutine(SwapWeaponsInventory(WeaponGo)); if (debug) { Debug.Log("Active weapon is DIFFERENT to the NEXT weapon so Switch" + WeaponGo); } } } }
/// <summary> /// 生成棋子游戏物体 /// </summary> /// <param name="gridItem">作为父对象的格子</param> /// <param name="name">棋子名称</param> /// <param name="chessIcon">棋子标志样式</param> /// <param name="ifRed">是否为红色棋子</param> private void CreateChess(GameObject gridItem, string name, Sprite chessIcon, bool ifRed = true) { GameObject item = Instantiate(chessGo); item.transform.SetParent(gridItem.transform); item.name = name; item.GetComponent <Image>().sprite = chessIcon; MTools.SetLocalPositionZero(item); item.transform.localScale = Vector3.one; item.GetComponent <ChessOrGrid>().isRed = ifRed; }
void AddLayerMountedCombat(UnityEditor.Animations.AnimatorController CurrentAnimator) { UnityEditor.Animations.AnimatorController MountAnimator = Resources.Load <UnityEditor.Animations.AnimatorController>(M.CombatLayerPath); MTools.AddParametersOnAnimator(CurrentAnimator, MountAnimator); foreach (var item in MountAnimator.layers) { CurrentAnimator.AddLayer(item); } }
public override void UpdateTask(MAnimalBrain brain, int index) { if (when == ExecuteTask.OnUpdate) { if (MTools.ElapsedTime(brain.TasksTime[index], interval)) { Execute_Task(brain); brain.SetElapsedTaskTime(index); } } }
public override void UpdateTask(MAnimalBrain brain, int index) { if (Play == ExecuteTask.OnUpdate) //If the animal is in range of the Target { if (MTools.ElapsedTime(brain.TasksTime[index], CoolDown)) { StateActivate(brain); brain.SetElapsedTaskTime(index); } } }
public static string getAgenceName(string id) { DataTable dt = Configs._query.executeProc("AgenceGetAgence", "id@int@" + id, true); if (MTools.verifyDataTable(dt)) { return(dt.Rows[0]["Nom"].ToString()); } return("N/A"); }
/// <summary> /// 吃子 /// </summary> /// <param name="firstChess"></param> /// <param name="secondChess"></param> /// <param name="FromX"></param> /// <param name="FromY"></param> /// <param name="ToX"></param> /// <param name="ToY"></param> public void IsEat(GameObject firstChess, GameObject secondChess, int FromX, int FromY, int ToX, int ToY) { gameManager.ShowLastPositionUI(firstChess.transform.position); GameObject secondChessGrid = secondChess.transform.parent.gameObject; firstChess.transform.SetParent(secondChessGrid.transform); MTools.SetLocalPositionZero(firstChess); gameManager.chessBoard[ToX, ToY] = gameManager.chessBoard[FromX, FromY]; gameManager.chessBoard[FromX, FromY] = 0; gameManager.BeEat(secondChess); }
private IEnumerator C_MountAnim() { var rot = Quaternion.FromToRotation(Montura.MountPoint.up, -Gravity.Value) * Montura.MountPoint.rotation; yield return(MTools.AlignTransform(transform, Montura.MountPoint.position, rot, MountTime, MountAnim)); End_Mounting(); // transform.rotation = Quaternion.identity; MainCollider.enabled = true; }
public ActionResult IndexRdv() { ViewData["plantLibre"] = ""; ViewData["linkNewPlan"] = ""; ViewData["fromPeriode"] = MTools.getSqlConfig("fromPeriode"); ViewData["toPeriode"] = MTools.getSqlConfig("toPeriode"); ViewData["TypeTournees"] = Configs._query.executeProc("PRC_getList", "name@string@tournées"); return(View()); }
private void Reset() { Director = GetComponent <PlayableDirector>(); MEvent timelineMEvent = MTools.GetInstance <MEvent>("Timeline"); if (timelineMEvent != null) { UnityEditor.Events.UnityEventTools.AddBoolPersistentListener(OnTimelinePlay, timelineMEvent.Invoke, true); UnityEditor.Events.UnityEventTools.AddBoolPersistentListener(OnTimelineStop, timelineMEvent.Invoke, false); } }
public string sendPlanGps(string id) { string res = "Erreur !"; DataTable dt = Configs._query.executeProc("PRC_GPS_CurrentJobSender_Plan", "ID|int|" + id, false, '|', '~'); if (MTools.verifyDataTable(dt)) { res = dt.Rows[0][0].ToString(); } return(res); }
public override bool Decide(MAnimalBrain brain, int Index) { var WaitTime = brain.DecisionsVars[Index].floatValue; bool timepassed = MTools.ElapsedTime(brain.StateLastTime, WaitTime); //#if UNITY_EDITOR // if (timepassed && brain.debug) // Debug.Log(brain.Animal.name + "Wait Decision waited: <b>[" + WaitTime + "]</b> seconds"); //#endif return(timepassed); }
void Reset() { MTools.SetLayer(base.transform, 20); //Set all the Childrens to Animal Layer . gameObject.tag = "Animal"; //Set the Animal to Tag Animal AnimatorSpeed = 1; Anim = GetComponentInParent <Animator>(); //Cache the Animator RB = GetComponentInParent <Rigidbody>(); //Catche the Rigid Body if (RB == null) { RB = gameObject.AddComponent <Rigidbody>(); RB.useGravity = false; RB.constraints = RigidbodyConstraints.FreezeRotation; RB.collisionDetectionMode = CollisionDetectionMode.ContinuousDynamic; } speedSets = new List <MSpeedSet>(1) { new MSpeedSet() { name = "Ground", StartVerticalIndex = new IntReference(1), TopIndex = new IntReference(3), states = new List <StateID>(2) { MTools.GetInstance <StateID>("Idle"), MTools.GetInstance <StateID>("Locomotion") }, Speeds = new List <MSpeed>(3) { new MSpeed("Walk", 1, 4, 4), new MSpeed("Trot", 2, 4, 4), new MSpeed("Run", 3, 4, 4) } } }; BoolVar useCameraInp = MTools.GetInstance <BoolVar>("Global Camera Input"); BoolVar globalSmooth = MTools.GetInstance <BoolVar>("Global Smooth Vertical"); FloatVar globalTurn = MTools.GetInstance <FloatVar>("Global Turn Multiplier"); if (useCameraInp != null) { useCameraInput.Variable = useCameraInp; } if (globalSmooth != null) { SmoothVertical.Variable = globalSmooth; } if (globalTurn != null) { TurnMultiplier.Variable = globalTurn; } }
void Reset() { ID = MTools.GetInstance <StateID>("Death"); General = new AnimalModifier() { modify = (modifier)(-1), Persistent = true, LockInput = true, LockMovement = true, AdditiveRotation = true, }; }
public override void StartTask(MAnimalBrain brain, int index) { if (AlignTarget != null || AlignTarget.Value == null) { brain.StartCoroutine(MTools.AlignLookAtTransform(brain.Animal.transform, AlignTarget.Value, alignTime)); } else { Debug.LogWarning($"The Align Target is empty or Null"); } brain.TaskDone(index); }
private void DrawElement(SerializedProperty element) { var reaction = element.objectReferenceValue as MReaction; if (reaction) { EditorGUILayout.BeginVertical(StyleBlue); EditorGUILayout.HelpBox(reaction.description, MessageType.None); EditorGUILayout.EndVertical(); MTools.DrawScriptableObject(reaction, false, 3); } }
public string scannPackInconnu(string OTID = "", string valCode = "") { string res = ""; DataTable dt = Configs._query.executeProc("packScannePackage", "valCode@string@" + valCode + "#OTID@int@" + OTID); if (MTools.verifyDataTable(dt)) { res = dt.Rows[0][0].ToString(); } return(res); }
public override void TryExitState(float DeltaTime) { if (MTools.ElapsedTime(EnterWaterTime, TryExitTime)) //do not try to exit if the animal just enter the water { CheckWater(); if (!IsInWater) { Debugging("[Allow Exit] No Longer in water"); animal.CheckIfGrounded(); AllowExit(); } } }
public string updatePackInconnu(string IDPack = "", string OTID = "") { string res = ""; DataTable dt = Configs._query.executeProc("packAffectePackage", "IDPack@int@" + IDPack + "#OTID@int@" + OTID); if (MTools.verifyDataTable(dt)) { res = dt.Rows[0][0].ToString(); } return(res); }
public string getRolebyId(string id) { string query = "SELECT NomRole FROM [Role] INNER JOIN USERS ON [Role].idRole = USERS.idRole WHERE USERS.UserID = " + id + ""; DataTable dtUser = Configs._query.executeSql(query); if (MTools.verifyDataTable(dtUser)) { return(dtUser.Rows[0]["NomRole"].ToString()); } else { return("0"); } }
public string deletePackage(string id) { string param = "id@int@" + id; string res = ""; DataTable dt = Configs._query.executeProc("packDeletePackage", param); if (MTools.verifyDataTable(dt)) { res = dt.Rows[0][0].ToString(); } return(res); }
public virtual void Set_by_BinaryIndex(int binaryCurrent) { int current = 0; for (int i = 0; i < materials.Length; i++) { if (MTools.IsBitActive(binaryCurrent, i)) { current = i; //find the first active bit and get the current break; } } ChangeMaterial(current); }
public string getUserbyId(string id) { string query = "select * from USERS where UserID=" + id + ""; DataTable dtUser = Configs._query.executeSql(query); if (MTools.verifyDataTable(dtUser)) { return(dtUser.Rows[0]["Login"].ToString()); } else { return("0"); } }
/// <summary>Check if the animal can change to fall state if there's no future ground to land on</summary> private void Check_for_Falling() { AllowExit(); OneCastingFall_Ray = true; if (activeJump.JumpLandDistance == 0) { animal.Grounded = true; //We are still on the ground return; //Meaning that is a False Jump (like Neigh on the Horse) } float RayLength = animal.ScaleFactor * activeJump.JumpLandDistance; //Ray Distance with the Scale Factor var MainPivot = animal.Main_Pivot_Point; var Direction = -animal.Up; if (activeJump.JumpLandDistance > 0) //greater than 0 it can complete the Jump on an even Ground { if (debug) { Debug.DrawRay(MainPivot, Direction * RayLength, Color.red, 0.25f); } if (Physics.Raycast(MainPivot, Direction, out JumpRay, RayLength, animal.GroundLayer, QueryTriggerInteraction.Ignore)) { Debugging($"Min Distance to complete <B>[{ activeJump.name}]</B> - { JumpRay.distance:F4}"); if (debug) { MTools.DebugTriangle(JumpRay.point, 0.1f, Color.yellow); } var GroundSlope = Vector3.Angle(JumpRay.normal, animal.UpVector); if (GroundSlope > animal.maxAngleSlope) //if we found something but there's a deep slope { Debugging($"[AllowExit] Try to Land but the Sloope was too Deep. Slope: {GroundSlope:F2}"); animal.UseGravity = General.Gravity; return; } IgnoreLowerStates = true; //Means that it can complete the Jump Ignore Fall Locomotion and Idle Debugging($"Can finish the Jump. Going to Jump End"); } else { animal.UseGravity = General.Gravity; Debugging($"[Allow Exit] - <B>Jump [{activeJump.name}] </B> Go to Fall..No Ground was found"); } } }
private IEnumerator C_DismountAnim() { var DismountPos = Vector3.ProjectOnPlane(MountTrigger.transform.position - transform.position, Vector3.up).normalized; DismountPos *= DismountOffset.x; DismountPos.y = DismountOffset.y; Debug.DrawRay(transform.position, DismountPos, Color.yellow, 1); yield return(MTools.AlignTransform_Position(transform, transform.position + DismountPos, MountTime, DismountAnim)); End_Dismounting(); MainCollider.enabled = true; }