Example #1
0
 public void RequestItemAsset(NodeAddedEvent e, HangarTankBaseSystem.TankItemPreviewNode tank, [Context, JoinByParentGroup] NotLoadedSkinPreviewItemNode skinItem, SingleNode <MandatoryAssetsFirstLoadingCompletedComponent> mandatoryAssetsLoadingComplete)
 {
     skinItem.Entity.AddComponent <AssetRequestComponent>();
 }
Example #2
0
 public void HideLoadIndicator(NodeAddedEvent e, LoadedContainerPreviewItemNode container, LoadedTankColoringPreviewItemNode tankColoring, LoadedWeaponColoringPreviewItemNode weaponColoring, HangarTankBaseSystem.WeaponItemPreviewNode weapon, [JoinByParentGroup, Context] LoadedSkinPreviewItemNode weaponSkin, HangarTankBaseSystem.TankItemPreviewNode tank, [Context, JoinByParentGroup] LoadedSkinPreviewItemNode tankSkin, [JoinAll] TankLoadGearNode loadGear)
 {
     base.ScheduleEvent <HideLoadGearEvent>(loadGear);
 }
Example #3
0
 public void ShowLoadIndicator(NodeAddedEvent e, SingleNode <HangarInstanceComponent> hangar, HangarTankBaseSystem.TankItemPreviewNode tank, [Context, JoinByParentGroup] LoadingSkinPreviewItemNode tankSkin, [JoinAll] TankLoadGearNode loadGear)
 {
     base.ScheduleEvent(new ShowLoadGearEvent(true), loadGear);
 }
Example #4
0
 public void CancelItemAssetRequest(NodeRemoveEvent e, HangarTankBaseSystem.TankItemPreviewNode parent, [JoinByParentGroup] LoadingSkinPreviewItemNode item)
 {
     item.Entity.RemoveComponent <AssetRequestComponent>();
 }
        public void BuildTank(NodeAddedEvent e, HangarTankBaseSystem.HangarNode hangar, HangarTankBaseSystem.WeaponSkinItemPreviewLoadedNode weaponSkin, [Context, JoinByParentGroup] HangarTankBaseSystem.WeaponItemPreviewNode weaponItem, HangarTankBaseSystem.HullSkinItemPreviewLoadedNode tankSkin, [Context, JoinByParentGroup] HangarTankBaseSystem.TankItemPreviewNode tankItem, TankPaintItemPreviewLoadedNode tankPaint, WeaponPaintItemPreviewLoadedNode weaponPaint, HangarTankBaseSystem.HangarCameraNode hangarCamera, SingleNode <SupplyEffectSettingsComponent> settings)
        {
            Transform root = hangar.hangarTankPosition.transform;

            root.DestroyChildren();
            GameObject tankInstance = (GameObject)Object.Instantiate(tankSkin.resourceData.Data);

            tankInstance.transform.SetParent(root);
            tankInstance.transform.localPosition = Vector3.zero;
            tankInstance.transform.localRotation = Quaternion.identity;
            tankSkin.hangarItemPreview.Instance  = tankInstance;
            tankInstance.GetComponentInChildren <NitroEffectComponent>().InitEffect(settings.component);
            Transform  mountPoint     = tankInstance.GetComponent <MountPointComponent>().MountPoint;
            GameObject weaponInstance = (GameObject)Object.Instantiate(weaponSkin.resourceData.Data);

            weaponInstance.transform.SetParent(tankInstance.transform);
            weaponInstance.transform.localPosition = mountPoint.localPosition;
            weaponInstance.transform.localRotation = mountPoint.localRotation;
            weaponSkin.hangarItemPreview.Instance  = weaponInstance;
            GameObject tankPaintInstance = (GameObject)Object.Instantiate(tankPaint.resourceData.Data);

            tankPaintInstance.transform.SetParent(tankInstance.transform);
            tankPaintInstance.transform.localPosition = Vector3.zero;
            GameObject weaponPaintInstance = (GameObject)Object.Instantiate(weaponPaint.resourceData.Data);

            weaponPaintInstance.transform.SetParent(tankInstance.transform);
            weaponPaintInstance.transform.localPosition = Vector3.zero;
            PhysicsUtil.SetGameObjectLayer(root.gameObject, Layers.STATIC);
            this.ApplyPaint(tankInstance, weaponInstance, tankPaintInstance, weaponPaintInstance);
            weaponInstance.GetComponentInChildren <DoubleDamageEffectComponent>().InitEffect(settings.component);
            weaponInstance.GetComponentInChildren <DoubleDamageSoundEffectComponent>().RecalculatePlayingParameters();
            Renderer weaponRenderer = TankBuilderUtil.GetWeaponRenderer(weaponInstance);

            weaponRenderer.tag = "TankWeapon";
            Renderer hullRenderer = TankBuilderUtil.GetHullRenderer(tankInstance);

            hullRenderer.tag = "TankHull";
            weaponRenderer.reflectionProbeUsage = ReflectionProbeUsage.Off;
            weaponRenderer.lightProbeUsage      = LightProbeUsage.Off;
            hullRenderer.reflectionProbeUsage   = ReflectionProbeUsage.Off;
            hullRenderer.lightProbeUsage        = LightProbeUsage.Off;
            BurningTargetBloom componentInChildren = hangarCamera.cameraRootTransform.Root.GetComponentInChildren <BurningTargetBloom>();

            componentInChildren.targets.Clear();
            componentInChildren.targets.Add(weaponRenderer);
            componentInChildren.targets.Add(hullRenderer);
            base.ScheduleEvent <HangarTankBuildedEvent>(hangar);
        }