Пример #1
0
    void Awake()
    {
        DontDestroyOnLoad(this);
        Inst = this;
        //添加船体的控制脚本
        curPlayShip = transform.Find("PlayerShipGroup").gameObject;
        curPlayShip.AddComponent <PlayerShip>();

        //添加所需模块组件的组件
        AudioMgr = gameObject.AddComponent <AudioMgr>();
        //调用音效初始化
        AudioMgr.Inst();
        AudioMgr.PlayAudio(AudioMgr.bgm, AudioMgr._BgmAudioSource_p);


        EnemyMgr = gameObject.AddComponent <EnemyMgr>();
        EnemyMgr.Inst();
        EnemyMgr.StartBuild();

        AsteridMgr = gameObject.AddComponent <AsteridMgr>();
        AsteridMgr.Inst();
        AsteridMgr.StrtBuild();

        EffectMgr = gameObject.AddComponent <EffectMgr>();
        EffectMgr.Inst();

        MissilePoolMgr = gameObject.AddComponent <MissilePoolMgr>();
        //调用对象池里的生成子弹方法
        MissilePoolMgr.Inst();

        _MainCancas = transform.Find("Canvas").GetComponent <Canvas>();

        _scoreUI = _MainCancas.transform.Find("ScoreUI").gameObject.AddComponent <ScoreUI>();
        _scoreUI.Inst();
    }
Пример #2
0
        //-------------------------------------------------------------------------
        public override object excute(EffectMgr effect_mgr, EffectContext effect_context, string[] predefine_param, string[] effect_param)
        {
            Item item = effect_context.item;
            Entity et = effect_context.EtActor;

            return null;
        }
Пример #3
0
    void OnTriggerEnter(Collider collider)
    {
        UnitBase unitBase = collider.GetComponent <UnitBase>();

        if (unitBase != null)
        {
            if (unitBase == m_Unit)
            {
                return;
            }

            DamageFunc(unitBase);
        }
        ElementBase eleTmp = collider.GetComponent <ElementBase>();

        if (eleTmp != null)
        {
            if (eleTmp.GetUnit().GetType() == m_Unit.GetType())
            {
                return;
            }
        }

        m_goExplosion = ObjectPool.GetInst().GetObject(EffectMgr.GetInst().GetEffect((int)E_EFFECTID.EXPLOSION));

        m_goExplosion.transform.position = transform.position;

        PooledThis();
    }
Пример #4
0
    private IEnumerator OnDestroyEff(GameObject e, float time)
    {
        yield return(new WaitForSeconds(time));

        EffectMgr.RemoveEff(e);
        GameObject.Destroy(e);
    }
Пример #5
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
 public static void InitInst()
 {
     if (m_Inst == null)
     {
         m_Inst = new EffectMgr();
     }
 }
Пример #7
0
        //---------------------------------------------------------------------
        public override void defAllProp(Dictionary<string, string> map_param)
        {
            EffectMgr = new EffectMgr();

            mPropIsBot = defProp<bool>(map_param, "IsBot", false);
            mPropAccountId = defProp<string>(map_param, "AccountId", "");
            mPropAccountName = defProp<string>(map_param, "AccountName", "");
            mPropActorId = defProp<ulong>(map_param, "ActorId", 0);
            mPropNickName = defProp<string>(map_param, "NickName", "");
            mPropIcon = defProp<string>(map_param, "Icon", "");
            mPropIpAddress = defProp<string>(map_param, "IpAddress", "");
            mPropGender = defProp<bool>(map_param, "Gender", false);
            mPropIndividualSignature = defProp<string>(map_param, "IndividualSignature", "这家伙很懒,什么也没留下!");
            mPropLevel = defProp<int>(map_param, "Level", 1);
            mPropExperience = defProp<int>(map_param, "Experience", 0);
            PropGold = defProp<int>(map_param, "Gold", 100);
            mPropProfileSkinTableId = defProp<int>(map_param, "ProfileSkinTableId", 1);
            mPropIsVIP = defProp<bool>(map_param, "IsVIP", false);
            mPropVIPDataTime = defProp<DateTime>(map_param, "VIPDataTime", DateTime.Now);
            mPropVIPPoint = defProp<int>(map_param, "VIPPoint", 0);
            mPropGameTotal = defProp<int>(map_param, "GameTotal", 0);
            mPropGameWin = defProp<int>(map_param, "GameWin", 0);
            mPropJoinDateTime = defProp<DateTime>(map_param, "JoinDataTime", DateTime.Now);
            mPropLastOnlineDateTime = defProp<DateTime>(map_param, "LastOnlineDateTime", DateTime.Now);
            mPropIsAFK = defProp<bool>(map_param, "IsAFK", false);
        }
Пример #8
0
    // Use this for initialization
    protected void Start()
    {
        DBMgr.GetInst().OpenConnection();

        m_audioBgm.enabled = false;

        MapMgr.Inst.Initialize();
        MapMgr.Inst.CreateMap();

        CamMgr.GetInst().Initialize();
        ObjectPool.GetInst().Initialzie();
        EffectMgr.GetInst().Initailzie();
        ElementMgr.GetInst().Initialize();
        ChipMgr.Inst.Initialize();
        UnitMgr.Inst.Initialize();

        EffectMgr.GetInst().SetEffectPooled();
        ObjectPool.GetInst().CreatePool();

        if (MultyManager.Inst == null)
        {
            StartCoroutine(UnitMgr.Inst.GenUnit());
            UnitMgr.Inst.EnemyPlay();
        }
    }
Пример #9
0
 // Use this for initialization
 void Start()
 {
     if (Instance == null)
     {
         Init();
         Instance = this;
     }
 }
Пример #10
0
    //-------------------------------------------------------------------------
    public override void init()
    {
        EffectMgr = new EffectMgr();
        Init      = false;
        SyncPropDirtyElapsedTm = 1f;

        Def.mPropLevel.OnChanged      = _onPropLevelChanged;// 等级属性变更通知
        Def.mPropExperience.OnChanged = _onPropExperienceChanged;
        Def.mPropNickName.OnChanged   = _onPropNickNameChanged;
        Def.PropGold.OnChanged        = _onPropGoldChanged;
        Def.mPropIsAFK.OnChanged      = _onPropIsAFKChanged;
    }
Пример #11
0
        //-------------------------------------------------------------------------
        public override object excute(EffectMgr effect_mgr, EffectContext effect_context, string[] predefine_param, string[] effect_param)
        {
            //EbLog.Note("EffectTakeoffEquip.excute()");

            Item item = effect_context.item;
            Entity et = effect_context.EtActor;

            // 从装备背包中移除
            var co_equip = et.getComponent<CellEquip<DefEquip>>();
            item = co_equip.takeoffEquip((EquipSlot)item.TbDataItem.ItemTypeId);

            return null;
        }
Пример #12
0
        //-------------------------------------------------------------------------
        public override object excute(EffectMgr effect_mgr, EffectContext effect_context, string[] predefine_param, string[] effect_param)
        {
            //EbLog.Note("EffectTakeonEquip.excute()");

            Item item = effect_context.item;
            Entity et = effect_context.EtActor;

            // 添加到装备背包
            var co_equip = et.getComponent<CellEquip<DefEquip>>();
            co_equip.takeonEquip(item);

            return null;
        }
Пример #13
0
    // Use this for initialization
    void Start()
    {
        IsRed = true;

        m_anim.speed = 0.0f;

        m_arModeFunc [3]();

        StartCoroutine(FadeIn());
        m_textHp.text = m_status.nCurHp.ToString();

        m_goExplosion = EffectMgr.GetInst().GetEffect((int)E_EFFECTID.EXPLOSION);
    }
Пример #14
0
        //-------------------------------------------------------------------------
        public override object excute(EffectMgr effect_mgr, EffectContext effect_context, string[] predefine_param, string[] effect_param)
        {
            //EbLog.Note("EffectStatusCreator1.excute()");

            Item item = effect_context.item;
            Entity et = effect_context.EtActor;

            // 创建Status
            var co_status = et.getComponent<CellStatus<DefStatus>>();
            co_status.createStatus(item);

            return null;
        }
    // Use this for initialization
    protected void Start()
    {
        m_anim.SetInteger("CurAnim", (int)E_PlAnimState.IDLE);
        m_anim.speed = 0.0f;
        m_transAtk   = this.transform.Find("AtkPos").transform;
        UIMgr.Inst.GetHpText().text = m_status.nCurHp.ToString();

        FindArmBone();
        FindHandBone();

        m_goExplosion = EffectMgr.GetInst().GetEffect((int)E_EFFECTID.DEATH);

        m_bodyMaterial.color = Color.white;
        m_arModeFunc [0]();
    }
    private IEnumerator PoofFunc()
    {
        ObjectPool.GetInst().PooledObject(m_goChip);
        m_goChip = null;
        yield return(null);

        GameObject goPoof = ObjectPool.GetInst().GetObject(EffectMgr.GetInst().GetEffect((int)E_EFFECTID.POOF));

        goPoof.transform.position = transform.position + new Vector3(0.0f, 3.5f, 0.0f);
        ResetIdle();
        yield return(new WaitForSeconds(0.3f));

        ObjectPool.GetInst().PooledObject(goPoof);
        yield return(null);
    }
        private void OnEnable()
        {
            this.EffectMgr = target as EffectMgr;
            this.effectInfoMsgAssetsProp = serializedObject.FindProperty("effectInfoMsgs");
            this.effectInfoMsgList       = new ReorderableList(serializedObject, effectInfoMsgAssetsProp, true, true, true, true);

            this.effectInfoMsgList.elementHeight       = 3 * EditorGUIUtility.singleLineHeight;
            this.effectInfoMsgList.drawElementCallback = (rect, index, a, b) =>
            {
                var prop = effectInfoMsgAssetsProp.GetArrayElementAtIndex(index);
                EditorGUI.PropertyField(rect, prop);
            };
            this.effectInfoMsgList.drawHeaderCallback = (rect) =>
                                                        EditorGUI.LabelField(rect, "效果信息");

            this.effectInfoMsgList.onAddCallback = OnAddEffectInfoMsg;
        }
    protected IEnumerator UseShieldCoroutine()
    {
        m_fChargeTime = 0.0f;
        m_bCharged    = false;
        m_act         = E_ACT.GUARD;
        GameObject objShield = ObjectPool.GetInst().GetObject(EffectMgr.GetInst().GetEffect((int)E_EFFECTID.SHIELD));

        objShield.transform.parent   = this.transform;
        objShield.transform.position = m_transAtk.transform.position + transform.forward * 0.2f - new Vector3(0.0f, 0.2f, 0.0f);
        yield return(new WaitForSeconds(1.0f));

        objShield.transform.parent = null;
        ObjectPool.GetInst().PooledObject(objShield);
        yield return(null);

        ResetIdle();
        yield return(null);
    }
Пример #19
0
    public virtual void ReleaseStage()
    {
        UIMgr.Inst.ClearChip();
        UIMgr.Inst.ClearSelectedIcons();
        UIMgr.Inst.ClearUseChips();
        UnitMgr.Inst.ReleaseUnit();
        EffectMgr.GetInst().ReleaseEffect();
        ElementMgr.GetInst().ReleaseElement();
        ChipMgr.Inst.ReleaseChipList();
        DBMgr.GetInst().CloseConnection();
        ObjectPool.GetInst().ReleasePooled();
        System.GC.Collect();

        if (MultyManager.Inst == null)
        {
            UnityEngine.SceneManagement.SceneManager.LoadScene("MainScene");
        }
    }
Пример #20
0
        //-------------------------------------------------------------------------
        public override object excute(EffectMgr effect_mgr, EffectContext effect_context, string[] predefine_param, string[] effect_param)
        {
            Item item = effect_context.item;
            Entity et = effect_context.EtActor;

            UnitConsumables unit_consumable = (UnitConsumables)item.UnitLink;
            foreach (var i in unit_consumable.TbDataUnitConsumables.ListEffect)
            {
                TbDataEffect data_effect = EbDataMgr.Instance.getData<TbDataEffect>(i.EffectId);

                effect_mgr.doEffect(effect_context, data_effect.ScriptName,
                    data_effect.PredefineParamList, i.ListParam);
            }

            item.ItemData.n -= (byte)item.TbDataItem.MainOperateInfo.SubOverlapNum;

            return null;
        }
Пример #21
0
    protected override void OnSkillBegin()
    {
        addChars.Clear();
        slots.Clear();
        for (int i = 0; i < GameMgr.GamePlayer.MAXOPENSLOTNUM; ++i)
        {
            if (Fight.Inst.IsEmptySlot(attacker.camp, i))
            {
                slots.Add(i);
            }
        }
        //if (slots.Count == 0)
        //{
        //    AddTbuff(attacker);
        //    End();
        //    return;
        //}

        slots.Add(attacker.slot);

        StartCameraAnim();
        //PlaySingAnimAndEffect();

        attacker.PlayAnim(SingAnim);

        fireEff = EffectMgr.Load(SingEffect);
        if (fireEff != null)
        {
            fireEff.transform.position = attacker.position;
        }

        AddChars();

        AddEvent(HitTime, delegate
        {
            MoveChars();

            attacker.visible = false;
        });
    }
Пример #22
0
    void OnTriggerEnter(Collider collider)
    {
        UnitBase pBase = collider.GetComponent <UnitBase> ();

        if (pBase == null)
        {
            return;
        }

        if (pBase == m_Unit)
        {
            return;
        }

        m_goExplosion = ObjectPool.GetInst().GetObject(EffectMgr.GetInst().GetEffect((int)E_EFFECTID.IMPACTEXPLOSION));
        m_goExplosion.transform.position = transform.position;

        DamageFunc(pBase);

        m_bAllive = false;
        StopCoroutine(ExecuteCoroutine());
        PooledThis();
    }
Пример #23
0
    protected void Awake()
    {
        if (m_inst != null)
        {
            Destroy(gameObject);
            return;
        }

        m_inst = this;

        DBMgr.InitInst();
        MapMgr.InitInst();
        UnitMgr.InitInst();
        EffectMgr.InitInst();
        ElementMgr.InitInst();
        ChipMgr.InitInst();
        ObjectPool.InitInst();
        CamMgr.InitInst();

        m_audioBgm        = transform.GetComponent <AudioSource> ();
        m_clipDeleteEnemy = Resources.Load <AudioClip> ("Sound/Bgm/EnemyDeleted");
        m_clipGameover    = Resources.Load <AudioClip> ("Sound/Bgm/Gameover");
    }
Пример #24
0
    public GameObject PlayEffect(string eff, float destroyTime)
    {
        GameObject obj = null;

        if (!string.IsNullOrEmpty(eff) && eff != "null")
        {
            try
            {
                obj = EffectMgr.LoadAsyn(eff, owner);
                Effect e = DataMgr.GetEffect(eff);
                if (e != null)
                {
                    if (e.time > 0f)
                    {
                        DestroyEff(obj, e.time);
                    }
                }
                else
                {
                    if (destroyTime > 0)
                    {
                        DestroyEff(obj, destroyTime);
                    }
                    else
                    {
                        DestroyEff(obj, 5f);
                    }
                }
            }
            catch (UnityException e)
            {
                Debug.LogException(e);
            }
        }
        return(obj);
    }
Пример #25
0
 void Awake( )
 {
     _instance = this;
 }
Пример #26
0
 //-------------------------------------------------------------------------
 public abstract object excute(EffectMgr effect_mgr, EffectContext effect_context, string[] predefine_param, string[] effect_param);