Ejemplo n.º 1
0
    private void Awake()
    {
        Assert(instance == null);
        instance = this;
        logMode  = this.cfgMode;
        int num = 8;

        for (int i = 0; i < num; i++)
        {
            s_logers[i] = new SLogObj();
        }
    }
Ejemplo n.º 2
0
    private void Awake()
    {
        Assert(instance == null);
        instance = this;
        logMode  = this.cfgMode;
        int num = 4;

        for (int i = 0; i < num; i++)
        {
            s_logers[i] = new SLogObj();
        }
        OpenLoger(SLogCategory.Normal, string.Format("{0}/sgame_log.txt", Application.persistentDataPath));
        OpenLoger(SLogCategory.Skill, string.Format("{0}/sgame_skill.txt", Application.persistentDataPath));
        OpenLoger(SLogCategory.Misc, string.Format("{0}/sgame_misc.txt", Application.persistentDataPath));
    }
Ejemplo n.º 3
0
    public static void LogRvo()
    {
        SLogObj loger = DebugHelper.GetLoger(SLogCategory.Rvo);

        if ((loger != null) && Singleton <FrameSynchr> .instance.bActive)
        {
            List <Agent> agents = RVOSimulator.Instance.GetSimulator().agents;
            loger.Log(string.Format("FrameNum: {0}", Singleton <FrameSynchr> .GetInstance().CurFrameNum));
            for (int i = 0; i < agents.Count; i++)
            {
                Agent         agent   = agents[i];
                GameObject    owner   = agent.owner as GameObject;
                StringBuilder builder = new StringBuilder();
                builder.Append((owner == null) ? "<null>" : owner.name);
                builder.Append("   ");
                builder.Append(" smoothPos:");
                builder.Append(agent.InterpolatedPosition.ToString());
                builder.Append(" prevSmoothPos:");
                builder.Append(agent.prevSmoothPos.ToString());
                builder.Append(" position:");
                builder.Append(agent.position.ToString());
                builder.Append(" desiredVelocity:");
                builder.Append(agent.desiredVelocity.ToString());
                builder.Append(" Velocity:");
                builder.Append(agent.Velocity.ToString());
                builder.Append(" velocity:");
                builder.Append(agent.velocity.ToString());
                builder.Append(" newVelocity:");
                builder.Append(agent.newVelocity.ToString());
                if (agent.neighbours.Count > 0)
                {
                    builder.Append(" neighbours:");
                    for (int j = 0; j < agent.neighbours.Count; j++)
                    {
                        Agent agent2 = agent.neighbours[j];
                        builder.Append((agent2.owner as GameObject).name);
                        builder.Append("=");
                        builder.Append(agent.neighbourDists[j]);
                        builder.Append(";");
                    }
                }
                loger.Log(builder.ToString());
            }
            loger.Log("\n\n");
        }
    }
Ejemplo n.º 4
0
 public override void ActorStateLog(SLogObj _logObj)
 {
     _logObj.Log(string.Format("{0} pos={1}", base.actor.name, base.actor.location));
 }