Beispiel #1
0
    protected virtual void Init()
    {
        mGUID = UtilCommon.GenGUID();

        MASK_DEFAULT = 1 << LayerMask.NameToLayer(SceneLayerMask.Terrain);

        mNMA = mGameObject.GetComponent <NavMeshAgent>();

        GameObject root = GameObject.Find("SimplePool/" + mGameObject.name + "/Root");

        if (root != null)
        {
            mAnim = mGameObject.transform.Find("Root").GetComponent <Animator>();
            AnimSpeed(1);
        }
        GameObject ap = GameObject.Find("SimplePool/" + mGameObject.name + "/Root/AttackPoint");

        if (ap != null)
        {
            mAttackPoint = ap.transform;
        }
        mRenderers = mGameObject.transform.GetComponentsInChildren <SkinnedMeshRenderer>();
        mRigidbody = mGameObject.GetComponent <Rigidbody>();

        SetBodyActive();

        mDisappearTimer = attr.baseAttr.disappearTime;
        InitCollider();
        BindEffect();
        CoroutineController.Instance.StartCoroutine(DisProtected(mProtectedTime));
    }
Beispiel #2
0
    static int GenGUID(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 0);
        int o = UtilCommon.GenGUID();

        LuaScriptMgr.Push(L, o);
        return(1);
    }