コード例 #1
0
ファイル: SoundControl.cs プロジェクト: mrd875/406-2021-farm
    public static void PlayStartSound()
    {
        StartSound soundSource = GameObject.FindObjectOfType <StartSound>();

        soundSource.GetComponent <AudioSource>().volume = soundEffectVolume * 0.3f;
        soundSource.GetComponent <AudioSource>().Play();
    }
コード例 #2
0
 void Awake()
 {
     Debug.Log("Music awake" + GetInstanceID());
     if (m_instance == null)
     {
         m_instance = this;
         GameObject.DontDestroyOnLoad(gameObject);
     }
     else
     {
         GameObject.Destroy(gameObject);
     }
 }
コード例 #3
0
ファイル: MovieDecoder.cs プロジェクト: heon21st/flashdevelop
		public override void  startSound(StartSound tag)
		{
			frame.controlTags.Add(tag);
		}
コード例 #4
0
    protected virtual void HXTanShe2()
    {
        //print(" 为什么一直进来 HXTanShe2********************************************************** ");
        if (GetComponent <RoleDate>().isBeHiting || GetComponent <RoleDate>().isDie || GetComponent <GameBody>().IsHitWall)
        {
            //print("  IsHitWall " + GetComponent<GameBody>().IsHitWall + "  ------IsGround  " + GetComponent<GameBody>().IsGround);
            //ChongjiOver();

            //print("cj  被攻击 或者die ---或者 撞墙   Over!! ");

            ReSetAll();
            return;
        }


        if (!IsStartChongji && GetComponent <AirGameBody>().GetDB().animation.HasAnimation(ACName_ChongjiBegin) && GetComponent <AirGameBody>().GetDB().animation.HasAnimation(ACName_ChongjiStart))
        {
            //if (!IsStartChongji && !IsGenZongType)
            //{
            //    IsStartChongji = true;
            //}

            //print(" 准备阶段 横向冲击 acName: "+_airGameBody.GetDB().animation.lastAnimationName);

            float __x = 0;
            if (GetComponent <AirGameBody>().GetDB().animation.lastAnimationName != ACName_ChongjiBegin && GetComponent <AirGameBody>().GetDB().animation.lastAnimationName != ACName_ChongjiStart)
            {
                __x = this.transform.position.x > _targetObj.position.x ? this.transform.position.x - HXChongjiDis : this.transform.position.x + HXChongjiDis;

                targetPos = new Vector2(__x, this.transform.position.y);
                //转向
                //朝向

                _airGameBody.GetPlayerRigidbody2D().velocity = Vector2.zero;
                if (this.transform.position.x < targetPos.x)
                {
                    _airGameBody.TurnRight();
                }
                else
                {
                    _airGameBody.TurnLeft();
                }

                if (!CJhitKuai.activeSelf)
                {
                    CJhitKuai.SetActive(true);
                    _jnDate.atkPower = SkillPower;
                }

                if (ZiShenhitKuai.activeSelf)
                {
                    ZiShenhitKuai.SetActive(false);
                }

                //print("wo kao!!!!!!!!!");
                if (GetComponent <JN_Date>())
                {
                    GetComponent <JN_Date>().HitInSpecialEffectsType = 1;
                }
                //print("start!!!   ACName_ChongjiBegin " + ACName_ChongjiBegin+ " lastAnimationName:   " + GetComponent<AirGameBody>().GetDB().animation.lastAnimationName);

                if (StartSound)
                {
                    StartSound.Play();
                }
                _airGameBody.isAcing = true;
                _airGameBody.GetDB().animation.Stop();
                //_airGameBody.GetDB().animation.GotoAndStopByFrame(ACName_ChongjiBegin);
                //****************不要用 FadeIn  有bug 会卡主 游戏****************
                _airGameBody.GetDB().animation.FadeIn(ACName_ChongjiBegin, 0.1f);

                deltaNums = 0;
                return;
            }


            if (GetComponent <AirGameBody>().GetDB().animation.lastAnimationName == ACName_ChongjiBegin)
            {
                CJYanchiNums += Time.deltaTime;


                //print("  播放进度 "+ GetComponent<AirGameBody>().GetDB().animation.GetState(ACName_ChongjiBegin));
                //if (GetComponent<AirGameBody>().GetDB().animation.isCompleted) GetComponent<AirGameBody>().GetDB().animation.Stop();


                //print("  冲击准备阶段  CJYanchiNums   " + CJYanchiNums + "   GetComponent<AirGameBody>().GetDB().animation  " + GetComponent<AirGameBody>().GetDB().animation.lastAnimationName);
                if (CJYanchiNums >= CJYanchiTime)
                {
                    _airGameBody.isAcing = true;
                    _airGameBody.GetDB().animation.FadeIn(ACName_ChongjiStart);
                    IsStartChongji = true;

                    print("  KAISHI CHONGJI!!!!!!!!   ");

                    //判断 是否 碰到地板

                    if (_gameBody.IsHitWall)
                    {
                        targetPos = new Vector2(targetPos.x, this.transform.position.y + 2);
                    }
                    else
                    {
                        if (ChoseYPosType == 1)
                        {
                            //有一定的 Y偏移
                            if (_targetObj.position.y > this.transform.position.y)
                            {
                                targetPos = new Vector2(targetPos.x, this.transform.position.y + YPianyi);
                            }
                            else if (_targetObj.position.y < this.transform.position.y)
                            {
                                targetPos = new Vector2(targetPos.x, this.transform.position.y - YPianyi);
                            }
                        }
                        else if (ChoseYPosType == 2)
                        {
                            //直线
                            targetPos = new Vector2(targetPos.x, this.transform.position.y);
                        }
                    }
                }
                return;
            }
        }


        if (!IsStartChongji)
        {
            return;
        }

        //print("lastAnimationName   " + _airGameBody.GetDB().animation.lastAnimationName+ "   isAcing    "+ _airGameBody.isAcing);
        //print("  是否撞墙   "+ _airGameBody.IsHitWall+"  持续时间      "+ deltaNums+ "  _tsTimes   "+ _tsTimes);
        deltaNums += Time.deltaTime;
        //print("冲击的时候 自己的 速度是多少  " + _gameBody.GetPlayerRigidbody2D().velocity.x+ "     ---- deltaNums   " + deltaNums+"  ???  "+ _tsTimes * 0.6f);

        if (GetComponent <AIAirRunNear>().MoveToPoint(targetPos, 0.1f, chongjiSpeed, false, false, MaxChongjiSpeed))
        {
            print(" cj 靠近点了 ");
        }

        if (_airGameBody.IsHitWall)
        {
            print(" cj 撞墙了!!! ");
        }

        if (deltaNums >= _tsTimes * 0.6f && MinStopSpeed != 0 && Mathf.Abs(_gameBody.GetPlayerRigidbody2D().velocity.x) <= MinStopSpeed)
        {
            print("cj 3333333333   " + deltaNums + "     " + _tsTimes * 0.6f);
            print(" MinStopSpeed   " + MinStopSpeed);
        }

        if (IsOutChongjiDistance())
        {
            print(" cj  IsOutChongjiDistance ");
        }


        if (deltaNums >= _tsTimes || IsOutChongjiDistance() || GetComponent <AIAirRunNear>().MoveToPoint(targetPos, 0.1f, chongjiSpeed, false, false, MaxChongjiSpeed) || _airGameBody.IsHitWall || (deltaNums >= _tsTimes * 0.6f && MinStopSpeed != 0 && Mathf.Abs(_gameBody.GetPlayerRigidbody2D().velocity.x) <= MinStopSpeed))
        {
            if (deltaNums >= _tsTimes)
            {
                print("  超出 冲击 时间   ");
            }
            //if (IsOutChongjiDistance()) print("超出 冲击 距离结束");
            if (_airGameBody.IsHitWall)
            {
                print("撞墙 结束!!!");
            }
            //print("**************************************************到达目标Ian附近 结束!!!");
            //print(">>>>????????  冲击over  " + "  @@@@@@  deltaNums   " + deltaNums + "  _tsTimes  " + _tsTimes);

            print("cj  速度  " + Mathf.Abs(_gameBody.GetPlayerRigidbody2D().velocity.x) + "   MinStopSpeed " + MinStopSpeed);


            if (CJhitKuai)
            {
                CJhitKuai.SetActive(false);
            }
            ChongjiOver();
            if (!ZiShenhitKuai.activeSelf)
            {
                ZiShenhitKuai.SetActive(true);
            }
            ReSetAll();
        }

        if (CJYanmu)
        {
            CJYanmu.Play();
        }
    }
コード例 #5
0
		public override void  startSound(StartSound tag)
		{
			int idref = dict.getId(tag.sound);
			tagw.writeUI16(idref);
			encodeSoundInfo(tag.soundInfo, tagw);
			encodeTag(tag);
		}
コード例 #6
0
 public override void  startSound(StartSound tag)
 {
     frame.controlTags.Add(tag);
 }
コード例 #7
0
 void Awake()
 {
     sound = GameObject.Find("StartBG").GetComponent <StartSound>();
 }
コード例 #8
0
        public void Save(int moveNum)
        {
            if (!Directory.Exists(Paths.DataPath + "Move"))
            {
                Directory.CreateDirectory(Paths.DataPath + "Move");
            }
            using (XmlWriter writer = XmlWriter.Create(Paths.DataPath + "Move\\" + moveNum + ".xml", Logger.XmlWriterSettings)) {
                writer.WriteStartDocument();
                writer.WriteStartElement("MoveEntry");

                #region Basic data
                writer.WriteStartElement("General");
                writer.WriteElementString("Name", Name);
                writer.WriteElementString("Description", Desc);
                writer.WriteElementString("PP", PP.ToString());
                writer.WriteElementString("Type", Type.ToString());
                writer.WriteElementString("Category", Category.ToString());
                writer.WriteElementString("Contact", Contact.ToString());
                writer.WriteElementString("SoundBased", SoundBased.ToString());
                writer.WriteElementString("FistBased", FistBased.ToString());
                writer.WriteElementString("PulseBased", PulseBased.ToString());
                writer.WriteElementString("BulletBased", BulletBased.ToString());
                writer.WriteElementString("JawBased", BulletBased.ToString());
                writer.WriteElementString("Power", Power.ToString());
                writer.WriteElementString("Accuracy", Accuracy.ToString());
                writer.WriteElementString("Effect", Effect.ToString());
                writer.WriteElementString("Effect1", Effect1.ToString());
                writer.WriteElementString("Effect2", Effect2.ToString());
                writer.WriteElementString("Effect3", Effect3.ToString());
                writer.WriteElementString("HitsSelf", Range.HitsSelf.ToString());
                writer.WriteElementString("HitsFriend", Range.HitsFriend.ToString());
                writer.WriteElementString("HitsFoe", Range.HitsFoe.ToString());
                writer.WriteElementString("Range", Range.RangeType.ToString());
                writer.WriteElementString("Mobility", Range.Mobility.ToString());
                writer.WriteElementString("CutsCorners", Range.CutsCorners.ToString());
                writer.WriteElementString("Distance", Range.Distance.ToString());
                writer.WriteStartElement("StartAnim");
                StartAnim.Save(writer);
                writer.WriteEndElement();
                writer.WriteStartElement("StartUserAnim");
                StartUserAnim.Save(writer);
                writer.WriteEndElement();
                writer.WriteElementString("StartSound", StartSound.ToString());
                writer.WriteStartElement("MidAnim");
                MidAnim.Save(writer);
                writer.WriteEndElement();
                writer.WriteStartElement("MidUserAnim");
                MidUserAnim.Save(writer);
                writer.WriteEndElement();
                writer.WriteStartElement("MidTargetAnim");
                MidTargetAnim.Save(writer);
                writer.WriteEndElement();
                writer.WriteElementString("MidSound", MidSound.ToString());
                writer.WriteStartElement("EndAnim");
                EndAnim.Save(writer);
                writer.WriteEndElement();
                writer.WriteStartElement("EndUserAnim");
                EndUserAnim.Save(writer);
                writer.WriteEndElement();
                writer.WriteStartElement("EndTargetAnim");
                EndTargetAnim.Save(writer);
                writer.WriteEndElement();
                writer.WriteElementString("EndSound", EndSound.ToString());
                writer.WriteEndElement();
                #endregion

                writer.WriteEndElement();
                writer.WriteEndDocument();
            }
        }
コード例 #9
0
 public override void  startSound(StartSound tag)
 {
     tags.Add(tag);
 }
コード例 #10
0
		public override void  startSound(StartSound tag)
		{
			open(tag);
			out_Renamed.Write(" soundid='" + idRef(tag.sound) + "'");
			printSoundInfo(tag.soundInfo);
			close(tag);
		}
コード例 #11
0
 public virtual void  startSound(StartSound tag)
 {
 }