Esempio n. 1
0
    void Awake()
    {
        inputSystem      = ConfigurationScript.getProjectInputSystem();
        topPanelAnimator = GameObject.Find("TopPanel").GetComponent <TopPanelAnimator>(); //reference to Animator script

        arrayOfRendererSpawnPoints();                                                     //make an array of SpawnPoints
    }
Esempio n. 2
0
        /// <summary>
        /// Creates object responsible for processing package of specified type.
        /// </summary>
        /// <param name="packageType">Type of the package to processed.</param>
        /// <param name="xmlPackage">The XML package to process.</param>
        /// <returns>Created package processing object.</returns>
        public IExecutingScript CreateScript(string packageType, XDocument xmlPackage)
        {
            if (packageType == null)
            {
                throw new ArgumentNullException("packageType");
            }

            CommunicationPackageType packageTypeVal;

            try
            {
                packageTypeVal = (CommunicationPackageType)Enum.Parse(typeof(CommunicationPackageType), packageType);
            }
            catch (ArgumentException)
            {
                packageTypeVal = CommunicationPackageType.Unknown;
            }
            IExecutingScript script = null;

            switch (packageTypeVal)
            {
            case CommunicationPackageType.ComplaintDocumentSnapshot:
                script = new ComplaintDocumentSnapshot(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.Configuration:
                script = new ConfigurationScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.ContractorSnapshot:
                script = new ContractorScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.ContractorRelations:
                script = new ContractorRelationsScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.ContractorGroupMembership:
                script = new ContractorGroupMembershipScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.DictionaryPackage:
                script = new DictionarySnapshotScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.FileDescriptor:
                script = new FileDescriptorScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.FinancialReport:
                script = new FinancialReportScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.FinancialDocumentSnapshot:
                script = new FinancialDocumentScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.InventoryDocumentSnapshot:
                script = new InventoryDocumentScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.ItemSnapshot:
                script = new ItemSnapshotScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.ItemRelation:
                script = new ItemRelationScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.ItemUnitRelation:
                script = new ItemUnitRelationScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.ItemGroupMembership:
                script = new ItemGroupMembershipScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.CommercialDocumentSnapshot:
                script = new CommercialDocumentScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.CommercialDocumentSnapshotEx:
                script = new CommercialDocumentExScript(this.UnitOfWork, this.ExecutionController, this.IsHeadquarter);
                break;

            case CommunicationPackageType.Series:
                script = new SeriesScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.CommercialWarehouseValuation:
                script = new CommercialWarehouseValuation(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.CommercialWarehouseRelation:
                script = new CommercialWarehouseRelation(UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.DocumentRelation:
                script = new DocumentRelationScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.IncomeOutcomeRelation:
                script = new IncomeOutcomeRelation(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.Payment:
                script = new PaymentScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.WarehouseDocumentValuation:
                script = new WarehouseDocumentValuation(this.UnitOfWork, this.ExecutionController, this.IsHeadquarter);
                break;

            //TODO !! aktualnie WZk dotykajaca mmki bedzie traktowana jak by nie miala nic wspolnego z mmka
            //     czyli nie zostanie przeslana do oddzialu docelowego
            case CommunicationPackageType.WarehouseDocumentSnapshot:
                if (xmlPackage.Root.Element("warehouseDocumentLine").Elements("entry").All(row => row.Element("isDistributed").Value.Equals("1")))
                {
                    DocumentType docType = DictionaryMapper.Instance.GetDocumentType(new Guid(xmlPackage.Root.Element("warehouseDocumentHeader")
                                                                                              .Element("entry").Element("documentTypeId").Value));
                    if (docType.DocumentCategory != Makolab.Fractus.Kernel.Enums.DocumentCategory.IncomeWarehouseCorrection && docType.DocumentCategory != Makolab.Fractus.Kernel.Enums.DocumentCategory.OutcomeWarehouseCorrection)
                    {
                        script = new ShiftDocumentSnapshot(this.UnitOfWork, this.ExecutionController, this.IsHeadquarter);
                    }
                    else
                    {
                        script = new WarehouseDocumentSnapshot(this.UnitOfWork, this.ExecutionController, this.IsHeadquarter);
                    }
                }
                else
                {
                    script = new WarehouseDocumentSnapshot(this.UnitOfWork, this.ExecutionController, this.IsHeadquarter);
                }
                break;

            case CommunicationPackageType.WarehouseStock:
                script = new WarehouseStockScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.UnrelateCommercialDocument:
                script = new UnrelateCommercialDocumentScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.UnrelateWarehouseDocumentForOutcome:
                script = new UnrelateWarehouseDocumentForOutcomeScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.UnrelateWarehouseDocumentForIncome:
                script = new UnrelateWarehouseDocumentForIncomeScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.ShiftDocumentStatus:
                script = new ShiftDocumentStatusScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.PriceRule:
                script = new PriceRuleScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.PriceRuleList:
                script = new PriceRuleListScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.Custom:
                script = new CustomScript(this.UnitOfWork, this.ExecutionController);
                break;

            case CommunicationPackageType.Unknown:
            case CommunicationPackageType.Other:
            default:
                script = new NullScript();
                break;
            }
            script.LocalTransactionId = this.LocalTransactionId;
            return(script);
        }
Esempio n. 3
0
    void Start()
    {
        skeletonMaterial = Resources.Load("Skeleton", typeof(Material)) as Material;

        barracudaRunner = GameObject.Find("BarracudaRunner").GetComponent <VNectBarracudaRunner>();
        barracudaRunner.ModelQuality = configurationSetting.TrainedModel;

        videoCapture = GameObject.Find("MainTexrure").GetComponent <VideoCapture>();

        Menu        = GameObject.Find("Menu");
        cameraMover = GameObject.Find("MainCamera").GetComponent <CameraMover>();

        sourceDevice = GameObject.Find("SourceDevice").GetComponent <Dropdown>();
        WebCamDevice[] devices = WebCamTexture.devices;
        foreach (var d in devices)
        {
            sourceDevice.options.Add(new Dropdown.OptionData(d.name));
        }
        sourceDevice.value = 0;

        btnPause     = GameObject.Find("btnPause").GetComponent <Button>();
        ifFrame      = GameObject.Find("ifFrame").GetComponent <InputField>();
        txFrameCount = GameObject.Find("txFrameCount").GetComponent <Text>();
        btnSkip      = GameObject.Find("btnSkip").GetComponent <Button>();
        pnlVideoIF   = GameObject.Find("pnlVideoIF");
        pnlVideoIF.SetActive(false);

        btnSourceDevice = GameObject.Find("btnSourceDevice").GetComponent <Button>();
        txtFPS          = GameObject.Find("txtFPS").GetComponent <Text>();
        btnRecord       = GameObject.Find("btnRecord").GetComponent <Button>();

        avatars = GameObject.Find("Avatars").GetComponent <Dropdown>();

        avatarSetting = GameObject.Find("AvatarSetting").GetComponent <AvatarSettingScript>();
        avatarSetting.Init();
        avatarSetting.gameObject.SetActive(false);
        configuration = GameObject.Find("Configuration").GetComponent <ConfigurationScript>();
        configuration.Init();
        configuration.gameObject.SetActive(false);

        ReflectConfiguration(configurationSetting);

        var settings = PlayerPrefs.GetString("AvatarSettings", "");

        //settings = "";
        // Decode Avatar Setting
        string[] asStr = settings.Split(';');
        foreach (var s in asStr)
        {
            string[] col = s.Split(',');
            if (col.Length != 16)
            {
                continue;
            }
            var setting = new AvatarSetting();

            if (!int.TryParse(col[0], out setting.AvatarType))
            {
                continue;
            }
            if (setting.AvatarType < 0)
            {
            }
            else if (setting.AvatarType == 0)
            {
                setting.VRMFilePath = col[1];
            }
            else if (setting.AvatarType == 1)
            {
                setting.FBXFilePath = col[1];
            }
            setting.AvatarName = col[2];
            if (!float.TryParse(col[3], out setting.PosX))
            {
                continue;
            }
            if (!float.TryParse(col[4], out setting.PosY))
            {
                continue;
            }
            if (!float.TryParse(col[5], out setting.PosZ))
            {
                continue;
            }
            if (!float.TryParse(col[6], out setting.DepthScale))
            {
                continue;
            }
            if (!float.TryParse(col[7], out setting.Scale))
            {
                continue;
            }
            if (!float.TryParse(col[8], out setting.FaceOriX))
            {
                continue;
            }
            if (!float.TryParse(col[9], out setting.FaceOriY))
            {
                continue;
            }
            if (!float.TryParse(col[10], out setting.FaceOriZ))
            {
                continue;
            }
            if (!int.TryParse(col[11], out setting.SkeletonVisible))
            {
                continue;
            }
            if (!float.TryParse(col[12], out setting.SkeletonPosX))
            {
                continue;
            }
            if (!float.TryParse(col[13], out setting.SkeletonPosY))
            {
                continue;
            }
            if (!float.TryParse(col[14], out setting.SkeletonPosZ))
            {
                continue;
            }
            if (!float.TryParse(col[15], out setting.SkeletonScale))
            {
                continue;
            }

            AvatarList.Add(setting);
        }
        ;

        if (AvatarList.Count == 0)
        {
            var setting = new AvatarSetting()
            {
                AvatarType = -1,
                AvatarName = "unity-chan",
                Avatar     = GameObject.Find("unitychan").GetComponent <VNectModel>(),
            };
            setting.Avatar.SetNose(setting.FaceOriX, setting.FaceOriY, setting.FaceOriZ);
            AvatarList.Add(setting);
            barracudaRunner.InitVNectModel(setting.Avatar);

            setting = new AvatarSetting()
            {
                AvatarType = -2,
                AvatarName = "yukihiko-chan",
                Avatar     = GameObject.Find("YukihikoAoyagi").GetComponent <VNectModel>(),
            };
            setting.Avatar.SetNose(setting.FaceOriX, setting.FaceOriY, setting.FaceOriZ);
            AvatarList.Add(setting);
            barracudaRunner.InitVNectModel(setting.Avatar);
        }

        avatars.options.Clear();
        foreach (var setting in AvatarList)
        {
            if (setting.AvatarType >= 0)
            {
                LoadAvatar(setting);
            }
            else if (setting.AvatarType < 0)
            {
                avatars.options.Add(new Dropdown.OptionData(setting.AvatarName));

                switch (setting.AvatarType)
                {
                case -1:
                    setting.Avatar = GameObject.Find("unitychan").GetComponent <VNectModel>();
                    break;

                case -2:
                    setting.Avatar = GameObject.Find("YukihikoAoyagi").GetComponent <VNectModel>();
                    break;
                }

                setting.Avatar.SetNose(setting.FaceOriX, setting.FaceOriY, setting.FaceOriZ);
                barracudaRunner.InitVNectModel(setting.Avatar);
            }
        }
        avatars.value = 0;
        ChangedAvatar(0);
    }
Esempio n. 4
0
 void Start()
 {
     this.movementScript = this.gameObject.GetComponent <EnemyMovemnetScript>();
     this.configScript   = GameObject.FindObjectOfType <ConfigurationScript>();
     this.movementScript.targetReached += MovementScript_targetReached;
 }
Esempio n. 5
0
 void Start()
 {
     this.configScript = GameObject.FindObjectOfType <ConfigurationScript>();
 }