当前位置: 首页>>代码示例>>C#>>正文


C# Message.AddMessage方法代码示例

本文整理汇总了C#中Message.AddMessage方法的典型用法代码示例。如果您正苦于以下问题:C# Message.AddMessage方法的具体用法?C# Message.AddMessage怎么用?C# Message.AddMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Message的用法示例。


在下文中一共展示了Message.AddMessage方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GobackTimeLine

 public void GobackTimeLine()
 {
     Message msg = new Message();
     msg.AddMessage("item", item);
     EventManager.Instance.PostEvent(EventDefine.GET_ITEM, msg);
     Application.LoadLevel("TimeLine");
 }
开发者ID:fdu5526,项目名称:balloon,代码行数:7,代码来源:Goback.cs

示例2: OnClick

    public void OnClick(string name )
    {
        Debug.Log("Click " + name );
        Message msg = new Message();
        msg.AddMessage("name", name);
        EventManager.Instance.PostEvent(EventDefine.TL_PRESS_BUTTON, msg);

        if (name == "Cone")
        {
            SpriteAction sa = coneEffect.GetComponent<SpriteAction>();
            SpriteRenderer render = coneEffect.GetComponent<SpriteRenderer>();

            render.color = new Color(Random.Range(0.5f , 1f) , Random.Range(0.5f , 1f) , Random.Range(0.5f , 1f) , 0.5f );
            sa.Do();
        }
        if (name == "Bubble")
        {
            bubbleEffect.enableEmission = true;
        }
        if (name == "Flower")
        {
            AudioSource[] audios = flowerEffect.GetComponents<AudioSource>();
            audios[Random.Range(0, audios.Length)].Play();
        }
    }
开发者ID:fdu5526,项目名称:balloon,代码行数:25,代码来源:SceneTL.cs

示例3: BeginState

    public virtual void BeginState()
    {
        Debug.Log("Begin State " + name);
        type = "state";
        Message msg = new Message();
        msg.AddMessage("name", name );
        EventManager.Instance.PostEvent(EventDefine.BEGIN_STATE, msg );

        // if ( SetNext(Global.TRANS_TO_COLUMN_NAME) )
        // {
        // 	// Debug.Log("Trans");
        // 	Message msg = new Message();
        // 	msg.AddMessage("scene", GetTransformScene());
        // 	msg.AddMessage("time", GetTransformTime());

        // 	// Debug.Log(GetTransformScene() + " " + GetTransformTime().ToString() );
        // 	EventManager.Instance.PostEvent(EventDefine.FLY_TO,msg);
        // } else if ( SetNext(Global.AUTO_NEXT_COLUMN_NAME) )
        // {
        // 	// Debug.Log("Auto next");
        // 	if (GetTime() >= 0 )
        // 	{
        // 		//Auto Time Next
        // 		int delay = (int)(GetTime()*1000f);
        // 		Debug.Log( name + "delay for " + delay.ToString());

        // 		System.Threading.Thread.Sleep(delay);

        // 		EventManager.Instance.PostEvent(EventDefine.NEW_TIME_STEP);
        // 	}

        // 	machine.Goto();
        // }
        // 		return false;)
    }
开发者ID:fdu5526,项目名称:balloon,代码行数:35,代码来源:StateMachine.cs

示例4: Update

	void Update()
	{
		if (Input.GetKey(KeyCode.Alpha1))
		{
			ClossAllLevel();
			levels[0].SetActive(true);
			Message msg = new Message();
			msg.AddMessage("time", 1);
			EventManager.Instance.PostEvent(EventDefine.RenewSwipeTime, msg);
		}

		if (Input.GetKey(KeyCode.Alpha2))
		{
			ClossAllLevel();
			levels[1].SetActive(true);
			Message msg = new Message();
			msg.AddMessage("time", 3);
			EventManager.Instance.PostEvent(EventDefine.RenewSwipeTime, msg);
		}

		if (Input.GetKey(KeyCode.Alpha3))
		{
			ClossAllLevel();
			levels[2].SetActive(true);
			Message msg = new Message();
			msg.AddMessage("time", 1);
			EventManager.Instance.PostEvent(EventDefine.RenewSwipeTime, msg);
		}
	}
开发者ID:AtwoodDeng,项目名称:Dandelion,代码行数:29,代码来源:TestManager.cs

示例5: AddNewRobotCreator

    public void AddNewRobotCreator( RobotCreatInfo info )
    {
        info.teamColor = TeamColor.Blue;
        info.initPos = BlueTeamInitPos;
        RobotCreateControllor newRCC = new RobotCreateControllor(info);
        RCCList.Add(newRCC);

        Message msg = new Message();
        msg.AddMessage("Controller" , newRCC);
        EventManager.Instance.PostEvent(EventDefine.NewCreateController, msg);
    }
开发者ID:AtwoodDeng,项目名称:miniRTS,代码行数:11,代码来源:ObjectCreatManager.cs

示例6: OnTriggerEnter2D

 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.GetComponent<Character>() != null )
     {
         Message msg = new Message();
         foreach(MsgPairStr pair in msgs)
         {
             msg.AddMessage(pair.key, pair.content );
         }
         EventManager.Instance.PostEvent(eventName, msg, this);
     }
 }
开发者ID:fdu5526,项目名称:balloon,代码行数:12,代码来源:CharacterEnterEvent.cs

示例7: OnTriggerStay2D

 void OnTriggerStay2D(Collider2D other)
 {
     if (canLeave && Input.GetKeyDown("space")) {
         if (dialogues == null) {
             Init();
         }
         if (currentDialogue != dialogues.Length) {
             NextDialogue();
         } else {
             Message msg = new Message();
             msg.AddMessage("Character", "Begin");
             EventManager.Instance.PostEvent(EventDefine.TALK_TO, msg);
         }
     }
 }
开发者ID:fdu5526,项目名称:balloon,代码行数:15,代码来源:BeginBalloon.cs

示例8: showDialog

    public void showDialog(string character , string words)
    {
        textOutline.enabled = false;
        if (words.StartsWith("[HL]"))
        {
            textOutline.enabled = true;
            words = words.Remove(0, 4);
        }
        Debug.Log(gameObject.name + " show dialog " + character + " : " + words + " isShowing " + isShowing.ToString());

        text.text = character + ":\r\n" + words;

        Message msg = new Message();
        msg.AddMessage("dialog", dialogName);
        EventManager.Instance.PostEvent(EventDefine.BEGIN_DIALOG,msg);
    }
开发者ID:fdu5526,项目名称:balloon,代码行数:16,代码来源:DialogFrame.cs

示例9: EndShow

    void EndShow()
    {
        isShowing = false;
        Debug.Log("End Show");

        Message msg = new Message();
        msg.AddMessage("dialog", dialogName);
        EventManager.Instance.PostEvent(EventDefine.END_DIALOG,msg);

        back.DOFade(0f, fadeTime);
        text.DOFade(0f, fadeTime);
    }
开发者ID:fdu5526,项目名称:balloon,代码行数:12,代码来源:DialogFrame.cs

示例10: Blow

	virtual public void Blow(Vector2 velocity )
	{
		if ( canBlow() )
		{
			Message msg = new Message();
			msg.AddMessage("Flower" , this );

			if ( useChance )
			{
				int blow = 0;
				foreach(Petal petal in petals)
				{
					if (petal.state == PetalState.Link && Random.Range(0, 1f) < blowChance)
					{
						if (Random.Range(0, 1f) < flyAwayChance) {
							petal.Blow( (velocity.normalized + 0.6f * Global.GetRandomDirection()) * velocity.magnitude , Petal.BlowType.FlyAway);
						}
						else {
							msg.AddMessage("petal" + blow.ToString() , petal );
							blow++;
							petal.Blow( ( velocity.normalized + Random.Range(0,0.4f) * Global.GetRandomDirection() ) * velocity.magnitude , Petal.BlowType.Normal);
						}
						petal.transform.parent = LogicManager.Level.transform;
					}
				}
			}else{
				int blow = 0 ;
				for ( int i = 0 ; blow < blowNumber && i < petals.Count ; ++ i )
				{
					if ( petals[i].state == PetalState.Link )
					{
						petals[i].Blow( (velocity.normalized + Random.Range(0,0.4f) * Global.GetRandomDirection()) * velocity.magnitude , Petal.BlowType.Normal );
						petals[i].transform.parent = LogicManager.Level.transform;
				
						msg.AddMessage("petal" + blow.ToString() , petals[i] );
						blow ++;
					}
				}

				for ( int i = blowNumber ; i < petals.Count ; ++ i )
				{
					if ( petals[i].state == PetalState.Link && Random.Range(0, 1f) < blowChance )
					{
						petals[i].Blow( (velocity.normalized + 0.6f * Global.GetRandomDirection()) * velocity.magnitude , Petal.BlowType.FlyAway );
						petals[i].transform.parent = LogicManager.Level.transform;
					}
				}
			}


			EventManager.Instance.PostEvent( EventDefine.BlowFlower , msg );
		}


	}
开发者ID:AtwoodDeng,项目名称:Dandelion,代码行数:55,代码来源:Flower.cs

示例11: ShowFlyTo

    IEnumerator ShowFlyTo( string scene, float duration = -1f )
    {
        Debug.Log("fly to " + scene + " " + duration.ToString());
        float timer=0;

          //   	if (SceneTL.Instance != null)
          //   	{
        // 	Image skyBackground = SceneTL.Instance.skyBackground;
        // 	Image balloon = SceneTL.Instance.balloon;
        // 	skyBackground.gameObject.SetActive(true);
        // 	skyBackground.DOFade(1.0f, 1f);
        // 	balloon.gameObject.SetActive(true);
        // 	balloon.DOFade(1.0f, 1f);

        // 	Animator ballAnimator = balloon.gameObject.GetComponent<Animator>();
        // 	ballAnimator.SetTrigger("Fly");
        // }

        if ( SceneTL.Instance != null )
        {
            while(true)
            {
                timer += Time.deltaTime;

                if (timer > SceneTL.Instance.whiteAction.GetDuration())
                {
                    break;
                }

                yield return null;
            }

            MakeTransform("FlyTo");
        }

        timer =0;

        if (duration < 0 ) duration = flyTime;
        while(true)
        {
            timer += Time.deltaTime;

            if ( timer > duration)
            {
                MakeTransform(scene);

                while (true)
                {
                    if ( Application.loadedLevelName == scene)
                        break;
                    yield return null;
                }
                Message msg = new Message();
                msg.AddMessage("scene", scene);
                EventManager.Instance.PostEvent(EventDefine.FLY_TO_END, msg);
                yield break;
            }

            yield return null;
        }
    }
开发者ID:fdu5526,项目名称:balloon,代码行数:61,代码来源:TLLogicManager.cs

示例12: ShowLeaveIsland

    protected IEnumerator ShowLeaveIsland(string scene , float duration = -1f)
    {
        float timer = 0;

        if (duration < 0 ) duration = flyTime;

        MakeTransform("FlyBack");

        while(true)
        {
            timer += Time.deltaTime;

            if ( timer > duration)
            {
                MakeTransform("TimeLine");

                while (true)
                {
                    if ( Application.loadedLevelName == "TimeLine")
                        break;
                    yield return null;
                }
                Message msg = new Message();
                msg.AddMessage("scene", scene);
                EventManager.Instance.PostEvent(EventDefine.LEAVE_ISLAND_END, msg);

                stateMachine.OnLeaveIsland();

                yield break;
            }

            yield return null;
        }
    }
开发者ID:fdu5526,项目名称:balloon,代码行数:34,代码来源:TLLogicManager.cs

示例13: SendGrowMessage

	virtual protected void SendGrowMessage(Vector3 position,Transform parent)
	{
		Message growMsg = new Message();
		myGrowInfo.position = position;
		myGrowInfo.parent = parent;
		growMsg.AddMessage("info", myGrowInfo);
		EventManager.Instance.PostEvent(EventDefine.GrowFlowerOn, growMsg,this);
	}
开发者ID:AtwoodDeng,项目名称:Dandelion,代码行数:8,代码来源:Petal.cs

示例14: GrowFlowerPatalCor

	IEnumerator GrowFlowerPatalCor(int num)
	{
		flowerPetals = new Petal3D[num];

		if ( flowerGrowSound != null )
		{
			flowerGrowSound.pitch = LogicManager.AnimTimeRate;
			flowerGrowSound.Play();
		}
		float maxGrowTime = 0.5f ;
		for(int i = 0 ; i < num ; ++ i )
		{
			GameObject prefab = (growParameter.petalType == PetalType.Final )? FlowerPetalFinalPrefab : FlowerPetalPrefab;
			GameObject fPetalObj = Instantiate( prefab ) as GameObject;
			fPetalObj.transform.SetParent( petalRoot );
			fPetalObj.transform.localPosition = Vector3.zero;
			fPetalObj.transform.localScale = Vector3.one;

			flowerPetals[i] = fPetalObj.GetComponent<Petal3D>();
			if ( flowerPetals[i] != null )
			{
				flowerPetals[i].Init( this , i ) ;
			}
				
			maxGrowTime = Mathf.Max( maxGrowTime , flowerPetals[i].GetGrowTime() );
		}
		yield return new WaitForSeconds(maxGrowTime / LogicManager.AnimTimeRate);

		if ( growParameter.petalType == PetalType.Final ) 
		{
			Message msg = new Message();
			msg.AddMessage( "flower" , this );
			Debug.Log("Grow Final Flower");
			EventManager.Instance.PostEvent(EventDefine.GrowFinalFlower , msg );
			yield break;
		}else
		{
			if ( flowerFlyAwaySound != null )
			{
				flowerFlyAwaySound.pitch = LogicManager.AnimTimeRate;
				flowerFlyAwaySound.Play();
			}

			for ( int i = 0 ; i < flowerPetals.Length ; ++ i )
			{
				flowerPetals[i].Blow( Vector2.right + 0.4f * Global.GetRandomDirection().normalized , 0 , Petal.BlowType.FlyAway );
				yield return new WaitForSeconds(grow3DPara.flowerPetalUnlinkInterval / LogicManager.AnimTimeRate );
			}

			if ( petalGrowSound != null )
			{
				petalGrowSound.pitch = LogicManager.AnimTimeRate;
				petalGrowSound.Play();
			}

			StartCoroutine(GrowPetalCor());

		}
	}
开发者ID:AtwoodDeng,项目名称:Dandelion,代码行数:59,代码来源:Flower3D.cs


注:本文中的Message.AddMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。