Ejemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            song.SetText("Nessuna Traccia Audio Rilevata       ");
            song.DoScroll(450, MatrixLib.ScrollDirection.Left);
            song.SetAutoPadding(true, ' ');

            matrixControl1.SetText(" Cony Media Player");
            //matrixControl1.DoScroll(500, MatrixLib.ScrollDirection.Left);
            this.matrixControl1.SetAutoPadding(true, ' ');
            //Moduli.CFGReader.lmain();
            //Moduli.CFGReader.ReadCFG(Application.StartupPath);
            this.BackgroundImage = Image.FromFile(Application.StartupPath + "\\data\\Default\\default.png");
            init();
            configura();
            CST = CdState.CdChiuso;


            try
            {
                mciSendString("close all", "0", 0, 0);                            //Chiude tutte le traccie audio se eventualmente sono aperte
                mciSendString("open cdaudio alias cd wait shareable", "0", 0, 0); //Apre l'mcd per la sessione audio
                mciSendString("set cd time format tmsf wait", "0", 0, 0);         //Imposto il formato del tempo al cd audio
                numerotraccie();
            }
            catch { };
        }
Ejemplo n.º 2
0
 private void panel8_MouseClick(object sender, MouseEventArgs e)
 {
     if (CST == CdState.CdChiuso)
     {
         ReturnValue = mciSendString("open " + Strdriveletter + " Type cdaudio Alias cd", Strmssg, 255, 0);
         ReturnValue = mciSendString("set cd door open", "", 0, 0);
         song.StopScroll();
         song.SetText("In Attesa di un CD Room");
         CST = CdState.CdAperto;
     }
     else if
     (CST == CdState.CdAperto)
     {
         song.SetText("Attendere Prego...");
         this.Cursor = Cursors.Hand;
         ReturnValue = mciSendString("open " + Strdriveletter + " Type cdaudio Alias cd", Strmssg, 255, 0);
         ReturnValue = mciSendString("set cd door closed", "", 0, 0);
         CST         = CdState.CdChiuso;
         numerotraccie();
     }
 }
Ejemplo n.º 3
0
    public void CmpObjectEvent(float curTime, float lastTime, LCHEventChannelData _e, ObjectContain contain, LCharacterInterface character, LChatacterInformationInterface information,
                               Dictionary <int, ObjectContain> objs
                               , CdState cdState
                               , string cdName
                               , int skillState
                               , Vector3 baseGroundPos
                               , ref float beginToTarget
                               , ref float endToTarget
                               , ref Vector3 beginTargetPoint
                               )
    {
        if (contain.isFlyTool)
        {
            if (null != contain.gameobject)
            {
                contain.gameobject.SetActive(false);
            }
            return;
        }
        LCHChannelType t = (LCHChannelType)_e.type;
        ObjDictionary  value;
        float          _time;
        float          _keyFrameTime;

        if (t == LCHChannelType.Object)
        {
            int res = _e.TryGetKeyFrameRunTime(curTime, lastTime, out value, out _time, out _keyFrameTime);
            if (res == 1)
            {
                if (null != contain.gameobject)
                {
                    bool enable = value.GetValue <bool>("enable", true);
                    if (_e.objId == -1)
                    {
                        //因為主對象直接設置 gameObject的Enable,所有腳本都不工作了.
                        if (null != contain.roleRenders)
                        {
                            for (int n = 0; n < contain.roleRenders.Length; n++)
                            {
                                contain.roleRenders[n].enabled = enable;
                            }
                        }
                    }
                    else
                    {
                        if (enable)
                        {
                            contain.gameobject.SetActive(false);
                            contain.gameobject.SetActive(true);
                        }
                        else
                        {
                            contain.gameobject.SetActive(enable);
                        }
                    }
                    if (enable)
                    {
                        if (contain.type == 1)
                        {
                            string anim_name = value.GetValue <string>("anim", "");
                            if (anim_name.Length > 0)
                            {
                                if (null == contain.animaction)
                                {
                                    contain.animaction = contain.gameobject.GetComponent <Animation>();
                                }
                                if (null != contain.animaction)
                                {
                                    bool cf = value.GetValue <bool>("crossFade", true);
                                    //crossFade
                                    contain.animaction[anim_name].time = _time;
                                    if (cf)
                                    {
                                        contain.animaction.CrossFade(anim_name, 0.05f);
                                    }
                                    else
                                    {
                                        contain.animaction[anim_name].time = 0f;//特么不这么干不重置。。。
                                        contain.animaction.Play(anim_name);
                                    }
                                }
                            }
                            int ex_action = value.GetValueInt("ex_action", 0);
                            if (ex_action == 1)
                            {
                                //主模型.
                                if (_e.objId == -1)
                                {
                                    float ToTargetTime = value.GetValueFloat("ex_action", -1f);
                                    if (ToTargetTime > 0f)
                                    {
                                        beginToTarget    = _keyFrameTime;
                                        endToTarget      = _keyFrameTime + ToTargetTime;
                                        beginTargetPoint = baseGroundPos;
                                    }
                                }
                            }

                            //
                            else if (ex_action == 2)
                            {
                                contain.stopUpatePos = true;
                            }
                        }
                    }
                }
            }
            else if (res == 0)
            {
                if (_e.objId != -1)//非主模型,一开始隐藏
                {
                    if (null != contain.gameobject)
                    {
                        if (contain.objId != -1)
                        {
                            contain.gameobject.SetActive(false);
                        }
                    }
                }
            }
        }
        if (t == LCHChannelType.Event)
        {
            int res = _e.TryGetKeyFrameRunTime(curTime, lastTime, out value, out _time, out _keyFrameTime);
            if (res == 1)
            {
                if (contain.type == 2 || contain.type == 3)
                {
                    if (null == contain.collider)
                    {
                        if (null != contain.gameobject)
                        {
                            contain.collider         = contain.gameobject.GetComponent <Collider>();
                            contain.gameobject.layer = character.GetAttackLayer();
                            if (null != contain.collider)
                            {
                                contain.collider.isTrigger = true;
                            }
                        }
                    }
                }
                if (null != contain.gameobject)
                {
                    bool enable = value.GetValue <bool>("enable", true);
                    contain.gameobject.SetActive(enable);
                    if (contain.collider)
                    {
                        contain.collider.enabled = enable;
                        if (enable)
                        {
                            if (null == contain.hitData)
                            {
                                LCharacterHitDataCmp hdc = contain.gameobject.GetComponent <LCharacterHitDataCmp>();
                                if (null == hdc)
                                {
                                    hdc = contain.gameobject.AddComponent <LCharacterHitDataCmp>();
                                }
                                contain.hitData = hdc.data;
                            }

                            contain.hitData.type = "hit";
                            LCharacterHitData hitData = new LCharacterHitData();

                            hitData.hittedObject.Clear();
                            hitData.value       = value;
                            hitData.characterId = character.GetId();
                            hitData.firstHit    = true;

                            hitData.cdName     = cdName;
                            hitData.skillState = skillState;
                            hitData.cdState    = cdState;

                            int effectId = value.GetValueInt("hit_effect", -2);
                            if (effectId != -2 && objs.ContainsKey(effectId))
                            {
                                var ct = objs[effectId];
                                hitData.effect     = ct.mod;
                                hitData.effect_obj = ct.baseGameObject;
                            }
                            else
                            {
                                hitData.effect     = null;
                                hitData.effect_obj = null;
                            }
                            contain.hitData.data = hitData;
                            int IsFlyTool = value.GetValueInt("IsFlyTool", 0);
                            if (IsFlyTool == 1)
                            {
                                if (contain.type == 3)
                                {
                                    float FlyToolTime  = value.GetValueFloat("FlyToolTime", 20f);
                                    float FlyToolSpeed = value.GetValueFloat("FlyToolSpeed", 2f);
                                    if (null != contain.gameobject)
                                    {
                                        var g = GameObject.Instantiate(contain.gameobject);
                                        LCharacterHitDataCmp hdc0 = g.GetComponent <LCharacterHitDataCmp>();
                                        g.name = "bullet";
                                        LCHBullet bullet = g.AddComponent <LCHBullet>();
                                        hdc0.data.data    = hitData;
                                        hdc0.data.type    = "hit";
                                        contain.isFlyTool = true;
                                        bullet.type       = LCHBullet.TYPE.NORMAL;
                                        bullet.speed      = FlyToolSpeed;
                                        bullet.maxTime    = FlyToolTime;

                                        g.SetActive(true);
                                        contain.gameobject.SetActive(false);
                                    }
                                }
                            }
                            else if (IsFlyTool == 2)
                            {
                                if (contain.type == 3)
                                {
                                    //float FlyToolTime = value.GetValueFloat("FlyToolTime", 20f);
                                    float FlyToolSpeed = value.GetValueFloat("FlyToolSpeed", 2f);
                                    if (null != contain.gameobject)
                                    {
                                        var g = GameObject.Instantiate(contain.gameobject);
                                        LCharacterHitDataCmp hdc0 = g.GetComponent <LCharacterHitDataCmp>();
                                        g.name = "bullet";
                                        LCHBullet bullet = g.AddComponent <LCHBullet>();
                                        hdc0.data.data     = hitData;
                                        hdc0.data.type     = "hit";
                                        contain.isFlyTool  = true;
                                        bullet.type        = LCHBullet.TYPE.FELLOW;
                                        bullet.speed       = FlyToolSpeed;
                                        bullet.curTargetId = curTargetId;

                                        bullet.maxTime = 60f;
                                        g.SetActive(true);
                                        contain.gameobject.SetActive(false);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            else if (res == 0)
            {
                if (null != contain.gameobject)
                {
                    contain.gameobject.SetActive(false);
                }
            }
        }
    }
Ejemplo n.º 4
0
    public static void CmpObjectEvent(float curTime, float lastTime, LCHEventChannelData _e, ObjectContain contain, LChatacterInterface character, LChatacterInformationInterface information,
                                      Dictionary <int, ObjectContain> objs
                                      , CdState cdState
                                      , string cdName
                                      , int skillState

                                      )
    {
        LCHChannelType t = (LCHChannelType)_e.type;
        ObjDictionary  value;
        float          _time;

        if (t == LCHChannelType.Object)
        {
            int res = _e.TryGetKeyFrameRunTime(curTime, lastTime, out value, out _time);
            if (res == 1)
            {
                if (null != contain.gameobject)
                {
                    bool enable = value.GetValue <bool>("enable", true);
                    if (_e.objId == -1)
                    {
                        //因為主對象直接設置 gameObject的Enable,所有腳本都不工作了.
                        if (null != contain.roleRenders)
                        {
                            for (int n = 0; n < contain.roleRenders.Length; n++)
                            {
                                contain.roleRenders[n].enabled = enable;
                            }
                        }
                    }
                    else
                    {
                        if (enable)
                        {
                            contain.gameobject.SetActive(false);
                            contain.gameobject.SetActive(true);

                            /*contain.gameobject.SetActive(enable);
                             * for (int i = 0, l = contain.systems.Length; i < l; i++)
                             * {
                             *  //Debug.Log(contain.systems[i].isStopped);
                             *  contain.systems[i].gameObject.SetActive(false);
                             *  contain.systems[i].gameObject.SetActive(true);
                             *  contain.systems[i].Play(true);
                             * }*/
                        }
                        else
                        {
                            contain.gameobject.SetActive(enable);
                        }

                        //Debug.LogError("_e.objId  " + _e.objId + " " + enable);
                        //contain.gameobject.SetActive(enable);
                    }

                    if (enable)
                    {
                        if (contain.type == 1)
                        {
                            string anim_name = value.GetValue <string>("anim", "");
                            if (anim_name.Length > 0)
                            {
                                if (null == contain.animaction)
                                {
                                    contain.animaction = contain.gameobject.GetComponent <Animation>();
                                }
                                if (null != contain.animaction)
                                {
                                    bool cf = value.GetValue <bool>("crossFade", true);
                                    //crossFade
                                    contain.animaction[anim_name].time = _time;
                                    if (cf)
                                    {
                                        contain.animaction.CrossFade(anim_name, 0.05f);
                                    }
                                    else
                                    {
                                        contain.animaction[anim_name].time = 0f;//特么受击不这么干不重置。。。
                                        contain.animaction.Play(anim_name);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            else if (res == 0)
            {
                if (_e.objId != -1)//非主模型,一开始隐藏
                {
                    if (null != contain.gameobject)
                    {
                        if (contain.objId != -1)
                        {
                            contain.gameobject.SetActive(false);
                        }
                    }
                }
            }
        }
        if (t == LCHChannelType.Event)
        {
            int res = _e.TryGetKeyFrameRunTime(curTime, lastTime, out value, out _time);
            if (res == 1)
            {
                if (contain.type == 2 || contain.type == 3)
                {
                    if (null == contain.collider)
                    {
                        if (null != contain.gameobject)
                        {
                            contain.collider         = contain.gameobject.GetComponent <Collider>();
                            contain.gameobject.layer = character.GetAttackLayer();
                            if (null != contain.collider)
                            {
                                contain.collider.isTrigger = true;
                            }
                        }
                    }
                }
                if (null != contain.gameobject)
                {
                    bool enable = value.GetValue <bool>("enable", true);
                    contain.gameobject.SetActive(enable);
                    if (contain.collider)
                    {
                        contain.collider.enabled = enable;
                        if (enable)
                        {
                            if (null == contain.hitData)
                            {
                                LCharacterHitDataCmp hdc = contain.gameobject.GetComponent <LCharacterHitDataCmp>();
                                if (null == hdc)
                                {
                                    hdc = contain.gameobject.AddComponent <LCharacterHitDataCmp>();
                                }
                                contain.hitData = hdc.data;
                            }

                            contain.hitData.type = "hit";
                            LCharacterHitData hitData = new LCharacterHitData();

                            hitData.hittedObject.Clear();
                            hitData.value       = value;
                            hitData.characterId = character.GetId();
                            hitData.firstHit    = true;

                            hitData.cdName     = cdName;
                            hitData.skillState = skillState;
                            hitData.cdState    = cdState;

                            int effectId = value.GetValueInt("hit_effect", -2);
                            if (effectId != -2 && objs.ContainsKey(effectId))
                            {
                                var ct = objs[effectId];
                                hitData.effect     = ct.mod;
                                hitData.effect_obj = ct.baseGameObject;
                            }
                            else
                            {
                                hitData.effect     = null;
                                hitData.effect_obj = null;
                            }
                            contain.hitData.data = hitData;
                        }
                    }
                }
            }
            else if (res == 0)
            {
                if (null != contain.gameobject)
                {
                    contain.gameobject.SetActive(false);
                }
            }
        }
    }