Beispiel #1
0
        protected override void OnLoadRes(string name)
        {
            base.OnLoadRes(name);

            this.GameObject.SetActive(false);

            if (!mCustomBound)
            {
                this.mBounds = GameObjectUtil.GetGameObjectBounds(mGameObject);

                Bounds  temp   = new Bounds();
                Vector3 center = mBounds.center;
                center.y   /= Scale.x;
                temp.center = center;
                temp.size  /= Scale.x;

                this.mOriBounds = temp;
            }

            SetParent(mParent);

            this.SetWeight();

            this.Visible = mVisible;

            this.SetPhysics(mEnablePhysics);

            this.SetCollid(mEnableCollid);

            if (Layer > 0)
            {
                GameObjectUtil.SetLayer(this.GameObject, Layer);
            }

            foreach (GOEBaseComponent comp in mListComponent)
            {
                (comp as GOEEntityComponent).OnLoadGameObject();
            }
            setAutoDestory();
            checkAutoDestory();

            SetSpeed(effSpeed);

            onLoadPost();
            this.SetCastShadows(mCastShadows);

            this.SetAniCullingType(mAniCullingType);

            //addFakeShadow();
        }