Beispiel #1
0
 /// <summary>
 /// 끄기만 한다.
 /// </summary>
 /// <param name="ui"></param>
 private void DisEnableWindow(UIBase ui)
 {
     if (ui == null)
     {
         return;
     }
     if (dicUI.ContainsKey(ui.Kind))
     {
         dicUI[ui.Kind].SetActive(false);
     }
 }
Beispiel #2
0
        public float GetEvaluate(Membership kind)
        {
            if (dicFuzzyData.ContainsKey(kind))
            {
                return(dicFuzzyData[kind].Evaluate(this.currentValue));
            }
            else
            {
#if UNITY_EDITOR
                Debug.LogWarning("GetEvaluate ContainKey error RetrunValue == 0");
#endif
                return(0);
            }
        }
    // Public Method
    #region Public Method
    public void SetActiveCamera(CameraKind kind)
    {
        var obj = GetCameraObject(kind);

        if (obj != null)
        {
            if (!obj.activeInHierarchy)
            {
                obj.SetActive(true);
                return;
            }
        }
        var data = GetCameraData(kind);

        if (data == null)
        {
#if UNITY_EDITOR
            Debug.LogError(string.Format($"{kind.ToString()} 해당 카메라종류가 발견되지 않았습니다."));
#endif
        }
        else
        {
            var c = Instantiate <GameObject>(data.cameraObject, transform);
            c.SetActive(true);

            if (!dicCameraObjs.ContainsKey(data.kind))
            {
                dicCameraObjs.Add(data.kind, c);
            }
        }
    }
Beispiel #4
0
    // -------------  Behaviour  -------------
    private void Awake()
    {
        dicPoolers = new EnumDictionary <PoolerKind, IPooler>();

        foreach (Poolers pooler in listPoolers)
        {
            if (!dicPoolers.ContainsKey(pooler.kind))
            {
                var iPooler = pooler.objPooler.GetComponent(typeof(IPooler)) as IPooler;
                if (iPooler != null)
                {
                    dicPoolers.Add(pooler.kind, iPooler);
                }
                else
                {
#if UNITY_EDITOR
                    Debug.LogWarning(string.Format($"Can't Find IPooledObject in {pooler.objPooler.name}"));
#endif
                }
            }
            else
            {
#if UNITY_EDITOR
                Debug.LogWarning(string.Format($"{pooler.kind.ToString()} is Exist"));
#endif
            }
        }
    }
Beispiel #5
0
 public IPooler GetPooler(PoolerKind kind)
 {
     if (dicPoolers.ContainsKey(kind))
     {
         return(dicPoolers[kind]);
     }
     else
     {
         return(null);
     }
 }
Beispiel #6
0
        public void SetFuzzyValue(DF_FuzzySet functionKind, int value)
        {
            if (dicFuzzyFunctions.ContainsKey(functionKind))
            {
                dicFuzzyFunctions[functionKind].SetValue(value);
            }
            else
            {
#if UNITY_EDITOR
                Debug.LogWarning("Dictionary Key가 존재하지 않습니다.");
#endif
            }
        }
    private void CreateCamera()
    {
        dicCameraObjs = new EnumDictionary <CameraKind, GameObject>();
        foreach (var cam in dicCameras)
        {
            var c = Instantiate <GameObject>(cam.Value.cameraObject, transform);
            c.SetActive(false);

            if (!dicCameraObjs.ContainsKey(cam.Key))
            {
                dicCameraObjs.Add(cam.Key, c);
            }
        }
    }
Beispiel #8
0
        // Private Method
        #region Private Method

        #endregion

        // Public Method
        #region Public Method

        public float GetRuleWeight(DF_FuzzyRule ruleKind)
        {
            if (dicFuzzyRules.ContainsKey(ruleKind))
            {
                return(dicFuzzyRules[ruleKind].GetWeight(ruleKind));
            }
            else
            {
#if UNITY_EDITOR
                Debug.LogWarning("Dictionary Key가 존재하지 않습니다.");
#endif
                return(0f);
            }
        }
Beispiel #9
0
 private void OnEnable()
 {
     if (dicFuzzyData == null && fuzzyDatas != null)
     {
         dicFuzzyData = new EnumDictionary <Membership, AnimationCurve>();
         for (int i = 0; i < this.fuzzyDatas.Length; i++)
         {
             var key = (Membership)((int)fuzzyDatas[i].kind + (int)df_Fuzzy);
             if (!dicFuzzyData.ContainsKey(key))
             {
                 dicFuzzyData.Add(key, fuzzyDatas[i].membership);
             }
         }
     }
 }
 // Private Method
 #region Private Method
 private void Init()
 {
     if (cameraDatas != null)
     {
         dicCameras = new EnumDictionary <CameraKind, CameraData>();
         for (int i = 0; i < cameraDatas.Length; i++)
         {
             if (!dicCameras.ContainsKey(cameraDatas[i].kind))
             {
                 dicCameras.Add(cameraDatas[i].kind, cameraDatas[i]);
                 cameraDatas[i].MappingCamera();
             }
         }
         CreateCamera();
     }
 }
Beispiel #11
0
        // Property
        #region Property

        #endregion

        // MonoBehaviour
        #region MonoBehaviour
        private void Awake()
        {
            dicFuzzyFunctions = new EnumDictionary <DF_FuzzySet, FuzzySet>();
            dicFuzzyRules     = new EnumDictionary <DF_FuzzyRule, FuzzyRule>();

            for (int i = 0; i < fuzzyFunctions.Length; i++)
            {
                if (!dicFuzzyFunctions.ContainsKey(fuzzyFunctions[i].kind))
                {
                    dicFuzzyFunctions.Add(fuzzyFunctions[i].kind, fuzzyFunctions[i].fuzzySet);
                }
            }
            for (int i = 0; i < fuzzyRules.Length; i++)
            {
                if (!dicFuzzyRules.ContainsKey(fuzzyRules[i].kind))
                {
                    dicFuzzyRules.Add(fuzzyRules[i].kind, fuzzyRules[i].fuzzyRule);
                }
            }
        }