LogChannel() private méthode

private LogChannel ( UnityEngine context, string channel, string message ) : void
context UnityEngine
channel string
message string
Résultat void
Exemple #1
0
        private async void Answers_onRequest(IRequest request)
        {
            if (game.answers == null)
            {
                return;
            }
            await Task.Delay(1000);

            switch (request)
            {
            case InitReplaceRequest _:
                _ = game.answers.answer(player.id, new InitReplaceResponse()
                {
                    cardsId = new int[0]
                });
                break;

            case FreeActRequest _:
                _ = game.answers.answer(player.id, calcNextAction(game, player));
                break;

            default:
                UberDebug.LogChannel("AI", "AI未处理的询问:" + request);
                break;
            }
        }
Exemple #2
0
        public static int GetEncounterCR()
        {
            var blueprint =
                Utilities.GetBlueprint <BlueprintStatProgression>(
                    "Assets/Mechanics/Blueprints/Classes/Basic/CRTable.asset");

            if (!(bool)(UnityEngine.Object)blueprint)
            {
                blueprint = Utilities.GetBlueprint <BlueprintStatProgression>("19b09eaa18b203645b6f1d5f2edcb1e4");
            }
            if ((bool)(UnityEngine.Object)blueprint)
            {
                return(Utilities.GetTotalChallengeRating(Game.Instance.State.Units.Where <UnitEntityData>(
                                                             (Func <UnitEntityData, bool>)(u =>
                {
                    if (u.IsInCombat)
                    {
                        return !u.IsPlayerFaction;
                    }
                    return false;
                })).Select <UnitEntityData, BlueprintUnit>(
                                                             (Func <UnitEntityData, BlueprintUnit>)(u => u.Blueprint))
                                                         .ToList <BlueprintUnit>()));
            }
            UberDebug.LogChannel("SmartConsole",
                                 string.Format("CR table not found at {0} or {1}, cannot calculate",
                                               (object)"Assets/Mechanics/Blueprints/Classes/Basic/CRTable.asset",
                                               (object)"19b09eaa18b203645b6f1d5f2edcb1e4"), (object[])Array.Empty <object>());
            return(-1);
        }
Exemple #3
0
 public void log(string channel, string msg)
 {
     if (!enable)
     {
         return;
     }
     if (blackList.Contains(channel))
     {
         return;
     }
     if (channel == "Debug")
     {
         UberDebug.Log((string.IsNullOrEmpty(name) ? null : (name + ":")) + msg);
     }
     else if (channel == "Warning")
     {
         UberDebug.LogWarning((string.IsNullOrEmpty(name) ? null : (name + ":")) + msg);
     }
     else if (channel == "Error")
     {
         UberDebug.LogError((string.IsNullOrEmpty(name) ? null : (name + ":")) + msg);
     }
     else
     {
         UberDebug.LogChannel(channel, (string.IsNullOrEmpty(name) ? null : (name + ":")) + msg);
     }
 }
Exemple #4
0
    private void Start()
    {
        collectables = new Collectables();
        Debug.Assert(collectables != null);
        collectables._grade    = MagicGrade.Diamond;
        collectables._duration = BonusDuration.Instant;

        UberDebug.LogChannel("Collectable", "Launch");
    }
        private void onRecvAction(object sender, EventArgs args, GenericAction callback)
        {
            if (args is OnAttackEventArgs)
            {
                var arg = args as OnAttackEventArgs;
                UberDebug.LogChannel(this, "Frontend", "ServantView收到攻击事件");
                callback += (a, b) => { UberDebug.LogChannel("Frontend", "ServantAttack动画播放完毕"); };

                var targetServant = cardVM.Board.Deck.GetCardByRID(arg.TargetRID);
                if (targetServant != null)
                {
                    ObjectPositionEventArgs target;
                    if (targetServant is CharacterInfoViewModel)
                    {
                        target = new SpecialCardPositionEventArgs(SpecialCardPositionEventArgs.CardType.MasterCard, !cardVM.Board.IsSelf);
                    }
                    else
                    {
                        target = new CardPositionEventArgs(cardVM.Board.ServantCount, cardVM.Index, !cardVM.Board.IsSelf);
                    }
                    PlayAnimation("ServantAttack", new ServantAttackEventArgs(
                                      new CardPositionEventArgs(cardVM.Board.ServantCount, cardVM.Index, cardVM.Board.IsSelf),
                                      target)
                                  , callback);
                }
                else
                {
                    throw new NullReferenceException($"没有找到rid为{arg.TargetRID}的卡");
                }
            }

            if (args is IndexChangeEventArgs && drawed)
            {
                var arg = args as IndexChangeEventArgs;
                PlayAnimation(this, new CardAnimationEventArgs()
                {
                    AnimationName = "RetinueMove",
                    EventArgs     = new CardPositionEventArgs(arg.Count > 0 ? arg.Count : cardVM.Board.ServantCount, arg.Index, cardVM.Board.IsSelf)
                }, callback);
            }

            if (args is RetinueSummonEventArgs)
            {
                callback += (a, b) => { drawed = true; };
                var arg = args as RetinueSummonEventArgs;
                PlayAnimation(this, new CardAnimationEventArgs()
                {
                    AnimationName = "RetinueSummon",
                    EventArgs     = new CardPositionEventArgs(cardVM.Board.ServantCount, cardVM.Index, cardVM.Board.IsSelf)
                }, callback);
            }

            if (args is CardAnimationEventArgs)
            {
                PlayAnimation(this, args, callback);
            }
        }
Exemple #6
0
 public static int GetEncounterCR()
 {
     if ((bool)((SerializedScriptableObject)BlueprintRoot.Instance.Progression.CRTable))
     {
         return(Utilities.GetTotalChallengeRating(Game.Instance.State.Units.Where <UnitEntityData>((Func <UnitEntityData, bool>)(u =>
         {
             if (u.IsInCombat)
             {
                 return !u.IsPlayerFaction;
             }
             return false;
         })).Select <UnitEntityData, BlueprintUnit>((Func <UnitEntityData, BlueprintUnit>)(u => u.Blueprint)).ToList <BlueprintUnit>()));
     }
     UberDebug.LogChannel("SmartConsole", "CR table not found at Assets/Mechanics/Blueprints/Classes/Basic/CRTable.asset or 19b09eaa18b203645b6f1d5f2edcb1e4, cannot calculate", (object[])Array.Empty <object>());
     return(-1);
 }
Exemple #7
0
        /// <summary>
        /// 创建一张手牌
        /// </summary>
        /// <param name="card"></param>
        /// <param name="position">默认为-1也就是最右手</param>
        /// <returns></returns>
        public HandListItem createHand(TouhouCardEngine.Card card, int position = -1)
        {
            if (cardHandDic.ContainsKey(card))
            {
                if (cardHandDic[card] != null)
                {
                    UberDebug.LogErrorChannel("UI", "手牌中已经存在" + card + "对应UI" + cardHandDic[card]);
                    return(cardHandDic[card]);
                }
                else
                {
                    cardHandDic[card] = null;
                }
            }
            UberDebug.LogChannel("UI", "创建手牌UI:" + card);
            HandListItem item;

            if (card.getOwner() == player)
            {
                item = ui.SelfHandList.addItem();
                if (position >= 0)
                {
                    ui.SelfHandList.defaultItem.rectTransform.SetAsFirstSibling();
                    item.rectTransform.SetSiblingIndex(position + 1);
                }
                item.isDragable = true;
                setCard(item.Card, card, true);
            }
            else
            {
                item = ui.EnemyHandList.addItem();
                if (position >= 0)
                {
                    ui.EnemyHandList.defaultItem.rectTransform.SetAsFirstSibling();
                    item.rectTransform.SetSiblingIndex(position + 1);
                }
                item.isDragable = false;
                setCard(item.Card, card, false);
            }
            item.gameObject.name = card.ToString();
            item.onDrag.set(onDragHand);
            item.onEndDrag.set(onDragHandEnd);
            cardHandDic.Add(card, item);
            return(item);
        }
    private void PostRequestSucceeded(UnityWebRequest request)
    {
        if (failuresSinceLastSuccessfulPost != 0)
        {
            UberDebug.LogChannel(StackdriverChannel, "HTTP Post to backend API successful, following previous failure(s).");
            failuresSinceLastSuccessfulPost = 0;
        }

        retryCounter = 0;

        lock (stackdriverEntries)
        {
            // In-flight messages have been successfully transmitted. We no longer need to keep them around on the client.
            stackdriverEntriesInFlight.entries.Clear();
        }

        postInProgress = false;
    }
Exemple #9
0
    void TryJump()
    {
        UberDebug.LogChannel("Player", "In Try Jump");

        Ray[] rays = new Ray[4];
        rays[0] = new Ray(transform.position + new Vector3(0.5f, 0, 0.5f), Vector3.down);
        rays[1] = new Ray(transform.position + new Vector3(-0.5f, 0, 0.5f), Vector3.down);
        rays[2] = new Ray(transform.position + new Vector3(0.5f, 0, -0.5f), Vector3.down);
        rays[3] = new Ray(transform.position + new Vector3(-0.5f, 0, -0.5f), Vector3.down);

        foreach (Ray ray in rays)
        {
            if (Physics.Raycast(ray, 0.7f))
            {
                rig.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);
                break;
            }
        }
    }
Exemple #10
0
 public void OnTrackableStateChanged(TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus)
 {
     if (newStatus == TrackableBehaviour.Status.DETECTED ||
         newStatus == TrackableBehaviour.Status.TRACKED ||
         newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
     {
         UberDebug.LogChannel("inventory", "Inventory opened");
         OnOpen();
     }
     else if (previousStatus == TrackableBehaviour.Status.TRACKED &&
              newStatus == TrackableBehaviour.Status.NOT_FOUND)
     {
         UberDebug.LogChannel("inventory", "Inventory closed");
         OnClose();
     }
     else
     {
         OnClose();
     }
 }
Exemple #11
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("Standard log operation");

        UberDebug.LogChannel(LogChannels.TestChannel1, "Log message to TestChannel1");
        UberDebug.LogChannel(LogChannels.TestChannel2, "Log message to TestChannel2");
        UberDebug.LogChannel(LogChannels.TestChannel3, "Log message to TestChannel3");
        UberDebug.LogChannel(LogChannels.TestChannel4, "Log message to TestChannel4");
        UberDebug.LogChannel(LogChannels.TestChannel5, "Log message to TestChannel5");
        UberDebug.LogWarningChannel(LogChannels.TestChannel1, "Log warning to TestChannel1");
        UberDebug.LogWarningChannel(LogChannels.TestChannel2, "Log warning to TestChannel2");
        UberDebug.LogWarningChannel(LogChannels.TestChannel3, "Log warning to TestChannel3");
        UberDebug.LogWarningChannel(LogChannels.TestChannel4, "Log warning to TestChannel4");
        UberDebug.LogWarningChannel(LogChannels.TestChannel5, "Log warning to TestChannel5");
        UberDebug.LogErrorChannel(LogChannels.TestChannel1, "Log error to TestChannel1");
        UberDebug.LogErrorChannel(LogChannels.TestChannel2, "Log error to TestChannel2");
        UberDebug.LogErrorChannel(LogChannels.TestChannel3, "Log error to TestChannel3");
        UberDebug.LogErrorChannel(LogChannels.TestChannel4, "Log error to TestChannel4");
        UberDebug.LogErrorChannel(LogChannels.TestChannel5, "Log error to TestChannel5");
    }
 public void OnTrackableStateChanged(TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus)
 {
     if (newStatus == TrackableBehaviour.Status.DETECTED ||
         newStatus == TrackableBehaviour.Status.TRACKED ||
         newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
     {
         UberDebug.LogChannel("spawn", "Enemies engaged");
         OnEngage();
     }
     else if (previousStatus == TrackableBehaviour.Status.TRACKED &&
              newStatus == TrackableBehaviour.Status.NOT_FOUND)
     {
         UberDebug.LogChannel("spawn", "Enemies disengaged");
         OnDisengage();
     }
     else
     {
         OnDisengage();
     }
 }
    public void DoTest()
    {
        // UnityEngine.Debug.Log("Starting");
        Debug.LogWarning("Log Warning with GameObject", gameObject);
        Debug.LogError("Log Error with GameObject", gameObject);
        Debug.Log("Log Message with GameObject", gameObject);
        Debug.LogFormat("Log Format param {0}", "Test");
        Debug.LogFormat(gameObject, "Log Format with GameObject and param {0}", "Test");

        UberDebug.Log("ULog");
        UberDebug.Log("ULog with param {0}", "Test");
        UberDebug.Log(gameObject, "ULog with GameObject");
        UberDebug.Log(gameObject, "ULog with GameObject and param {0}", "Test");

        UberDebug.LogChannel("Test", "ULogChannel");
        UberDebug.LogChannel("Test", "ULogChannel with param {0}", "Test");
        UberDebug.LogChannel(gameObject, "Test", "ULogChannel with GameObject");
        UberDebug.LogChannel(gameObject, "Test", "ULogChannel with GameObject and param {0}", "Test");

        UberDebug.LogWarning("ULogWarning");
        UberDebug.LogWarning("ULogWarning with param {0}", "Test");
        UberDebug.LogWarning(gameObject, "ULogWarning with GameObject");
        UberDebug.LogWarning(gameObject, "ULogWarning with GameObject and param {0}", "Test");

        UberDebug.LogWarningChannel("Test", "ULogWarningChannel");
        UberDebug.LogWarningChannel("Test", "ULogWarningChannel with param {0}", "Test");
        UberDebug.LogWarningChannel(gameObject, "Test", "ULogWarningChannel with GameObject");
        UberDebug.LogWarningChannel(gameObject, "Test", "ULogWarningChannel with GameObject and param {0}", "Test");

        UberDebug.LogError("ULogError");
        UberDebug.LogError("ULogError with param {0}", "Test");
        UberDebug.LogError(gameObject, "ULogError with GameObject");
        UberDebug.LogError(gameObject, "ULogError with GameObject and param {0}", "Test");

        UberDebug.LogErrorChannel("Test", "ULogErrorChannel");
        UberDebug.LogErrorChannel("Test", "ULogErrorChannel with param {0}", "Test");
        UberDebug.LogErrorChannel(gameObject, "Test", "ULogErrorChannel with GameObject");
        UberDebug.LogErrorChannel(gameObject, "Test", "ULogErrorChannel with GameObject and param {0}", "Test");
    }
Exemple #14
0
        private static bool EnsurePortraitImport(string portrait, Sprite baseSprite)
        {
            bool result;

            try
            {
                if (File.Exists(portrait))
                {
                    result = true;
                }
                else
                {
                    CustomPortraitsManager.CreateBaseImages(portrait, baseSprite);
                    result = false;
                }
            }
            catch (Exception ex)
            {
                UberDebug.LogChannel("Disk", "The process failed: " + ex.ToString(), Array.Empty <object>());
                result = false;
            }
            return(result);
        }
 public void log(string channel, string msg)
 {
     if (!enable)
     {
         return;
     }
     if (channel == "Debug")
     {
         UberDebug.Log(msg);
     }
     else if (channel == "Warning")
     {
         UberDebug.LogWarning(msg);
     }
     else if (channel == "Error")
     {
         UberDebug.LogError(msg);
     }
     else
     {
         UberDebug.LogChannel(channel, msg);
     }
 }
Exemple #16
0
 public static void Log(string message, UnityEngine.Object context = null)
 {
     UberDebug.LogChannel("Frontend", message, context);
 }
 public static void logChannel(string channel, string message, params object[] par)
 {
     UberDebug.LogChannel(channel, preprocessMessage(message), par);
 }
Exemple #18
0
    //public ArrayList arrayList;

    public Collectables() : base()
    {
        UberDebug.LogChannel("Collectable", "Collectables");
    }
 public static void logChannel(UnityEngine.Object context, string channel, string message, params object[] par)
 {
     UberDebug.LogChannel(context, channel, preprocessMessage(message), par);
 }
Exemple #20
0
 public Bonus()
 {
     UberDebug.LogChannel("Collectable", "Bonus constructor");
 }