예제 #1
0
    protected override void OnUpdate()
    {
        Entity gpm = GameProcessManager.current_entity;

        if (EntityManager.GetSharedComponentData <CampArray>(gpm).Value.Length > 0)
        {
            Entity       e            = m.entity[0];
            CurrentPhase currentPhase = EntityManager.GetComponentData <CurrentPhase>(gpm);
            CampArray    camplist     = EntityManager.GetSharedComponentData <CampArray>(gpm);
            int          index        = 0;
            for (index = 0; index < camplist.Value.Length; index++)
            {
                if (currentPhase.value.campType == camplist.Value[index].campType)
                {
                    break;
                }
            }

            if (index < camplist.Value.Length)
            {
                index += 1;
            }
            else
            {
                index = 0;
            }
            currentPhase.value = camplist.Value[index];
            EntityManager.DestroyEntity(e);
            EntityManager.SetComponentData(e, currentPhase);
        }
    }
예제 #2
0
    protected override void OnUpdate()
    {
        if (message.Length > 0)
        {
            Entity      gpm       = GameProcessManager.current_entity;
            CampArray   campArray = EntityManager.GetSharedComponentData <CampArray>(gpm);
            List <Camp> newList   = ConvertDataType.NativeArrayToList(campArray.Value);

            for (int i = 0; i < message.Length; i++)
            {
                if (newList.Contains(message.campEliminate[i].Value))
                {
                    newList.Remove(message.campEliminate[i].Value);
                }
                EntityManager.DestroyEntity(message.entity[i]);
            }
            campArray.Value = ConvertDataType.ListToNativeArray <Camp>(newList);
            EntityManager.SetSharedComponentData(gpm, campArray);
        }
    }