public virtual bool CheckErrors() { error = false; Transform rps; if (selectionManager) { if (!selectionManager.GetComponent <MF_SelectionManager>()) { Debug.Log(this + ": No MF_SelectionManager script found on defined selection manager."); error = true; } } else { Debug.Log(this + ": No Selection Manager defined."); error = true; } if (!targetListScript && NoTargetList == false) { rps = UtilityMF.RecursiveParentComponentSearch("MF_AbstractTargetList", transform); if (rps != null) { targetListScript = rps.GetComponent <MF_AbstractTargetList>(); } } if (!targetingScript && NoTargetingScript == false) { rps = UtilityMF.RecursiveParentComponentSearch("MF_AbstractTargeting", transform); if (rps != null) { targetingScript = rps.GetComponent <MF_AbstractTargeting>(); } } if (!navigationScript && NoNavigationScript == false) { rps = UtilityMF.RecursiveParentComponentSearch("MF_AbstractNavigation", transform); if (rps != null) { navigationScript = rps.GetComponent <MF_AbstractNavigation>(); } } return(error); }
void ShiftClick() { bool _priority = false; if (Input.GetKey(KeyCode.Mouse1) || Input.GetKey(KeyCode.LeftControl)) { _priority = true; } if (sScript && sScript.allowClickTargeting == true) { if (sObject != null && sObject != clickObjectBase) // there's a selected object and it isn't this object { if (sScript.targetListScript) // does selected have a target list? { MF_AbstractTargetList _tlScript = sScript.targetListScript; // cache target list script // search for clicked target in selected objects target list if (_tlScript.ContainsKey(myId) == true) // found clicked object in target list { if (_priority == true) { // don't remove, make priority _tlScript.SetClickedPriority(myId, true); } else { // click removes object from target list _tlScript.ClickRemove(myId); // marks for removal } } else if (clickTargetable == true) // not found on target list // click adds to target list // new record { _tlScript.ClickAdd(myId, clickObjectBase.transform, clickObjectBase.GetComponent <MF_AbstractStatus>(), _priority, sScript.clickTargetPersistance, (sObject.transform.position - clickObjectBase.transform.position).sqrMagnitude); // other data } } } } }
public virtual bool CheckErrors() { error = false; if (!targetListScript && NoTargetList == false) { targetListScript = UtilityMF.GetComponentInParent <MF_AbstractTargetList>(transform); } if (!targetingScript && NoTargetingScript == false) { targetingScript = UtilityMF.GetComponentInParent <MF_AbstractTargeting>(transform); } if (!navigationScript && NoNavigationScript == false) { navigationScript = UtilityMF.GetComponentInParent <MF_AbstractNavigation>(transform); } return(error); }