Exemplo n.º 1
0
    void Start()
    {
        l_j = MGR.Get_instance().transform.GetChild((int)Enum.Managerlist.Player).GetComponent <PlayerManagerScripts>().Load_Job;

        if (Player == null)
        {
            Player = GameObject.FindGameObjectWithTag("Player");
        }

        Anim = this.GetComponent <Animator>();


        if (SceneManager.GetActiveScene().name == "CampScene")
        {
            Nav         = this.GetComponent <NavMeshAgent>();
            Nav.speed   = WalkSpeed;
            Nav.enabled = false; // 코루틴으로 시간이 지나면 이동하기...
        }


        StartPos = this.GetComponent <Transform>().position;


        NPCMenu = GameObject.Find(this.gameObject.transform.name.ToString() + "Menu");
        NPCMenu.SetActive(false);

        if (NPCMenu != null)
        {
            NPCMenu.SetActive(false);
        }
    }
 private void EnqueueJob(LoadJob loadResult)
 {
     lock(pendingJobs)
     {
         pendingJobs.Enqueue(loadResult);
     }
 }
Exemplo n.º 3
0
        internal static void QueueAssetLoad <T>(AssetReference <T> asset, LoadPriority priority) where T : class, IAsset
        {
            AssetManager.SetState(asset.assetIndex, AssetState.Loading);

            if (!isSetup)
            {
                Setup();
            }
            LoadJob job = new LoadJob()
            {
                asset     = asset.Get(),
                assetId   = asset.assetIndex,
                assetName = asset.GetAssetName(),
                priority  = priority
            };

            switch (priority)
            {
            case LoadPriority.Medium:
                mediumPriorityQueue.Add(job);
                break;

            case LoadPriority.Low:
                lowPriorityQueue.Add(job);
                break;

            case LoadPriority.High:
                highPriorityQueue.Add(job);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(priority), priority, null);
            }
        }
Exemplo n.º 4
0
        public Mesh Load(FileExisting resource, Entity appendToEntity = null)
        {
            var loadJob = new LoadJob(resource, appendToEntity);
            var mesh    = loadJob.Parse();

            mesh.file = resource;
            return(mesh);
        }
Exemplo n.º 5
0
        internal void JobCompleted(LoadJob loadJob)
        {
            status = loadJob.Status;

            OnJobCompletion(loadJob);

            OnLoadCompleted();
        }
Exemplo n.º 6
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var job = new LoadJob
            {
                commandBuffer   = m_Barrier.CreateCommandBuffer().ToConcurrent(),
                rpcQueue        = m_RpcQueue,
                rpcFromEntity   = GetBufferFromEntity <OutgoingRpcDataStreamBufferComponent>(),
                levelSingleton  = m_LevelSingleton,
                levelFromEntity = GetComponentDataFromEntity <LevelComponent>()
            };
            var handle = job.ScheduleSingle(this, inputDeps);

            m_Barrier.AddJobHandleForProducer(handle);
            return(handle);
        }
Exemplo n.º 7
0
    void Awake()
    {
        m_FrameRateWait = new WaitForSeconds(1f / m_FrameRate);

        string        streamingPath = Application.streamingAssetsPath + "/Seq/c/";
        DirectoryInfo dir           = new DirectoryInfo(streamingPath);//初始化一个DirectoryInfo类的对象

        GetAllFiles(dir);

        loadJob = new LoadJob();
        //loadJob.JpgName = jpgName.ToArray();


        //LoadJobHandle = loadJob.Schedule();
    }
        private void UpdateJobs()
        {
            if (_jobQueue.Count > 0)
            {
                if (_pendingJob == null)
                {
                    _pendingJob = _jobQueue.Dequeue();
                }
            }

            if (_pendingJob != null)
            {
                var pending = _pendingJob.Process();
                if (!pending)
                {
                    _pendingJob = null;
                }
            }
        }
Exemplo n.º 9
0
 private void CompleteJob(LoadJob job)
 {
     try
     {
         loading = true;
         var assetPackage = AssetManager.GetAssetPackageForAsset(job.assetName);
         using Stream s = assetPackage.GetUncompressedFileStream(job.assetName);
         IAsset asset = job.asset;
         asset.LoadFromStream(s);
         AssetManager.SetState(job.assetId, AssetState.Loaded);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         AssetManager.SetState(job.assetId, AssetState.FailedToLoad);
     }
     finally
     {
         loading = false;
     }
 }
Exemplo n.º 10
0
        protected override void OnJobCompletion(LoadJob job)
        {
            switch (parameters.format)
            {
            case LocalAssetFormat.Byte:
            {
                byteData = ((ReadAllBytes)job).ByteData;
                break;
            }

            case LocalAssetFormat.Text:
            {
                textData = ((ReadAllText)job).TextData;
                break;
            }

            case LocalAssetFormat.Lines:
            {
                linesData = ((ReadAllLines)job).LinesData;
                break;
            }
            }
        }
Exemplo n.º 11
0
    void Start()
    {
        l_j = MGR.Get_instance().transform.GetChild((int)Enum.Managerlist.Player).GetComponent <PlayerManagerScripts>().Load_Job;

        if (Player == null && SceneManager.GetActiveScene().name != "CharacterSelectScene")
        {
            Player = GameObject.FindGameObjectWithTag("Player");
            target = Player.GetComponent <Transform>();
        }



        Cursor.lockState = CursorLockMode.None;
        Vector3 angles = this.transform.eulerAngles;

        x = angles.y;
        y = angles.x;



        angles = this.transform.eulerAngles;
        x      = angles.y;
        y      = angles.x;
    }
Exemplo n.º 12
0
 private void Awake()
 {
     l_j = MGR.Get_instance().transform.GetChild((int)Enum.Managerlist.Player).GetComponent <PlayerManagerScripts>().Load_Job;
     s_u = MGR.Get_instance().transform.GetChild((int)Enum.Managerlist.Skill).GetComponent <SkillManagerScript>().Set_Player;
     s_p = MGR.Get_instance().transform.GetChild((int)Enum.Managerlist.Player).GetComponent <PlayerManagerScripts>().Set_OldPosition;
 }
Exemplo n.º 13
0
 protected abstract void OnJobCompletion(LoadJob job);