public void Execute_UndoLogic_NotCoroutine(MonoBehaviour pManager, ICanvas pCanvas, EDebugLevelFlags eDebugFlags)
            {
                if (mapShowObject.ContainsKey(pCanvas) == false)
                {
                    return;
                }

                T pObject = mapShowObject[pCanvas];

                mapShowObject.Remove(pCanvas);
                if (pObject.IsNull())
                {
                    return;
                }

                if ((eDebugFlags & EDebugLevelFlags.ManagerLogic) != 0)
                {
                    Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.ManagerLogic)}" + nameof(Show_UIWidget_Managed <T>) + " Canvas : " + pCanvas.GetObjectName_Safe() + " " + nameof(Execute_UndoLogic_NotCoroutine) + " Start");
                }

                var pHandle = pObject.DoHide();

                if (pHandle == null)
                {
                    Debug.LogWarning($"{UIDebug.LogFormat(EDebugLevelFlags.ManagerLogic)}" + "Execute_UndoLogicCoroutine - pHandle == null");
                    return;
                }
                pHandle.Set_OnHide((pPopup) => _bWaitAnimation = false);
                OnHideObject(pObject);

                if ((eDebugFlags & EDebugLevelFlags.ManagerLogic) != 0)
                {
                    Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.ManagerLogic)}" + nameof(Show_UIWidget_Managed <T>) + " Canvas : " + pCanvas.gameObject.name + " " + nameof(Execute_UndoLogic_NotCoroutine) + " Finish");
                }
            }
            public IEnumerator Execute_LogicCoroutine(MonoBehaviour pManager, ICanvas pCanvas, EDebugLevelFlags eDebugFlags)
            {
                if (OnRequireObject == null || pObject == null)
                {
                    Debug.LogError("Error");
                    yield break;
                }

                if (mapShowObject.ContainsKey(pCanvas))
                {
                    yield break;
                }


                GameObject pObjectCopy = OnRequireObject(pObject, pCanvas);

                pObjectCopy.SetActive(true);

                mapShowObject.Add(pCanvas, pObjectCopy);

                if ((eDebugFlags & EDebugLevelFlags.ManagerLogic) != 0)
                {
                    Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.ManagerLogic)}{nameof(Show_Object)} Canvas {pCanvas.gameObject.name} {nameof(Execute_LogicCoroutine)} Finish");
                }
            }
예제 #3
0
 // Use this for initialization
 void Start()
 {
     try{
         uiDebug         = GameObject.Find("Canvas").GetComponentInChildren <UIDebug>();
         playerTransform = GameObject.Find("Player").GetComponentInChildren <Transform>();
     }catch {
     }
 }
예제 #4
0
    /// <summary>
    /// Ensure we have an instance present.
    /// </summary>

    static public void CreateInstance()
    {
        if (mInstance == null)
        {
            GameObject go = new GameObject("UIDebug");
            mInstance = go.AddComponent <UIDebug>();
            //DontDestroyOnLoad(go);
        }
    }
예제 #5
0
파일: DebugObserver.cs 프로젝트: oathx/Six
	/// <summary>
	/// Awake this instance.
	/// </summary>
	void Awake()
	{
		DebugUI = UISystem.GetSingleton().LoadWidget<UIDebug>(ResourceDef.UI_DEBUG, false);
		if (!DebugUI)
			throw new System.NullReferenceException();

		Application.RegisterLogCallback (OnLogCallback);

		// subscribe loigc gm cmd evnet
		SubscribeEvent (CmdEvent.CMD_DEBUG, OnExecuteCmd);
	}
            public IEnumerator Execute_LogicCoroutine(MonoBehaviour pManager, ICanvas pCanvas, EDebugLevelFlags eDebugFlags)
            {
                if (pCanvas.IsNull())
                {
                    Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.Manager_Core)}{nameof(Print_CanvasState)} Object is Null /// CanvasState : {_eState}");
                }
                else
                {
                    Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.Manager_Core)}{nameof(Print_CanvasState)} {pCanvas.gameObject.name} /// CanvasState : {_eState}", pCanvas.gameObject);
                }

                yield break;
            }
예제 #7
0
        public int GetClassPowerLevelNew(bool isMulticlassed, int characterLevel)
        {
            if (!ConfigHasBeenInit)
            {
                ConfigHasBeenInit = true;
                UseMod            = UserConfig.GetValueAsBool("MulticlassPenaltyRemover", "enableMod");
            }

            if (UseMod)
            {
                // this is literally the only required changed line
                isMulticlassed = false;
            }

            int charLevelAsIndex = characterLevel - 1;

            if (charLevelAsIndex < 0)
            {
                return(0);
            }
            if (isMulticlassed)
            {
                if (charLevelAsIndex >= this.MultiClassPowerLevelByCharacterLevel.Count)
                {
                    UIDebug.LogOnScreenWarning(string.Concat(new object[]
                    {
                        "Multi Class Power Level By Character Level list only has ",
                        this.MultiClassPowerLevelByCharacterLevel.Count,
                        " entries. Trying to lookup character with class level: ",
                        characterLevel
                    }), UIDebug.Department.Design, 10f);
                    return(this.MultiClassPowerLevelByCharacterLevel[this.MultiClassPowerLevelByCharacterLevel.Count - 1]);
                }
                return(this.MultiClassPowerLevelByCharacterLevel[charLevelAsIndex]);
            }
            else
            {
                if (charLevelAsIndex >= this.SingleClassPowerLevelByCharacterLevel.Count)
                {
                    UIDebug.LogOnScreenWarning(string.Concat(new object[]
                    {
                        "Single Class Power Level By Character Level list only has ",
                        this.SingleClassPowerLevelByCharacterLevel.Count,
                        " entries. Trying to lookup character with class level: ",
                        characterLevel
                    }), UIDebug.Department.Design, 10f);
                    return(this.SingleClassPowerLevelByCharacterLevel[this.MultiClassPowerLevelByCharacterLevel.Count - 1]);
                }
                return(this.SingleClassPowerLevelByCharacterLevel[charLevelAsIndex]);
            }
        }
예제 #8
0
    /// <summary>
    /// Add a new on-screen log entry.
    /// </summary>

    static void LogString(string text)
    {
        if (Application.isPlaying)
        {
            if (mLines.Count > 20)
            {
                mLines.RemoveAt(0);
            }
            mLines.Add(text);
            CreateInstance();
        }
        else
        {
            UIDebug.Log(text);
        }
    }
            public IEnumerator Execute_LogicCoroutine(MonoBehaviour pManager, ICanvas pCanvas, EDebugLevelFlags eDebugFlags)
            {
                if (OnRequireObject == null || pObject == null)
                {
                    Debug.LogError("Error");
                    yield break;
                }

                if (mapShowObject.ContainsKey(pCanvas))
                {
                    yield break;
                }


                T pObjectCopy = OnRequireObject(pObject, pCanvas);

                if (pObjectCopy.IsNull())
                {
                    yield break;
                }

                if ((eDebugFlags & EDebugLevelFlags.ManagerLogic) != 0)
                {
                    Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.ManagerLogic)}" + nameof(Show_UIWidget_Managed <T>) + " Canvas : " + pCanvas.GetObjectName_Safe() + " " + nameof(Execute_LogicCoroutine) + " Start");
                }

                mapShowObject.Add(pCanvas, pObjectCopy);

                _bWaitAnimation = _eOption == EOption.WaitAnimation;
                var pHandle = pObjectCopy.DoShow();

                if (pHandle == null)
                {
                    yield break;
                }
                pHandle.Set_OnShow_AfterAnimation((pPopup) => _bWaitAnimation = false);

                while (_bWaitAnimation)
                {
                    yield return(null);
                }

                if ((eDebugFlags & EDebugLevelFlags.ManagerLogic) != 0)
                {
                    Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.ManagerLogic)}" + nameof(Show_UIWidget_Managed <T>) + " Canvas : " + pCanvas.GetObjectName_Safe() + " " + nameof(Execute_LogicCoroutine) + " Finish");
                }
            }
            public IEnumerator Execute_UndoLogic_Coroutine(MonoBehaviour pManager, ICanvas pCanvas, EDebugLevelFlags eDebugFlags)
            {
                if (mapShowObject.ContainsKey(pCanvas) == false)
                {
                    yield break;
                }

                T pObject = mapShowObject[pCanvas];

                mapShowObject.Remove(pCanvas);
                if (pObject.IsNull())
                {
                    yield break;
                }

                if ((eDebugFlags & EDebugLevelFlags.ManagerLogic) != 0)
                {
                    Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.ManagerLogic)}{nameof(Show_UIWidget_Managed<T>)}/{nameof(Execute_UndoLogic_Coroutine)} // Canvas : {pCanvas.GetObjectName_Safe()} Start");
                }

                var pHandle = pObject.DoHide();

                if (pHandle == null)
                {
                    Debug.LogWarning($"{nameof(Execute_UndoLogic_Coroutine)} // Canvas : {pCanvas.GetObjectName_Safe()} - pHandle == null");
                    yield break;
                }
                pHandle.Set_OnHide((pPopup) => _bWaitAnimation = false);

                _bWaitAnimation = _eOption == EOption.WaitAnimation;
                while (_bWaitAnimation)
                {
                    yield return(null);
                }

                OnHideObject(pObject);

                if ((eDebugFlags & EDebugLevelFlags.ManagerLogic) != 0)
                {
                    Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.ManagerLogic)}{nameof(Show_UIWidget_Managed<T>)}/{nameof(Execute_UndoLogic_Coroutine)} // Canvas : {pCanvas.GetObjectName_Safe()} Finish");
                }
            }
        public static void CompanionAddRelationshipNew(Guid sourceGuid, Guid targetGuid, Axis axis, Guid strengthGuid, bool onlyInParty)
        {
            Guid strengthOverrideGuid = CompanionStrengthOverrides.First(x => x.Key == strengthGuid).Value;
            ChangeStrengthGameData strengthOverride = Scripts.GetGameDataByGuid <ChangeStrengthGameData>(strengthOverrideGuid);

            sourceGuid = InstanceID.GetObjectID(sourceGuid);
            targetGuid = InstanceID.GetObjectID(targetGuid);

            Guid guid = GameState.PlayerCharacter.GetComponent <InstanceID>().Guid;

            if (onlyInParty && (!SingletonBehavior <PartyManager> .Instance.IsActivePartyMember(sourceGuid) || !SingletonBehavior <PartyManager> .Instance.IsActivePartyMember(targetGuid)))
            {
                return;
            }

            if (sourceGuid == SpecialCharacterInstanceID.PlayerGuid || sourceGuid == guid)
            {
                Debug.LogError("Cannot change the player's relationship towards a companion");
                UIDebug.LogOnScreenWarning("Script is trying to use Player's guid as SourceGuid for CompanionAddRelationship", UIDebug.Department.Design, 10f);
            }
            else if (targetGuid == SpecialCharacterInstanceID.PlayerGuid || targetGuid == guid)
            {
                CompanionGameData sourceCompanion = CompanionManager.GetCompanionData(sourceGuid);
                SingletonBehavior <PartyManager> .Instance.AddPlayerRelationship(sourceCompanion, strengthOverride.ChangeValue, axis);
            }
            else
            {
                CompanionGameData sourceCompanion = CompanionManager.GetCompanionData(sourceGuid);
                CompanionGameData targetCompanion = CompanionManager.GetCompanionData(targetGuid);

                if (sourceCompanion == null || targetCompanion == null)
                {
                    Debug.LogError($"Null companion data being used for guid: {((!(sourceCompanion == null)) ? targetGuid : sourceGuid)}");
                }
                else
                {
                    SingletonBehavior <PartyManager> .Instance.AddRelationship(sourceCompanion, targetCompanion, strengthOverride.ChangeValue, axis);
                }
            }
        }
예제 #12
0
    public bool Load()
    {
        if (_prefab != null)
        {
            return(true);
        }

        if (!PoolManager.Pools.ContainsKey("Common2dRes"))
        {
            Debug.LogError("No Common2dRes Prefab Loaded!!!");
            return(false);
        }
        //
        //
        _spawnPool = PoolManager.Pools["Common2dRes"];
        if (!_spawnPool.prefabs.ContainsKey("Canvas_Debug"))
        {
            Debug.LogError("No find Prefab Canvas_Debug!!!");
            return(false);
        }
        _prefab = _spawnPool.Spawn("Canvas_Debug");
        //
        //
        _view = _prefab.GetComponent <UIDebug>();
        Close();
        return(true);

        /*if (GameObject.Find("Canvas_Debug") == null)
         * {
         *  Debug.Log("GameObject.Find(Canvas_Debug) = null");
         *  return false;
         * }
         * else
         * {
         *  _view = GameObject.Find("Canvas_Debug").GetComponent<UIDebug>();
         *  return true;
         * }*/
    }
            public IEnumerator Execute_UndoLogic_Coroutine(MonoBehaviour pManager, ICanvas pCanvas, EDebugLevelFlags eDebugFlags)
            {
                if ((eDebugFlags & EDebugLevelFlags.ManagerLogic) != 0)
                {
                    Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.ManagerLogic)} {nameof(Lock_AllInput)} {nameof(Execute_UndoLogic_Coroutine)} Prepare Canvas : {pCanvas.GetObjectName_Safe()}");
                }

                if (_OnCheck_IsExecute(pCanvas) == false)
                {
                    yield break;
                }

                if (pCanvas.IsNull())
                {
                    yield break;
                }

                if (_mapSelectAble.ContainsKey(pCanvas) == false)
                {
                    yield break;
                }

                List <SelectAble_OriginState> listSelectAble = _mapSelectAble[pCanvas];

                _mapSelectAble.Remove(pCanvas);
                if (listSelectAble == null)
                {
                    yield break;
                }

                if ((eDebugFlags & EDebugLevelFlags.ManagerLogic) != 0)
                {
                    Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.ManagerLogic)}" + nameof(Lock_AllInput) + " Start Canvas : " + pCanvas.GetObjectName_Safe() + " " + nameof(Execute_UndoLogic_Coroutine) + " 1");
                }

                if ((eDebugFlags & EDebugLevelFlags.Detail) != 0)
                {
                    for (int i = 0; i < listSelectAble.Count; i++)
                    {
                        if (listSelectAble[i].pSelectAble != null)
                        {
                            Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.ManagerLogic)}" + nameof(Lock_AllInput) + " Canvas : " + pCanvas.gameObject.name + " - " + listSelectAble[i].pSelectAble.name + " Enable : " + listSelectAble[i].bEnableOrigin, listSelectAble[i].pSelectAble);
                            listSelectAble[i].pSelectAble.enabled = listSelectAble[i].bEnableOrigin;
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < listSelectAble.Count; i++)
                    {
                        if (listSelectAble[i].pSelectAble != null)
                        {
                            listSelectAble[i].pSelectAble.enabled = listSelectAble[i].bEnableOrigin;
                        }
                    }
                }

                if ((eDebugFlags & EDebugLevelFlags.ManagerLogic) != 0)
                {
                    Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.ManagerLogic)}" + nameof(Lock_AllInput) + " Finish Canvas : " + pCanvas.gameObject.name + " " + nameof(Execute_UndoLogic_Coroutine) + " 2");
                }

                yield break;
            }
            public IEnumerator Execute_LogicCoroutine(MonoBehaviour pManager, ICanvas pCanvas, EDebugLevelFlags eDebugFlags)
            {
                if ((eDebugFlags & EDebugLevelFlags.ManagerLogic) != 0)
                {
                    Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.ManagerLogic)}{nameof(Lock_AllInput)} Prepare Canvas : {pCanvas.GetObjectName_Safe()} + {nameof(Execute_LogicCoroutine)}");
                }

                if (_OnCheck_IsExecute(pCanvas) == false)
                {
                    yield break;
                }

                if (pCanvas.IsNull())
                {
                    yield break;
                }


                if ((eDebugFlags & EDebugLevelFlags.ManagerLogic) != 0)
                {
                    Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.ManagerLogic)}{nameof(Lock_AllInput)} Start Canvas : {pCanvas.GetObjectName_Safe()} {nameof(Execute_LogicCoroutine)}");
                }

                if (_mapSelectAble.ContainsKey(pCanvas) == false)
                {
                    List <SelectAble_OriginState> listSelectAbleNew = new List <SelectAble_OriginState>();
                    _mapSelectAble.Add(pCanvas, listSelectAbleNew);

                    Selectable[] arrSelectAble = pCanvas.gameObject.GetComponentsInChildren <Selectable>(true);
                    for (int i = 0; i < arrSelectAble.Length; i++)
                    {
                        listSelectAbleNew.Add(new SelectAble_OriginState(arrSelectAble[i]));
                    }
                }


                List <SelectAble_OriginState> listSelectAble = _mapSelectAble[pCanvas];

                if ((eDebugFlags & EDebugLevelFlags.Detail) != 0)
                {
                    for (int i = 0; i < listSelectAble.Count; i++)
                    {
                        if (listSelectAble[i].pSelectAble != null)
                        {
                            listSelectAble[i].pSelectAble.enabled = false;
                            Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.ManagerLogic)}" + nameof(Lock_AllInput) + " Canvas : " + pCanvas.gameObject.name + " - " + listSelectAble[i].pSelectAble.name + " Enable False", listSelectAble[i].pSelectAble);
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < listSelectAble.Count; i++)
                    {
                        if (listSelectAble[i].pSelectAble != null)
                        {
                            listSelectAble[i].pSelectAble.enabled = false;
                        }
                    }
                }

                if ((eDebugFlags & EDebugLevelFlags.ManagerLogic) != 0)
                {
                    Debug.Log($"{UIDebug.LogFormat(EDebugLevelFlags.ManagerLogic)}{nameof(Lock_AllInput)} Finish Canvas : {pCanvas.GetObjectName_Safe()} + {nameof(Execute_LogicCoroutine)}");
                }

                yield break;
            }
예제 #15
0
 private void Awake()
 {
     instance = this;
     UpdateLogMessageTextComponent();
 }
예제 #16
0
파일: Util.cs 프로젝트: tallitia/YYScript
 public static void LogUI(string str)
 {
     UIDebug.Log(str);
 }