Exemplo n.º 1
0
        public GameObject ChangeWeapon(string boneName, string sourceName)
        {
            Transform bone = GetBone(boneName);

            if (bone)
            {
                GameObject weapon = null;
                if (sourceName != "")
                {
                    weapon = FEngineManager.Create(sourceName, bone.gameObject);
                }

                if (mWeapons.ContainsKey(boneName))
                {
                    FEngineManager.Remove(mWeapons[boneName]);
                }
                mWeapons[boneName] = weapon;
                return(weapon);
            }
            else
            {
                Debug.LogError(sourceName + "武器切换,骨骼:" + boneName + "没有找到");
            }
            return(null);
        }
Exemplo n.º 2
0
        private T _CloneOneObject(int i, List <T> list, Action <int, T> CallBack, GroupConfig config)
        {
            T t = null;

            if (i < list.Count)
            {
                t = list[i];
            }
            else
            {
                if (config.tempT == null)
                {
                    t = (T)((Component)FEngineManager.PoolObject(config.resName, config.parent.gameObject));
                }
                else
                {
                    t = FEngineManager.CloneObject <T>(config.tempT.gameObject, null);
                }
                list.Add(t);
            }

            t.gameObject.SetActive(true);

            if (config.toolData != null)
            {
                config.toolData.HandTool(i, t);
            }

            if (CallBack != null)
            {
                CallBack(i, t);
            }
            return(t);
        }
Exemplo n.º 3
0
        void Awake()
        {
            Application.runInBackground = true;
            //Application.targetFrameRate = 60;

#if UNITY_EDITOR
            if (DebugType == FDebugType.D_HideLog)
            {
                DebugType = FDebugType.D_NONE;
            }
#else
            if (serverPlat == ServerPlat.SP_Online)
            {
                DebugType = FDebugType.D_NONE;
            }
#endif
            instance = this;

            FEngineManager.SetEngine(this);
            //      LoadSceneManager.instance.SetScene(GameProgress.GP_Map1, "PveMap");

            DontDestroyOnLoad(this.gameObject);
            ConfigManager.instance.Init();
            InitManager();
            InitScene();
#if UNITY_EDITOR
            CheckProject();
#endif
        }
Exemplo n.º 4
0
        private UnitObject _createInstance <T>() where T : UnitObject
        {
            if (mUnitObject != null)
            {
                return(mUnitObject);
            }

            var obj = FEngineManager.Create(nTypeKey, this.gameObject);

            if (obj != null)
            {
                mUnitObject = obj.GetComponent <T>();
                if (mUnitObject == null)
                {
                    mUnitObject = obj.AddComponent <T>();
                }
            }
            var tran = mUnitObject.transform as RectTransform;

            if (tran != null)
            {
                tran.anchoredPosition3D = Vector3.zero;
            }
            else
            {
                mUnitObject.transform.localPosition = Vector3.zero;
            }
            return(mUnitObject);
        }
Exemplo n.º 5
0
 public void CreateBones(string boneName)
 {
     mBody  = FEngineManager.Create(boneName, this.gameObject);
     mBones = mBody.GetComponentsInChildren <Transform>(true);
     FEngineManager.AddComponent <SkinnedMeshRenderer>(mBody);
     mBodyAnimator = FEngineManager.AddComponent <FCAnimator>(mBody);
     Init();
 }
Exemplo n.º 6
0
 public void RemoveShell()
 {
     if (mUnitObject != null)
     {
         mUnitObject.transform.SetParent(this.transform.parent);
         FEngineManager.Remove(this.gameObject);
     }
 }
Exemplo n.º 7
0
 public override void Clear()
 {
     if (mUnitObject != null)
     {
         FEngineManager.Remove(mUnitObject.gameObject);
         mUnitObject = null;
     }
 }
Exemplo n.º 8
0
 private void _CreateQueueTips(Queue <TipsParams> qTips)
 {
     while (qTips.Count > 0)
     {
         var param = qTips.Dequeue();
         FEngineManager.ShowWindos(param.GetTipsPlane(), WinShowType.WT_Normal, param);
     }
 }
Exemplo n.º 9
0
 private void UpdateGenesFit()
 {
     mAllFit = 0;
     FEngineManager.SetList(mGenes, (f, i) =>
     {
         mAllFit += f.UpdateFit();
     });
 }
Exemplo n.º 10
0
 public static void ClearBackWindos()
 {
     mBackWindos.Clear();
     foreach (var k in mPoolWindos)
     {
         k.Value.CloseClear();
         FEngineManager.DeletObject(k.Value);
     }
     mPoolWindos.Clear();
 }
Exemplo n.º 11
0
        public int GetWeightNum()
        {
            int wightNum = 0;

            FEngineManager.SetList(mNeuralLayerDataList, (f, i) =>
            {
                wightNum += (f.mNeuralDataList.Count * f.GetWeightNum());
            });
            return(wightNum);
        }
Exemplo n.º 12
0
 public bool Open(string fileName, FFilePath pathType, FOpenType ot = FOpenType.OT_ReadWrite)
 {
     mFOpenType = ot;
     mFilePath  = FEngineManager.ConvertPath(fileName, pathType);
     Init();
     if (!IsHaveSameType(mFOpenType, FOpenType.OT_Write))
     {
         mIsLoad = File.Exists(mFilePath);
         return(mIsLoad ? ReadFile() : false);
     }
     return(false);
 }
Exemplo n.º 13
0
        public void SetWeights(List <double> weights)
        {
            int startIndex = 0;

            FEngineManager.SetList(mNeuralLayerDataList, (f, index) =>
            {
                for (int i = 0; i < f.mNeuralDataList.Count; i++)
                {
                    NeuralData nd = f.mNeuralDataList[i];
                    nd.SetCode(weights.GetRange(startIndex, nd._Code.Count));
                    startIndex += nd._Code.Count;
                }
            });
        }
Exemplo n.º 14
0
        sealed protected override void Init()
        {
            if (append_fengine())
            {
                if (!FEngineManager.IsInitFEngine())
                {
                    return;
                }
            }
            var obj = LoadSceneManager.instance.CurMode;

            object[] arg = obj == null?null:obj.GetParams();
            Begin(arg);
        }
Exemplo n.º 15
0
        //通用GM
        public static void GMPlay()
        {
            if (mGMAction.Count != 0)
            {
                return;
            }

            //////////////////////////////////////////
            RegisterGM("#log", (f, e) =>
            {
                MyLog.SetLog();
                return(true);
            }, "显示日志系统");

            FEngineManager.GetFBEngine().SettingGM(RegisterGM);
        }
Exemplo n.º 16
0
        public override void Init(params object[] args)
        {
            mLoadPercent  = new LoadPercent();
            mLastLoadMode = mCurLoadMode;
            mCurLoadMode  = (LoadMode)args[0];
            EventManager.instance.Send(LoadSceneManager.LoadEvent, LoadSceneManager.LoadType.LT_Begin, mCurLoadMode);
            mCurLoadMode.PlayLoad(LoadSceneManager.LoadType.LT_Begin);
            BaseLoad bl            = null;
            string   planeTypeName = mCurLoadMode.PlaneName;

            planeTypeName = string.IsNullOrEmpty(planeTypeName)?ResConfig.FNORMALLOAD: planeTypeName;
            bl            = FEngineManager.PoolObject <BaseLoad>(planeTypeName, this.gameObject);
            bl.GetComponent <RectTransform>().NormalRectTransform();
            bl.IsPool = bl.InitOpen(this, mCurLoadMode);
            StartCoroutine(PlayFun(mCurLoadMode.ToSceneName, bl));
        }
Exemplo n.º 17
0
 public void Remove(int count = 1, int startIndex = -1, bool immediately = false)
 {
     if (startIndex == -1)
     {
         if (immediately)
         {
             for (int i = mMaxNum - 1; i >= mMaxNum - count; i--)
             {
                 var obj = mBuffs[i];
                 mBuffs.Remove(obj);
                 FEngineManager.Remove(obj.gameObject);
             }
         }
         else
         {
             for (int i = mMaxNum - count; i < mMaxNum; i++)
             {
                 mBuffs[i].gameObject.SetActive(false);
             }
         }
         mMaxNum -= count;
     }
     else
     {
         if (immediately)
         {
             for (int i = startIndex + count - 1; i >= startIndex; i--)
             {
                 var tempObject = mBuffs[i];
                 mBuffs.Remove(tempObject);
                 FEngineManager.Remove(tempObject.gameObject);
             }
         }
         else
         {
             for (int i = startIndex + count - 1; i >= startIndex; i--)
             {
                 var tempObject = mBuffs[i];
                 mBuffs.Remove(tempObject);
                 mBuffs.Add(tempObject);
                 tempObject.transform.SetAsLastSibling();
             }
         }
         mMaxNum -= count;
         CloneObjectList(mBuffs, mMaxNum, null, mGroupConfig);
     }
 }
Exemplo n.º 18
0
 public void CloseMySelf(bool clearBack = false)
 {
     if (mInitOver)
     {
         if (clearBack)
         {
             FEngineManager.ClearBackWindos();
         }
         FEngineManager._CloseWindos(HandleID, "", FEngineManager.IsHaveSameWinType(mWinShowType, WinShowType.WT_Reset) ? WinShowType.WT_Reset : WinShowType.WT_Normal);
         FEngineManager.ResetWindos(HandleID);
     }
     else
     {
         mInitDelayAction = () =>
         {
             CloseMySelf(clearBack);
         };
     }
 }
Exemplo n.º 19
0
 public static BasePlane ShowWait(int lay, bool mask = true)
 {
     mMaskWait = FUniversalFunction.SetMaskCode(mMaskWait, 1 << lay, mask);
     if (mask)
     {
         if (mMaskWait != 0 && mWaitPlane == null)
         {
             mWaitPlane = FEngineManager.ShowWindos(ResConfig.CC_WAITPLANE);
         }
     }
     else
     {
         if (mMaskWait == 0 && mWaitPlane != null)
         {
             FEngineManager.CloseWindos(mWaitPlane);
         }
     }
     return(mWaitPlane);
 }
Exemplo n.º 20
0
        private BasePlane CreateTips(TipsParams param)
        {
            var code = 1 << param.GetLay();

            if (FUniversalFunction.IsContainSameType(mMaskCode, code))
            {
                Queue <TipsParams> qTips = null;
                if (!mDelayData.TryGetValue(code, out qTips))
                {
                    qTips            = new Queue <TipsParams>();
                    mDelayData[code] = qTips;
                }
                qTips.Enqueue(param);
            }
            else
            {
                return(FEngineManager.ShowWindos(param.GetTipsPlane(), WinShowType.WT_Normal, param));
            }
            return(null);
        }
Exemplo n.º 21
0
 public void ResetMySelf()
 {
     if (mInitOver)
     {
         int index = this.transform.GetSiblingIndex();
         CloseMySelf();
         var newPlane = FEngineManager.ShowWindos(PoolName, mWinShowType, mArgs);
         if (newPlane != null)
         {
             newPlane.transform.SetSiblingIndex(index);
         }
     }
     else
     {
         mInitDelayAction = () =>
         {
             ResetMySelf();
         };
     }
 }
Exemplo n.º 22
0
        public BasePlane ShowWindos(string name, WinShowType type = WinShowType.WT_Normal, params object[] arg)
        {
            var bp = FEngineManager.ShowWindos(name, type, arg);

            EventListenManager.Send(ShowWindowEvent);
            //HandWindos(bp);

            /*
             * if (bp != null)
             * {
             *  bp.transform.localEulerAngles = new Vector3(0, 180, 0);
             *  var texts = bp.GetComponentsInChildren<Text>(true);
             *  for (int i = 0; i < texts.Length; i++)
             *  {
             *      texts[i].MirrorText();
             *  }
             * }
             */
            return(bp);
        }
Exemplo n.º 23
0
 void OnApplicationQuit()
 {
     ConfigManager.instance.SaveConfig();
     FEngineManager.CloseEngine();
 }
Exemplo n.º 24
0
 protected override void OnInit()
 {
     mNetMsg.Init(NETWORK_MSG, FEngineManager.GetNetMsgCore());
 }
Exemplo n.º 25
0
 public void SaveAs(string fileName, FFilePath pathType)
 {
     mFilePath = FEngineManager.ConvertPath(fileName, pathType);
     Save();
 }
Exemplo n.º 26
0
 public FCMusciObject PlaySound(string name, bool loop, FCMusciObject.MusicType type = FCMusciObject.MusicType.Sound, string group = null, float len = 0, float startTime = 0, float volume = 1)
 {
     return(FEngineManager.PlaySound(name, loop, type, group, len, startTime, volume));
 }
Exemplo n.º 27
0
 public FCMusciObject PlaySound(string name, float startTime = 0, float volume = 1)
 {
     return(FEngineManager.PlaySound(name, startTime, volume));
 }
Exemplo n.º 28
0
 public FCMusciObject GetSound(string name)
 {
     return(FEngineManager.GetSound(name));
 }
Exemplo n.º 29
0
 public FCMusciObject PlayMusic(string name, string group = null, float volume = 1)
 {
     return(FEngineManager.PlayMusic(name, group, volume));
 }
Exemplo n.º 30
0
 public void SetMusicVolume(float size)
 {
     FEngineManager.SetMusicVolume(size);
 }