本文整理汇总了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");
}
示例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();
}
}
示例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;)
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
示例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);
}
示例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 );
}
}
示例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;
}
}
示例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;
}
}
示例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);
}
示例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());
}
}