Esempio n. 1
0
        public static void AddAsDependency(CustomConfiguration conf, CustomTarget target)
        {
            var rootPath = Constants.ThirdPartyPath + @"SFML-2.5.1\";

            //Include
            conf.IncludePrivatePaths.Add(rootPath + @"include");

            //Lib files
            conf.LibraryPaths.Add(rootPath + @"x64\lib");
            var suffix = target.Optimization == Optimization.Debug ? "-d" : "";

            conf.LibraryFiles.Add(
                @"sfml-audio" + suffix,
                @"sfml-graphics" + suffix,
                @"sfml-network" + suffix,
                @"sfml-system" + suffix,
                @"sfml-window" + suffix
                );

            //Dll files
            conf.TargetCopyFiles.Add(
                rootPath + @"x64\bin\sfml-audio" + suffix + @"-2.dll",
                rootPath + @"x64\bin\sfml-graphics" + suffix + @"-2.dll",
                rootPath + @"x64\bin\sfml-network" + suffix + @"-2.dll",
                rootPath + @"x64\bin\sfml-system" + suffix + @"-2.dll",
                rootPath + @"x64\bin\sfml-window" + suffix + @"-2.dll"
                );
        }
Esempio n. 2
0
        public virtual void Configure(CustomConfiguration conf, CustomTarget target)
        {
            conf.ProjectPath      = Constants.ProjectPath;
            conf.TargetPath       = Constants.OutputPath + @"[target.Name]";
            conf.IntermediatePath = Constants.IntermediatePath + @"[target.Name]\[project.Name]";

            //
            conf.IncludePaths.Add(Constants.CodePath);

            //
            conf.DisableExceptions();
            conf.Options.Add(Options.Vc.Compiler.CppLanguageStandard.CPP17);
            conf.Options.Add(Options.Vc.Compiler.RTTI.Disable);

            switch (target.Optimization)
            {
            case Optimization.Debug:
                conf.Options.Add(Options.Vc.Compiler.Optimization.Disable);
                break;

            case Optimization.Release:
            case Optimization.Retail:
                conf.Options.Add(Options.Vc.Compiler.Optimization.MaximizeSpeed);
                break;
            }
        }
Esempio n. 3
0
        public override void Configure(CustomConfiguration conf, CustomTarget target)
        {
            base.Configure(conf, target);
            conf.SetLib();

            conf.IncludePaths.Add("include");
        }
Esempio n. 4
0
        public override void Configure(CustomConfiguration conf, CustomTarget target)
        {
            base.Configure(conf, target);
            conf.SetLib();

            //Settings
            conf.IncludePaths.Add(SourceRootPath);
        }
Esempio n. 5
0
 protected override void OnEnable()
 {
     if (Owner.CompareTag("Player"))
     {
         PlayMakerFSM component = CustomTarget.GetComponent <PlayMakerFSM>();
         component.SendEvent(Event);
     }
 }
Esempio n. 6
0
        public override void Configure(CustomConfiguration conf, CustomTarget target)
        {
            base.Configure(conf, target);
            conf.SetLib();

            conf.Options.Add(Options.Vc.General.WarningLevel.Level0);
            conf.IncludePaths.Add(SourceRootPath);
        }
Esempio n. 7
0
        private List <CustomTarget> UpdateCustomTargets(ChaInfo character)
        {
            var customTargets = new List <CustomTarget>();

            foreach (var data in TargetData.data.customTargets)
            {
                bool targetInUse = TargetData.data.quickTargets.Contains(data.target);

                if (!targetInUse)
                {
                    foreach (var target in TargetData.data.customTargets)
                    {
                        if (target.point1 == data.target || target.point2 == data.target)
                        {
                            targetInUse = true;
                            break;
                        }
                    }
                }

                if (targetInUse)
                {
                    var point1 = character.objBodyBone.transform.FindLoop(data.point1);
                    var point2 = character.objBodyBone.transform.FindLoop(data.point2);

                    foreach (var target in customTargets)
                    {
                        if (target.GetTarget().name == data.point1)
                        {
                            point1 = target.GetTarget();
                        }

                        if (target.GetTarget().name == data.point2)
                        {
                            point2 = target.GetTarget();
                        }
                    }

                    if (point1 && point2)
                    {
                        var target = new CustomTarget(data.target, point1, point2, data.midpoint);
                        target.GetTarget().transform.SetParent(character.transform);
                        customTargets.Add(target);
                    }
                    else
                    {
                        Log.Info($"CustomTarget '{data.target}' failed");
                    }
                }
                else
                {
                    Log.Debug($"CustomTarget '{data.target}' skipped because it is not in use");
                }
            }

            return(customTargets);
        }
Esempio n. 8
0
    static void Main(string[] args)
    {
        // Step 1. Create configuration object
        var config = new LoggingConfiguration();

        // Step 2. Create targets
        string layout        = @"${date:format=yyyy-MM-dd HH\:mm\:ss}|${level}|${event-properties:item=LogType}|${message} ";
        var    consoleTarget = new ColoredConsoleTarget("控制台日志")
        {
            Layout = layout
        };

        config.AddTarget(consoleTarget);
        config.AddRuleForAllLevels(consoleTarget);

        var fileTarget = new FileTarget("控制台日志")
        {
            FileName = $"${{basedir}}/A_logs/{DateTime.Now.ToString("yyyy-MM")}/{DateTime.Now.ToString("yyyy-MM-dd")}.txt",
            Layout   = layout
        };

        config.AddTarget(fileTarget);
        config.AddRuleForAllLevels(fileTarget);

        var customTarget = new CustomTarget("自定义")
        {
            Layout = layout
        };

        config.AddTarget(customTarget);
        config.AddRuleForAllLevels(customTarget);

        LogManager.Configuration = config;
        Logger logger = LogManager.GetLogger("Example");

        LogEventInfo logEventInfo = new LogEventInfo(LogLevel.Error, "测试", "测试");

        logEventInfo.Properties["LogType"] = "日志类型";
        logger.Log(logEventInfo);
        logger.Trace("trace log message");
        logger.Debug("debug log message");
        logger.Info("info log message");
        logger.Warn("warn log message");
        logger.Error("error log message");
        logger.Fatal("fatal log message");
        //Example of logging exceptions
        try
        {
            throw new Exception("1111111111111");
        }
        catch (Exception ex)
        {
            logger.Error(ex, "ow noos!");
            //throw;
        }
    }
Esempio n. 9
0
        public override void Configure(CustomConfiguration conf, CustomTarget target)
        {
            base.Configure(conf, target);
            conf.SetLib();

            //Dependencies
            conf.AddPrivateDependency <ThirdParty.STBImage>(target);

            conf.AddPrivateDependency <Platform>(target);
        }
Esempio n. 10
0
        public override void Configure(CustomConfiguration conf, CustomTarget target)
        {
            base.Configure(conf, target);
            conf.SetLib();

            //Dependencies
            conf.AddPrivateDependency <Glad>(target);

            //Settings
            conf.IncludePaths.Add(SourceRootPath);
        }
Esempio n. 11
0
        public override void Configure(CustomConfiguration conf, CustomTarget target)
        {
            base.Configure(conf, target);
            conf.SetLib();

            //Dependencies
            conf.AddPrivateDependency <ThirdParty.Imgui>(target);

            conf.AddPrivateDependency <AssetManager>(target);
            conf.AddPrivateDependency <Graphics>(target);
            conf.AddPrivateDependency <Platform>(target);
        }
Esempio n. 12
0
        public override void Configure(CustomConfiguration conf, CustomTarget target)
        {
            base.Configure(conf, target);
            conf.SetLib();

            //Dependencies
            conf.AddPrivateDependency <ThirdParty.Glad>(target);
            conf.AddPrivateDependency <ThirdParty.Imgui>(target);

            ThirdParty.OpenGL.AddAsDependency(conf, target);
            ThirdParty.SFML.AddAsDependency(conf, target);
        }
Esempio n. 13
0
        private List <CustomTarget> UpdateCustomTargets(CharInfo character)
        {
            List <CustomTarget> customTargets = new List <CustomTarget>();
            string prefix = character is CharFemale ? "cf_" : "cm_";

            foreach (List <string> data in FileManager.GetCustomTargetNames())
            {
                GameObject point1 = character.chaBody.objBone.transform.FindLoop(prefix + data[1]);
                GameObject point2 = character.chaBody.objBone.transform.FindLoop(prefix + data[2]);

                foreach (CustomTarget target in customTargets)
                {
                    if (target.GetTarget().name == data[1])
                    {
                        point1 = target.GetTarget();
                    }

                    if (target.GetTarget().name == data[2])
                    {
                        point2 = target.GetTarget();
                    }
                }

                if (point1 && point2)
                {
                    float midpoint = 0.5f;
                    if (data.ElementAtOrDefault(3) != null)
                    {
                        if (!float.TryParse(data[3], out midpoint))
                        {
                            midpoint = 0.5f;
                        }
                    }

                    CustomTarget target = new CustomTarget(data[0], point1, point2, midpoint);
                    target.GetTarget().transform.SetParent(character.transform);
                    customTargets.Add(target);
                }
            }

            return(customTargets);
        }
Esempio n. 14
0
 public static void AddAsDependency(CustomConfiguration conf, CustomTarget target)
 {
     conf.LibraryFiles.Add("opengl32");
 }
Esempio n. 15
0
 public DefaultProject()
     : base(typeof(CustomTarget), typeof(CustomConfiguration))
 {
     AddTargets(CustomTarget.DefaultTargets());
     SourceRootPath = Constants.CodePath + GetType().Name;
 }
Esempio n. 16
0
        public override void Configure(CustomConfiguration conf, CustomTarget target)
        {
            conf.SolutionFolder = "2_Platform";

            base.Configure(conf, target);
        }
Esempio n. 17
0
 public override void Configure(CustomConfiguration conf, CustomTarget target)
 {
     base.Configure(conf, target);
     conf.SetLib();
 }
Esempio n. 18
0
        public override void Configure(CustomConfiguration conf, CustomTarget target)
        {
            conf.SolutionFolder = "1_Global";

            base.Configure(conf, target);
        }
Esempio n. 19
0
        public override void Configure(CustomConfiguration conf, CustomTarget target)
        {
            conf.SolutionFolder = "0_Thirdparty";

            base.Configure(conf, target);
        }