Esempio n. 1
0
        public string vcproj_name; /* Project file, NULL for standard */

        #endregion Fields

        #region Constructors

        public Library()
        {
            has_platform_ext = false;
            is_executable = false;
            release_mode = ReleaseMode.ReleaseMode_Release;
            build_mode = BuildMode.BuildMode_Simple;
        }
 public void Start()
 {
     _updateNextFrame = true;
     _buildMode = FindObjectOfType<BuildMode>();
     _imageSetter = GetComponent<ImageSetter>();
     _runner = FindObjectOfType<Runner>();
 }
 public JunctionEdge( BuildMode.Controls.JunctionEdge edge, Func<JunctionEdge, IRoadInformation> roadInformationFactory )
 {
     this._roadInformationFactory = roadInformationFactory;
     this._roadInformation = this._roadInformationFactory( this );
     this.EdgeBuilder = edge;
     this.Drawer = new JunctionEdgeDrawer( this );
 }
Esempio n. 4
0
 protected virtual void Awake()
 {
     blockLayer = 1 << LayerMask.NameToLayer("Block");
     buildController = FindObjectOfType<BuildController>();
     buildController.InputModeSelected += (sender, args) => { currentBuildMode = args.buildMode; };
     cursor = GetComponent<Cursor>();
 }
Esempio n. 5
0
    void Awake()
    {
        Screen.showCursor = false;
        material = cursor.GetComponentInChildren<Renderer>().material;
        buildController = GetComponent<BuildController>();
        buildController.InputModeSelected += (sender, args) => 
        {
            currentBuildMode = args.buildMode;
            if (currentBuildMode == BuildMode.Blast) { material.color = blastColor; }
            else { material.color = buildColor; }
        };

        buildController.BrushSizeChanged += (sender, args) =>
        {
            currentBrushSize = args.brushSize;
            if (currentBrushSize == BrushSize.Normal)
            {
                cursor.localScale = Vector3.one;
                cursor.localPosition = Vector3.zero;
            }
            else
            {
                cursor.localScale = Vector3.one * 3;
                cursor.localPosition = Vector3.forward;
            }
        };
    }
 public CarsRemover( BuildMode.Controls.CarsRemover control, Func<CarsRemover, IRoadInformation> conductorFactory )
     : base( control )
 {
     Contract.Requires( control != null ); Contract.Requires( conductorFactory != null ); Contract.Ensures( this.Information != null );
     this._roadInformation = conductorFactory( this );
     this.CarsRemoverBuilder = control;
 }
Esempio n. 7
0
        public string vcproj_name; /* Project file, NULL for standard */

        #endregion Fields

        #region Constructors

        public Library()
        {
            has_platform_ext = false;
            is_executable = false;
            release_mode = ReleaseMode.ReleaseMode_Release;
            build_mode = BuildMode.BuildMode_Simple;
            platform = BasePlatform.Platform_Linux | BasePlatform.Platform_Windows;
        }
 private BuildRoute ConvertRoute( BuildMode.Controls.Route route, BuilderContext context, IRoadElement routeOwner )
 {
     return new BuildRoute( this.GetRouteElements( route, context, routeOwner ) )
                {
                    Probability = route.Probability,
                    Name = route.Name,
                    Owner = routeOwner,
                };
 }
 public CarsInserter( BuildMode.Controls.CarsInserter control, Func<CarsInserter, IRoadInformation> conductorFactory )
     : base( control )
 {
     Contract.Requires( control != null ); Contract.Requires( conductorFactory != null ); Contract.Ensures( this.Information != null );
     this._roadInformation = conductorFactory( this );
     this.CarsInserterBuilder = control;
     this.LastTimeCarWasInseter = DateTime.Now;
     this.CarsInsertionInterval = TimeSpan.FromMilliseconds( 500 );
 }
Esempio n. 10
0
    private void OnModeChanged(BuildMode mode)
    {
        //We make sure that the builder behaviour instance is not null.
        if (BuilderBehaviour.Instance == null)
        {
            return;
        }

        //If the current mode is None then we disable all the sockets also that the areas.
        if (BuilderBehaviour.Instance.CurrentMode == BuildMode.None)
        {
            foreach (AreaBehaviour Area in BuildManager.Instance.Areas)
            {
                Area.gameObject.SetActive(false);
            }

            foreach (SocketBehaviour Socket in BuildManager.Instance.Sockets)
            {
                if (Socket != null)
                {
                    Socket.DisableCollider();
                }
            }
        }
        //If the current mode is Placement/Edition then we active only the socket of same type that the current selected preview type.
        else if (BuilderBehaviour.Instance.CurrentMode == BuildMode.Placement || BuilderBehaviour.Instance.CurrentMode == BuildMode.Edition)
        {
            foreach (AreaBehaviour Area in BuildManager.Instance.Areas)
            {
                Area.gameObject.SetActive((Vector3.Distance(transform.position, Area.transform.position) <= Radius));
            }

            foreach (SocketBehaviour Socket in BuildManager.Instance.Sockets)
            {
                if (Socket != null)
                {
                    if (Vector3.Distance(transform.position, Socket.transform.position) <= Radius)
                    {
                        if (Socket.AttachedPart != null)
                        {
                            Socket.EnableColliderByType(BuilderBehaviour.Instance.SelectedPrefab.Type);
                        }
                    }
                    else
                    {
                        Socket.DisableCollider();
                    }
                }
            }
        }
    }
Esempio n. 11
0
    /// <summary>
    /// 编译DLL
    /// </summary>
    public static void BuildDll(string outPath, BuildMode mode)
    {
        EditorUtility.DisplayProgressBar("编译服务", "准备编译环境...", 0.1f);

        //输出环境
        var path = outPath + "/hotifx";

        //准备输出环境
        try
        {
            if (Directory.Exists(path))
            {
                Directory.Delete(path, true);
            }
            Directory.CreateDirectory(path);
        }
        catch (Exception e)
        {
            Debug.LogError(e.Message);
            EditorUtility.ClearProgressBar();
            EditorUtility.DisplayDialog("提示", "请手动删除hotfix文件后重试!", "OK");
            return;
        }
        EditorUtility.DisplayProgressBar("编译服务", "开始处理脚本", 0.2f);
        #region CS DLL引用搜集处理

        List <string> dllFiles = new List <string>();
        List <string> csFiles  = new List <string>();

        csFiles = FindDLLByCSPROJ("Assembly-CSharp.csproj", ref dllFiles);

        csFiles = csFiles.Select(f => f.Replace('\\', Path.DirectorySeparatorChar)).ToList();

        var baseCs   = csFiles.FindAll(f => !f.Contains("@hotfix") && f.EndsWith(".cs"));
        var hotfixCs = csFiles.FindAll(f => f.Contains("@hotfix") && f.EndsWith(".cs"));
        #endregion

        var outHotfixPath = outPath + "/hotfix.dll";

        if (mode == BuildMode.Release)
        {
            Build(baseCs, hotfixCs, dllFiles, outHotfixPath);
        }
        else if (mode == BuildMode.Debug)
        {
            Build(baseCs, hotfixCs, dllFiles, outHotfixPath, true);
        }

        AssetDatabase.Refresh();
        Debug.Log("脚本打包完毕");
    }
Esempio n. 12
0
        public IEnumerable <TValue> ExecuteMultiple <TValue>(QueryInfo queryInfo,
                                                             BuildMode buildMode = BuildMode.Single)
            where TValue : class, new()
        {
            Guard.ThrowIfNull("queryInfo", queryInfo);

            var strategy = _builderStrategyFactory.GetStrategy(buildMode);

            var values = Database.CreateCommandText(queryInfo.Query, QueryType.Text)
                         .WithParameters(queryInfo.Parameters)
                         .ExecuteMultiple <TValue>(strategy, queryInfo.TableObjectMappings);

            return(values);
        }
    private static string GetBuildName(BuildMode mode)
    {
        switch (mode)
        {
        case BuildMode.Server:
            return(_buildName + "_Server");

        case BuildMode.Client:
            return(_buildName + "_Client");

        default:
            throw new System.Exception();
        }
    }
        // TODO zmienic na cos bardziej sensownego
        private float GetLength( IControl prev, BuildMode.Controls.RouteElement current, IControl next )
        {
            if ( current.Control is RoadLaneBlock )
            {
                var lane = ( RoadLaneBlock ) current.Control;
                return Vector2.Distance( lane.LeftEdge.Location, lane.RightEdge.Location );
            }
            if ( current.Control is RoadJunctionBlock )
            {
                return Vector2.Distance( prev.Location, next.Location );
            }

            return Constans.PointSize;
        }
Esempio n. 15
0
        /// <summary>
        /// RPCConnection Constructor
        /// </summary>
        /// <param name="config">the Configuration paramaters for the endpoint and ports</param>
        /// <param name="wallet">true if configuraing for the wallet</param>
        public RpcConnection(IConfig config, bool wallet = true)
        {
            Config   = config;
            _uri     = $"http://{Config.Hostname}:{(wallet ? Config.WalletPort : config.DaemonPort)}{config.Api}";
            _client  = new HttpClient();
            _jsonRpc = Config.Version;

            var assemblyname = Assembly.GetExecutingAssembly().GetName().Name;

            //_logger = new Logger(config, assemblyname);


            _buildMode = Config.BuildMode;
        }
Esempio n. 16
0
    // Start is called before the first frame update
    void Start()
    {
        instance             = this;
        buildMode            = false;
        canActivatebuildMode = true;

        PlayerCamera.enabled = true;
        BuildCamera.enabled  = false;

        heightOffset = 6;

        Cursor.visible   = false;
        Cursor.lockState = CursorLockMode.Locked;
    }
Esempio n. 17
0
    /// <summary>
    /// アプリ名取得
    /// </summary>
    private static string GetProductName(Language language, BuildMode buildMode)
    {
        string productName = (language == Language.Ja) ? "SunFishing"
                           : (language == Language.Zh) ? "阳阳捕鱼"
                           : (language == Language.Tw) ? "陽陽捕魚"
                           : (language == Language.En) ? "SunFishing"
                           : "SHARK";

        if (buildMode == BuildMode.Debug)
        {
            productName += "-Debug";
        }

        return(productName);
    }
Esempio n. 18
0
    /// <summary>
    /// ビルドオプション値取得
    /// </summary>
    private static BuildOptions GetBuildOptions(BuildTarget buildTarget, BuildMode buildMode)
    {
        var opt = BuildOptions.None;

        if (buildTarget == BuildTarget.iOS)
        {
            opt |= BuildOptions.SymlinkLibraries;
        }
        if (buildMode == BuildMode.Debug)
        {
            opt |= BuildOptions.Development
                   | BuildOptions.ConnectWithProfiler
                   | BuildOptions.AllowDebugging;
        }
        return(opt);
    }
Esempio n. 19
0
        /// <summary>
        /// the Logger constructor
        /// </summary>
        /// <param name="config"></param>
        /// <param name="appname">the name of the calling application</param>
        /// <param name="mode">the buildmode: Prod or Testr</param>
        public Logger(IConfig config, string appname, BuildMode mode = BuildMode.Prod)
        {
            _config = config;
            switch (_config.LoggingType)
            {
            case LoggingType.File:
                CreateLoggerCJson(appname);
                break;

            case LoggingType.Server:
                CreateLoggerToServer(appname);
                break;
            }

            BuildMode = mode;
        }
Esempio n. 20
0
        /// <summary>
        /// 加载场景配置
        /// </summary>
        /// <param name="mode"></param>
        static void LoadConfig(BuildMode mode)
        {
            var       scene       = EditorSceneManager.OpenScene(SCENEPATH);
            TextAsset textContent = null;

            if ((int)mode >= 0)
            {
                string path = SceneConfigs[(int)mode];
                textContent = AssetDatabase.LoadAssetAtPath <TextAsset>(path);
                var config = GameObject.FindObjectOfType <BDLauncher>();
                config.ConfigText = textContent;
                Debug.LogFormat("【BuildPackage】 加载配置:{0} \n {1}", path, config.ConfigText);
            }

            EditorSceneManager.SaveScene(scene);
        }
Esempio n. 21
0
    private void setBuildMode(GameObject prefab)
    {
        prefabObj = prefab;
        if (FlagHelper.IsSet(prefab.GetComponent <BuildItem>().buildModeFlags, BuildModeFlags.FREE))
        {
            buildMode     = new FreeBuild();
            buildModeFlag = BuildModeFlags.FREE;
        }
        else if (FlagHelper.IsSet(prefab.GetComponent <BuildItem>().buildModeFlags, BuildModeFlags.POINTBASED))
        {
            buildMode     = new PointBuild();
            buildModeFlag = BuildModeFlags.POINTBASED;
        }

        prepareBuildMode();
    }
Esempio n. 22
0
 /// <summary>
 /// AndroidのKeystore設定
 /// </summary>
 private static void SetAndroidKeyStore(BuildMode buildMode)
 {
     if (buildMode == BuildMode.Debug)
     {
         PlayerSettings.Android.keystoreName = null;
         PlayerSettings.Android.keystorePass = null;
         PlayerSettings.Android.keyaliasName = null;
         PlayerSettings.Android.keyaliasPass = null;
     }
     else
     {
         PlayerSettings.Android.keystoreName = "/Users/compile/Keystore/shark.keystore";
         PlayerSettings.Android.keystorePass = "******";
         PlayerSettings.Android.keyaliasName = "shark";
         PlayerSettings.Android.keyaliasPass = "******";
     }
 }
        public static void BuildRealtime(bool testMode)
        {
            // set the build mode
            BuildMode = BuildMode.Realtime;

            // set to use posterior pose as the absolute pose source
            Settings.UsePosteriorPose = true;

            // build the common services
            BuildCommon();

            // create the debugging service
            Services.DebuggingService = new DebuggingService(false);

            // create the obstacle pipeline
            Services.ObstaclePipeline = new ObstaclePipeline();

            // create the occupancy grid
            Services.OccupancyGrid = new OccupancyGrid();

            // the car time comes from the timeserver in real time
            Services.CarTime = new UdpCarTimeProvider();

            // build the relative pose interface
            Services.PoseListener     = new OperationalLayer.Pose.PoseListener();
            Services.SceneEstListener = new SceneEstimatorListener();

            // build the command transport
            Services.CommandTransport = new ActuationTransport(true);

            // build the tracking manager
            Services.TrackingManager = new TrackingManager(Services.CommandTransport, testMode);

            // build the behavior manager
            Services.BehaviorManager = new BehaviorManager(testMode);

            // build the operational service
            Services.Operational = new OperationalService(Services.CommandTransport, !testMode, false);

            // start the services that need starting
            ((ActuationTransport)Services.CommandTransport).Start();

            Services.Operational.Start();
            Services.PoseListener.Start();
            Services.ObstaclePipeline.Start();
        }
    private static string GetBuildPath(BuildMode mode)
    {
        switch (mode)
        {
        case BuildMode.Server:
            return(_serverBuildPath);

        case BuildMode.Client:
            return(_clientBuildPath);

        case BuildMode.All:
            throw new System.Exception("Can't provide path for build mode \"All\"");

        default:
            throw new System.Exception("😬");
        }
    }
Esempio n. 25
0
    public void TryBuild(BuildMode buildMode)
    {
        Tile t = World.GetTileAt((int)transform.position.x, (int)transform.position.z);

        // Try Build a Building
        if (buildMode == BuildMode.Building)
        {
            // If move Goal building Use Dummy Goal building and set new Goal tile
            if (previewType == "Goal")
            {
                World.PlaceBuilding("DummyGoal", t);
                World.SetGoalTile(t);
            }
            else
            {
                // Normal building Use Dummy building
                World.PlaceBuilding("DummyBuilding", t);
            }
            // to Check if building this tile not obstruct valid pathfinding
            if (WorldController.Instance.StartPathfinding())
            {
                // This Valid Pathfinding
                foreach (GroundCube cube in cubes)
                {
                    cube.SetSelection(false);
                }
                t.building.Deconstruct();
                World.PlaceBuilding(previewType, t);
                canBuild = true;
                //destroy the preview
                Destroy(gameObject);
            }
            else
            {
                // Invalid Prebuild position (Obstruct pathway)
                // TODO: make Alert Dialog
                t.building.Deconstruct();
                canBuild = false;
            }
        }
        // Try place a Minion
        else if (buildMode == BuildMode.Minion)
        {
            World.PlaceMinion(previewType, t);
        }
    }
        public void LoadPrefs()
        {
            if (string.IsNullOrEmpty(_serverOnlyScene))
            {
                _serverOnlyScene = BuildScriptPrefs.GetServerOnlyScene();
            }

            if (string.IsNullOrEmpty(_clientOnlyScene))
            {
                _clientOnlyScene = BuildScriptPrefs.GetClientOnlyScene();
            }

            if (string.IsNullOrEmpty(_singleOnlyScene))
            {
                _singleOnlyScene = BuildScriptPrefs.GetSingleOnlyScene();
            }

            if (string.IsNullOrEmpty(_buildFolder))
            {
                _buildFolder = BuildScriptPrefs.GetBuildFolder();
            }

            if (string.IsNullOrEmpty(_serverIp))
            {
                _serverIp = BuildScriptPrefs.GetServerIP();
            }

            if (_serverPort == -1)
            {
                _serverPort = BuildScriptPrefs.GetServerPort();
            }

            if (_socketPort == -1)
            {
                _socketPort = BuildScriptPrefs.GetSocketPort();
            }

            _currentMode         = BuildScriptPrefs.GetCurrentMode();
            _buildAndRun         = BuildScriptPrefs.GetBuildAndRun();
            _useLocal            = BuildScriptPrefs.GetUseLocal();
            _useHetzner          = BuildScriptPrefs.GetUseHetzner();
            _devBuild            = BuildScriptPrefs.GetDevelopmentBuild();
            _buildTarget         = BuildScriptPrefs.GetBuildTarget();
            _autoConnectOnEnable = BuildScriptPrefs.GetAutoConnectOnEnable();
        }
Esempio n. 27
0
        public void should_be_an_injected_field(ServiceLifetime lifetime, BuildMode mode, bool isInjected)
        {
            var instance = ConstructorInstance.For <AWidget>(lifetime);

            var variable = instance.CreateVariable(mode, null, false);

            if (isInjected)
            {
                var argType = variable.ShouldBeOfType <InjectedServiceField>()
                              .ArgType;

                argType.ShouldBe(typeof(AWidget));
            }
            else
            {
                variable.ShouldNotBeOfType <InjectedServiceField>();
            }
        }
Esempio n. 28
0
        internal IGuiElement[] BuildMenu(IMenuHolder menuHolder, BuildMode buildMode)
        {
            List <IGuiElement> elements = new List <IGuiElement>();

            if (buildMode == BuildMode.Children || Type == MenuType.Menu)
            {
                if (Children.Count > 0)
                {
                    foreach (var child in Children)
                    {
                        elements.AddRange(child.BuildMenu(menuHolder, BuildMode.Parent));
                    }
                }
            }
            else if (buildMode == BuildMode.Parent)
            {
                if (Type == MenuType.SubMenu || Type == MenuType.Button)
                {
                    GuiStackMenuItem me = new GuiStackMenuItem();
                    me.Text = Title;

                    if (IsTranslatable)
                    {
                        me.TranslationKey = Title;
                    }

                    me.Action = () =>
                    {
                        if (Type == MenuType.SubMenu)
                        {
                            menuHolder.ShowMenu(this);
                        }
                        else
                        {
                            OnClick?.Invoke(this, new MenuItemClickedEventArgs());
                        }
                    };

                    elements.Add(me);
                }
            }

            return(elements.ToArray());
        }
Esempio n. 29
0
        private void SetBuildMode(BuildMode mode)
        {
            switch (mode)
            {
            case BuildMode.Auto:
                ButtonMode.Text      = "Mode: Auto";
                ButtonPack.Enabled   = false;
                ButtonUpdate.Enabled = false;
                break;

            case BuildMode.Manual:
                ButtonMode.Text      = "Mode: Manual";
                ButtonPack.Enabled   = true;
                ButtonUpdate.Enabled = true;
                break;
            }

            buildMode = mode;
        }
Esempio n. 30
0
        public static BuildAppResult BuildApk(
            string unityExePath,
            string nssUnityProj,
            BuildMode buildMode,
            bool prepareProject,
            string sdkRoot,
            string ndkRoot,
            string jdkRoot,
            string versionJsonPath  = null,
            VerLine verLine         = VerLine.DB,
            PackageType packageType = PackageType.Normal,
            BuildOption buildOption = BuildOption.None,
            string toolsDir         = "../Tools",
            string outputDir        = "Output",
            int svnRev = -1)
        {
            ModifyMacro(nssUnityProj, buildMode, packageType, buildOption);

            var result = new BuildAppResult();

            result.defaultTDir = ModifyDefaultLaunch(nssUnityProj, verLine, buildMode);

            var unityExe       = new Executable(unityExePath);
            var unityArguments = $"-batchmode -quit -logFile \"{SpaceUtil.GetPathInTemp("log.log", true)}\" -projectPath \"{nssUnityProj}\" -executeMethod \"NssIntegration.BuildProcedure.Entry\" -l \"{SpaceUtil.GetPathInTemp("log2.log", true)}\"";

            if (prepareProject)
            {
                unityArguments += $" PrepareProject {buildMode} {BuildTarget.Android} \"{versionJsonPath}\" {packageType} {buildOption} \"{toolsDir}\"";
            }
            unityArguments += $" BuildApk {buildMode} \"{sdkRoot}\" \"{ndkRoot}\" \"{jdkRoot}\" {verLine} {packageType} {buildOption} \"{toolsDir}\" \"{outputDir}\" {svnRev}";
            unityExe.Execute(unityArguments);

            var apks = Directory.GetFiles(outputDir, "*.apk");

            if (apks.Length != 1)
            {
                throw new NssIntegrationException($"'{outputDir}'中有{apks.Length}个apk文件,不合理!");
            }
            result.appPath    = apks[0];
            result.appVersion = ClientVersion.New(versionJsonPath).ToString();

            return(result);
        }
        public DefaultBuildContext(IExport targetExport, BuildMode mode, IContainer container, string contractName, 
            ErrorTracer errorTracer, BuildParameter[] parameters, IResolverExtension[] resolverExtensions)
        {
            Contract.Requires<ArgumentNullException>(targetExport != null, "targetExport");
            Contract.Requires<ArgumentNullException>(container != null, "container");
            Contract.Requires<ArgumentNullException>(errorTracer != null, "errorTracer");

            Metadata = targetExport.GetNamedExportMetadata(contractName);
            errorTracer.Export = Metadata.ToString();
            ExportType = targetExport.ImplementType;
            Target = null;
            BuildCompled = false;
            Policys = new PolicyList();
            Mode = mode;
            Container = container;
            ErrorTracer = errorTracer;
            Parameters = parameters;
            ResolverExtensions = resolverExtensions;
        }
Esempio n. 32
0
        public sealed override Variable CreateVariable(BuildMode mode, ResolverVariables variables, bool isRoot)
        {
            if (Lifetime == ServiceLifetime.Singleton)
            {
                if (mode == BuildMode.Build)
                {
                    return(generateVariableForBuilding(variables, mode, isRoot));
                }

                return(new InjectedServiceField(this));
            }

            if (Lifetime == ServiceLifetime.Scoped && mode == BuildMode.Dependency)
            {
                return(new GetInstanceFrame(this).Variable);
            }

            return(generateVariableForBuilding(variables, mode, isRoot));
        }
Esempio n. 33
0
        public void Sign()
        {
            if (Mode != BuildMode.BatchList)
            {
                throw new InvalidOperationException("Cannot mix build modes");
            }

            var buf = new List <byte>();

            foreach (var data in Batch)
            {
                data.Write(buf);
            }

            SignedData = buf.ToArray();
            Hash       = DoSign(SignedData);

            Mode = BuildMode.Signed;
        }
    public void SetBuildMode(BuildMode newMode, string type = null, bool useCratedObject = false, bool startBuildMode = true)
    {
        BuildMode     = newMode;
        BuildModeType = type;

        if (newMode == BuildMode.FLOOR)
        {
            buildModeTile = PrototypeManager.TileType.Get(type);
        }
        else if (newMode == BuildMode.FURNITURE)
        {
            this.useCratedObject   = useCratedObject;
            CurrentPreviewRotation = 0f;
        }

        if (startBuildMode)
        {
            mouseController.StartBuildMode();
        }
    }
Esempio n. 35
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Tab))
        {
            currentBuildMode = GetNextInputMode();
            InputModeSelected(this, new BuildModeArgs(currentBuildMode));

            if (currentBuildMode == BuildMode.Blast)
            {
                currentBrushSize = BrushSize.Normal;
                BrushSizeChanged(this, new BrushSizeArgs(currentBrushSize));
            }
        }

        if (currentBuildMode == BuildMode.Build && Input.GetKeyDown(KeyCode.LeftControl))
        {
            currentBrushSize = GetNextBrushSize();
            BrushSizeChanged(this, new BrushSizeArgs(currentBrushSize));
        }
    }
        private IEnumerable<RouteElement> GetRouteElements( BuildMode.Controls.Route route, BuilderContext context, IRoadElement routeOwner )
        {
            return route.Items.Select( ( index, prev, current, next ) =>
                                           {
                                               var nextElement = next != null ? next.Control : null;
                                               var prevElement = prev != null ? prev.Control : null;
                                               if ( prevElement == null && index == 0 )
                                               {
                                                   prevElement = routeOwner.BuildControl;
                                               }

                                               return new RouteElement
                                                          {
                                                              PriorityType = current.PriorityType,
                                                              RoadElement = this.GetRoadElement( context, current.Control ),
                                                              Length = this.GetLength( prevElement, current, nextElement ),
                                                              CanStopOnIt = current.CanStop,
                                                          };
                                           } );
        }
Esempio n. 37
0
 // Use this for initialization
 void Start () {
     if (Instance == null) {
         Instance = this;
     }
     else {
         Debug.LogError("Only one instance of BuildScript can be created");
     }
     buildPanelActive = buildPanel.activeSelf;
     tileMarkerScript = GameObject.Find("TileMarker").GetComponent<TileMarkerScript>();
     for (int i = 0; i < objects.Length; i++)
     {
         if (objects[i].name == "Store")
         {
             storeNumber = i;
             Debug.Log("storeNumber " + storeNumber);
             break;
         }
     }
    
 }
Esempio n. 38
0
    public void SetBuildMode(BuildMode mode)
    {
        switch (mode)
        {
        case BuildMode.Normal:
            RuntimeEngine.SetBuildModeNormal();
            break;

        case BuildMode.Continuous:
            RuntimeEngine.SetBuildModeContinuous();
            break;

        case BuildMode.Mass:
            RuntimeEngine.SetBuildModeMass();
            break;

        default: break;
        }

        buildMode = mode;
    }
Esempio n. 39
0
 void Start()
 {
     buildMode = BuildMode.NOTHING;
     buttonWalls.onClick.AddListener(() => {
         setModeBuildWalls();
     });
     buttonTraps.onClick.AddListener(() => {
         setModeBuildTraps();
     });
     buttonCancel.onClick.AddListener(() => {
         setModeNoBuild();
     });
     buttonGoblin.onClick.AddListener(() => {
         Instantiate(Resources.Load("creep_friend"), friendCreepSpawner.position, friendCreepSpawner.rotation);
         addGold(-costGoblins);
     });
     buttonNextLvl.onClick.AddListener(() => {
         levelCtrl.level += 1;
         StartCoroutine(levelCtrl.SpawnLevel());
     });
 }
        public static void BuildFullSim(bool testMode)
        {
            // set the build mode
            BuildMode = BuildMode.FullSim;

            // set to use pose estimator as the absolute pose source (posterior pose doesn't exist in sim)
            Settings.UsePosteriorPose = false;

            // build the common services
            BuildCommon();

            // create the debugging service
            Services.DebuggingService = new DebuggingService(false);

            // create the obstacle pipeline
            Services.ObstaclePipeline = new ObstaclePipeline();

            // the car time comes from the timeserver in real time
            Services.CarTime = new LocalCarTimeProvider();

            // build the relative pose interface
            Services.PoseListener     = null;
            Services.SceneEstListener = new SceneEstimatorListener();

            // build the command transport
            Services.CommandTransport = new FullSimTransport();

            // build the tracking manager
            Services.TrackingManager = new TrackingManager(Services.CommandTransport, testMode);

            // build the behavior manager
            Services.BehaviorManager = new BehaviorManager(false);

            // build the operational service
            Services.Operational = new OperationalService(Services.CommandTransport, false, false);

            // start the services that need starting
            Services.Operational.Start();
            Services.ObstaclePipeline.Start();
        }
        public static void BuildFullSim(bool testMode)
        {
            // set the build mode
            BuildMode = BuildMode.FullSim;

            // set to use pose estimator as the absolute pose source (posterior pose doesn't exist in sim)
            Settings.UsePosteriorPose = false;

            // build the common services
            BuildCommon();

            // create the debugging service
            Services.DebuggingService = new DebuggingService(false);

            // create the obstacle pipeline
            Services.ObstaclePipeline = new ObstaclePipeline();

            // the car time comes from the timeserver in real time
            Services.CarTime = new LocalCarTimeProvider();

            // build the relative pose interface
            Services.PoseListener = null;
            Services.SceneEstListener = new SceneEstimatorListener();

            // build the command transport
            Services.CommandTransport = new FullSimTransport();

            // build the tracking manager
            Services.TrackingManager = new TrackingManager(Services.CommandTransport, testMode);

            // build the behavior manager
            Services.BehaviorManager = new BehaviorManager(false);

            // build the operational service
            Services.Operational = new OperationalService(Services.CommandTransport, false, false);

            // start the services that need starting
            Services.Operational.Start();
            Services.ObstaclePipeline.Start();
        }
Esempio n. 42
0
    public void SetBuildingType(string type)
    {
        currentPrototype = world.GetBuildingPrototype(type);

        if (currentPrototype == null)
        {
            return;
        }

        currentRotation = currentPrototype.StartingRotation;

        if (currentPrototype.MultipleBuildMode)
        {
            BuildMode = BuildMode.Multiple;
        }
        else
        {
            BuildMode = BuildMode.Single;
        }

        InputManager.SetBuildMode(true);
    }
Esempio n. 43
0
        public SetterArg Resolve(ResolverVariables variables, BuildMode mode)
        {
            Variable variable;

            if (Instance.IsInlineDependency())
            {
                variable = Instance.CreateInlineVariable(variables);

                // HOKEY. Might need some smarter way of doing this. Helps to disambiguate
                // between ctor args of nested decorators
                if (!(variable is Setter))
                {
                    variable.OverrideName(variable.Usage + "_inline_" + ++variables.VariableSequence);
                }
            }
            else
            {
                variable = variables.Resolve(Instance, mode);
            }

            return(new SetterArg(Property, variable));
        }
Esempio n. 44
0
        /// <summary>
        /// 构建包体,使用当前配置、资源
        /// </summary>
        static public bool BuildIpa(BuildMode buildMode, bool isGenAssets, string outdir)
        {
            bool ret = false;

            //增加平台路径
            outdir = IPath.Combine(outdir, BApplication.GetPlatformPath(BuildTarget.iOS));
            BDFrameworkPipelineHelper.OnBeginBuildPackage(BuildTarget.iOS, outdir);
            //0.加载场景和配置
            LoadConfig(buildMode);

            //1.生成资源
            if (isGenAssets)
            {
                BuildAssetsTools.BuildAllAssets(RuntimePlatform.IPhonePlayer, BApplication.DevOpsPublishAssetsPath);
            }

            //2.拷贝资源打包
            AssetDatabase.StartAssetEditing(); //停止触发资源导入
            {
                //拷贝资源
                DevOpsTools.CopyPublishAssetsTo(Application.streamingAssetsPath, RuntimePlatform.IPhonePlayer);
                try
                {
                    var(_ret, outputpath) = BuildIpa(buildMode, outdir);
                    BDFrameworkPipelineHelper.OnEndBuildPackage(BuildTarget.iOS, outputpath);
                    ret = _ret;
                }
                catch (Exception e)
                {
                    //For ci
                    throw e;
                }

                DevOpsTools.DeleteCopyAssets(Application.streamingAssetsPath, RuntimePlatform.IPhonePlayer);
            }
            AssetDatabase.StopAssetEditing(); //恢复触发资源导入

            return(ret);
        }
Esempio n. 45
0
        public static void ModifyMacro(string nssUnityProj, BuildMode buildMode, PackageType packageType, BuildOption buildOption)
        {
            Logger.Log("开始修改客户端宏文件...");

            var mcsPath = Path.Combine(nssUnityProj, "Assets/mcs.rsp");

            if (!File.Exists(mcsPath))
            {
                throw new ArgumentException($"Can't find mcs.rsp in '{nssUnityProj}'!", nssUnityProj);
            }

            MCS mcs = new MCS(mcsPath);

            mcs.ModifyItemByBuildMode(buildMode);

            if (packageType == PackageType.Experience)
            {
                mcs.TryAddItem("-define:NSS_EXPERIENCE");
            }
            if (buildOption == BuildOption.AI)
            {
                mcs.TryAddItem("-define:AVATAR_AI_ENABLE");
            }

            mcs.Serialize(mcsPath);

            Logger.Log("修改后的宏文件:");
            Logger.Log(File.ReadAllText(mcsPath));

            var sha1FilePath = SpaceUtil.GetPathInPersistent("MCSSha1");
            var newSha1      = FileUtil.ComputeSHA1(mcsPath);

            if (!File.Exists(sha1FilePath) || File.ReadAllText(sha1FilePath) != newSha1)
            {// 宏变了,要删除dll,强制重编
                Logger.Log("宏变了,删除旧的DLL...");
                DirUtil.ClearDir(Path.Combine(nssUnityProj, "Library/ScriptAssemblies"));
            }
            File.WriteAllText(sha1FilePath, newSha1);
        }
Esempio n. 46
0
	private void Awake()
	{
		buildMode = BuildMode.Normal;

		InitAllTilesRuntime();
		InitBuildEngine();
	}
Esempio n. 47
0
 void Start()
 {
     currentBuildMode = BuildMode.Blast;
     currentBrushSize = BrushSize.Normal;
     InputModeSelected(this, new BuildModeArgs(currentBuildMode));
 }
 public void SetMode(BuildMode buildMode)
 {
     switch(buildMode)
     {
         case (BuildMode.CHARACTERISTICS):
             currentMode = BuildMode.CHARACTERISTICS;
             characteristicsPanel.SetActive(true);
             skillPanel.SetActive(false);
             talentPanel.SetActive(false);
             break;
         case (BuildMode.SKILLS):
             currentMode = BuildMode.SKILLS;
             skillPanel.SetActive(true);
             characteristicsPanel.SetActive(false);
             talentPanel.SetActive(false);
             break;
         case (BuildMode.TALENTS):
             currentMode = BuildMode.TALENTS;
             talentPanel.SetActive(true);
             characteristicsPanel.SetActive(false);
             skillPanel.SetActive(false);
             break;
         default:
             currentMode = BuildMode.CHARACTERISTICS;
             characteristicsPanel.SetActive(true);
             skillPanel.SetActive(false);
             talentPanel.SetActive(false);
             break;
     }
 }
Esempio n. 49
0
 public BuildModeArgs (BuildMode buildMode)
 {
     this.buildMode = buildMode;
 }
Esempio n. 50
0
	private void Awake()
	{
		if (Build == null)
			Build = GetComponent<BuildMode>();
	}
Esempio n. 51
0
 public BuilderOptions(BuildMode buildMode, string prefix = null)
 {
     BuildMode = buildMode;
     Prefix = prefix;
 }
        public static void BuildRealtime(bool testMode)
        {
            // set the build mode
            BuildMode = BuildMode.Realtime;

            // set to use posterior pose as the absolute pose source
            Settings.UsePosteriorPose = true;

            // build the common services
            BuildCommon();

            // create the debugging service
            Services.DebuggingService = new DebuggingService(false);

            // create the obstacle pipeline
            Services.ObstaclePipeline = new ObstaclePipeline();

            // create the occupancy grid
            Services.OccupancyGrid = new OccupancyGrid();

            // the car time comes from the timeserver in real time
            Services.CarTime = new UdpCarTimeProvider();

            // build the relative pose interface
            Services.PoseListener = new OperationalLayer.Pose.PoseListener();
            Services.SceneEstListener = new SceneEstimatorListener();

            // build the command transport
            Services.CommandTransport = new ActuationTransport(true);

            // build the tracking manager
            Services.TrackingManager = new TrackingManager(Services.CommandTransport, testMode);

            // build the behavior manager
            Services.BehaviorManager = new BehaviorManager(testMode);

            // build the operational service
            Services.Operational = new OperationalService(Services.CommandTransport, !testMode, false);

            // start the services that need starting
            ((ActuationTransport)Services.CommandTransport).Start();

            Services.Operational.Start();
            Services.PoseListener.Start();
            Services.ObstaclePipeline.Start();
        }
Esempio n. 53
0
	public void SetBuildMode(BuildMode mode)
	{
		switch(mode)
		{
			case BuildMode.Normal:
				RuntimeEngine.SetBuildModeNormal();
				break;
			case BuildMode.Continuous:
				RuntimeEngine.SetBuildModeContinuous();
				break;
			case BuildMode.Mass:
				RuntimeEngine.SetBuildModeMass();
				break;
			default: break;
		}

		buildMode = mode;
	}
        public IBuilderStrategy GetStrategy(BuildMode buildMode)
        {
            var strategy = _resolver.Resolve<IBuilderStrategy>(buildMode.ToString());

            return strategy;
        }
        public void CreateNeoclassical(BuildMode mode)
        {
            switch (mode)
            {
              case BuildMode.Many:
            for (int i = 0; i < 25; ++i)
            {
              float x_mod = i * 30f;
              for (int j = 0; j < 25; ++j)
              {
            float z_mod = j * 15f;
            int dice = Util.RollDice(new float[] { 0.25f, 0.25f, 0.25f, 0.25f });
            switch (dice)
            {
              case 1:
                Build(new Vector3(x_mod + 9f, 0f, z_mod + 3.5f),
                      new Vector3(x_mod + 9f, 0f, z_mod),
                      new Vector3(x_mod, 0f, z_mod),
                      new Vector3(x_mod, 0f, z_mod + 3.5f));
                break;

              case 2:
                Build(new Vector3(x_mod + 11f, 0f, z_mod + 4f),
                      new Vector3(x_mod + 11f, 0f, z_mod),
                      new Vector3(x_mod, 0f, z_mod),
                      new Vector3(x_mod, 0f, z_mod + 4f));
                break;

              case 3:
                Build(new Vector3(x_mod + 15f, 0f, z_mod + 6f),
                      new Vector3(x_mod + 15f, 0f, z_mod),
                      new Vector3(x_mod, 0f, z_mod),
                      new Vector3(x_mod, 0f, z_mod + 6f));
                break;

              case 4:
                Build(new Vector3(x_mod + 19f, 0f, z_mod + 8f),
                      new Vector3(x_mod + 19f, 0f, z_mod),
                      new Vector3(x_mod, 0f, z_mod),
                      new Vector3(x_mod, 0f, z_mod + 8f));
                break;
            }
              }
            }
            break;

              case BuildMode.Two:
            Build(new Vector3(8f, 0f, 4f),
              new Vector3(8f, 0f, 0f),
              new Vector3(0f, 0f, 0f),
              new Vector3(0f, 0f, 4f));
            break;

              case BuildMode.Three:
            Build(new Vector3(11f, 0f, 4f),
              new Vector3(11f, 0f, 0f),
              new Vector3(0f, 0f, 0f),
              new Vector3(0f, 0f, 4f));

            //Build(new Vector3(20f, 0f, 4f),
            //      new Vector3(37f, 0f, 4f),
            //      new Vector3(37f, 0f, 0f),
            //      new Vector3(20f, 0f, 0f));
            break;

              case BuildMode.Four:
            Build(new Vector3(15f, 0f, 6f),
              new Vector3(15f, 0f, 0f),
              new Vector3(0f, 0f, 0f),
              new Vector3(0f, 0f, 6f));
            break;

              case BuildMode.Five:
            Build(new Vector3(19f, 0f, 8f),
              new Vector3(19f, 0f, 0f),
              new Vector3(0f, 0f, 0f),
              new Vector3(0f, 0f, 8f));
            break;
            }
        }