コード例 #1
0
    public virtual bool CheckErrors()
    {
        error = false;

        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;
                }
            }
        }

        if (!targetingScript)
        {
            targetingScript = UtilityMF.GetComponentInParent <MF_AbstractTargeting>(transform);
        }

        if (!GetComponent <MF_AbstractPlatform>())
        {
            Debug.Log(this + ": No platform script found."); error = true;
        }

        return(error);
    }
コード例 #2
0
    // -------------------------------------- end of FxItem

    void OnValidate()
    {
        if (Application.isPlaying == true)
        {
            if (dying == true || dead == true)
            {
                return;
            }                                      // don't change while effects are possibly detached
            if (validate == false)                 // prevent Add() running more than once
            {
                statsScript = UtilityMF.GetComponentInParent <MF_AbstractStats>(transform);
                if (statsScript)
                {
                    statsScript.fxScript.Add(this);
                }
            }

            float dur = 0f;
            for (int i = 0; i < fxList.Length; i++)
            {
                fxList[i].thisScript  = this;
                fxList[i].statsScript = statsScript;
                fxList[i].Validate();
                dur             = Mathf.Max(fxList[i].fxDuration, fxList[i].duration == true ? fxList[i].minTime : 0f);
                longestDuration = Mathf.Max(longestDuration, dur);
            }
            validate = true;
            CheckUnit();
        }
    }
コード例 #3
0
    public virtual bool CheckErrors()
    {
        // look for defined receiving object
        if (!receivingObject && dontSearchForReceivingObject == false)
        {
            MF_AbstractPlatform ap = UtilityMF.GetComponentInParent <MF_AbstractPlatform>(transform);
            if (ap)
            {
                receivingObject = ap.gameObject;
            }
        }

        return(error);
    }
コード例 #4
0
    public virtual bool CheckErrors()
    {
        error = false;

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

        return(error);
    }
コード例 #5
0
    public override bool CheckErrors()
    {
        base.CheckErrors();

        if (!targetListScript)
        {
            targetListScript = UtilityMF.GetComponentInParent <MF_B_TargetList>(transform);
            if (targetListScript == null)
            {
                Debug.Log(this + ": No target list found."); error = true;
            }
        }

        return(error);
    }
コード例 #6
0
ファイル: MF_B_Navigation.cs プロジェクト: zmaimy22/Plugins
    bool CheckErrors()
    {
        error = false;

        if (!mobilityScript)
        {
            mobilityScript = UtilityMF.GetComponentInParent <MF_AbstractMobility>(transform);
        }

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

        return(error);
    }
コード例 #7
0
    private bool CheckErrors()
    {
        if (!targetListScript)
        {
            targetListScript = UtilityMF.GetComponentInParent <MF_B_TargetList>(transform);
            if (targetListScript == null)
            {
                Debug.Log(this + ": Target list location not found."); error = true;
            }
        }

        cScript = UtilityMF.GetComponentInParent <MF_AbstractClassify>(transform);
        if (cScript == null)
        {
            Debug.Log(this + ": Classify script not found."); error = true;
        }

        return(error);
    }
コード例 #8
0
    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);
    }