public virtual bool CheckErrors()
    {
        error = false;
        Transform rps;

        if (weapons.Length > 0)
        {
            for (int cw = 0; cw < weapons.Length; cw++)
            {
                if (weapons[cw].weapon == false)
                {
                    Debug.Log(this + ": TurretControl weapon index " + cw + " hasn't been defined."); error = true;
                }
            }
        }

        // look for defined targeting script
        if (!targetingScript)
        {
            rps = UtilityMF.RecursiveParentComponentSearch("MF_AbstractTargeting", transform);
            if (rps != null)
            {
                targetingScript = rps.GetComponent <MF_AbstractTargeting>();
            }
        }

        return(error);
    }
    public virtual bool CheckErrors()
    {
        Transform rps;

        // look for defined receiving object
        if (!receivingObject && dontSearchForReceivingObject == false)
        {
            rps = UtilityMF.RecursiveParentComponentSearch("MF_AbstractPlatform", transform);
            if (rps != null)
            {
                receivingObject = rps.gameObject;
            }
        }

        return(error);
    }
    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);
    }
Exemple #4
0
    private bool CheckErrors()
    {
        Transform rps;

        if (!targetListScript)
        {
            rps = UtilityMF.RecursiveParentComponentSearch("MF_B_TargetList", transform);
            if (rps != null)
            {
                targetListScript = rps.GetComponent <MF_B_TargetList>();
            }
            else
            {
                Debug.Log(this + ": Target list location not found."); error = true;
            }
        }
        return(error);
    }
Exemple #5
0
    public virtual bool CheckErrors()
    {
        error = false;

        Transform rps;

        if (!selectionScript)
        {
            rps = UtilityMF.RecursiveParentComponentSearch("MF_AbstractSelection", transform);
            if (rps != null)
            {
                selectionScript = rps.GetComponent <MF_AbstractSelection>();
            }
            else
            {
                Debug.Log(this + ": No selection script found."); error = true;
            }
        }

        return(error);
    }
    bool CheckErrors()
    {
        error = false;
        Transform rps = null;

        if (!mobilityScript)
        {
            rps = UtilityMF.RecursiveParentComponentSearch("MF_AbstractMobility", transform);
            if (rps != null)
            {
                mobilityScript = rps.GetComponent <MF_AbstractMobility>();
            }
        }

        if (!targetingScript)
        {
            if (GetComponent <MF_AbstractTargeting>())
            {
                targetingScript = GetComponent <MF_AbstractTargeting>();
            }
        }

        return(error);
    }