コード例 #1
0
        public static bool SetObjVisibleByFow(PoolObjHandle <ActorRoot> ar, GameObject obj, GameFowManager fowMgr, COM_PLAYERCAMP inHostCamp)
        {
            if (!ar && null == obj)
            {
                return(false);
            }
            VInt3 worldLoc = VInt3.zero;
            bool  flag     = false;

            if (ar)
            {
                worldLoc          = new VInt3(ar.handle.location.x, ar.handle.location.z, 0);
                flag              = fowMgr.IsVisible(worldLoc, inHostCamp);
                ar.handle.Visible = flag;
            }
            else if (obj != null)
            {
                worldLoc = (VInt3)obj.transform.position;
                worldLoc = new VInt3(worldLoc.x, worldLoc.z, 0);
                flag     = fowMgr.IsVisible(worldLoc, inHostCamp);
                if (flag)
                {
                    obj.SetLayer("Actor", "Particles", true);
                }
                else
                {
                    obj.SetLayer("Hide", true);
                }
            }
            return(flag);
        }
コード例 #2
0
        public static bool SetObjWithColVisibleByFow(PoolObjHandle <ActorRoot> inActor, GameFowManager fowMgr, COM_PLAYERCAMP inHostCamp)
        {
            if (!inActor)
            {
                return(false);
            }
            ActorRoot       handle = inActor.handle;
            VCollisionShape shape  = handle.shape;

            if (shape == null)
            {
                return(GameFowCollector.SetObjVisibleByFow(inActor, handle.gameObject, fowMgr, inHostCamp));
            }
            VInt3 location = handle.location;

            location = new VInt3(location.x, location.z, 0);
            bool flag = fowMgr.IsVisible(location, inHostCamp);

            if (flag)
            {
                handle.Visible = true;
            }
            else
            {
                flag           = shape.AcceptFowVisibilityCheck(inHostCamp, fowMgr);
                handle.Visible = flag;
            }
            return(flag);
        }