本文整理汇总了C#中Collider.BroadcastMessage方法的典型用法代码示例。如果您正苦于以下问题:C# Collider.BroadcastMessage方法的具体用法?C# Collider.BroadcastMessage怎么用?C# Collider.BroadcastMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Collider
的用法示例。
在下文中一共展示了Collider.BroadcastMessage方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTriggerEnter
void OnTriggerEnter(Collider player)
{
if (player.gameObject.tag == "Player")
{
player.BroadcastMessage("PortalExitCallback", true);
}
}
示例2: OnTriggerEnter
void OnTriggerEnter(Collider other)
{
if (other.tag == "enemy"){
other.BroadcastMessage("hit", SendMessageOptions.DontRequireReceiver);
Destroy(gameObject);
}
}
示例3: OnTriggerEnter
void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Next")
{
Generador.OK = true;
other.BroadcastMessage("Destruyete", SendMessageOptions.RequireReceiver);
}
}
示例4: OnTriggerEnter
void OnTriggerEnter(Collider coll)
{
if (activated)
{
coll.BroadcastMessage("AAShot", SendMessageOptions.DontRequireReceiver);
Destroy(gameObject);
}
}
示例5: Start
/*
public GameObject playerOne;
public GameObject playerTwo;
private IKillable playerOneKill;
private IKillable playerTwoKill;
//public LevelController Controller;
void Start ()
{
//Get the script of players that does the Killing
playerOneKill = (IKillable)playerOne.GetComponent(typeof(IKillable));
playerTwoKill = (IKillable)playerTwo.GetComponent(typeof(IKillable));
}
void Update ()
{
}
*/
void OnTriggerEnter(Collider player)
{
if (player.gameObject.tag == "Player")
{
player.BroadcastMessage("KillPlayerCallback", player.transform.position);
Player lets = player.gameObject.GetComponent<Player>();
lets.Kill();
}
}
示例6: OnTriggerStay
void OnTriggerStay(Collider other)
{
if (other.tag == "Entity" && Input.GetButtonDown("Jump") && grabbedObject == null) {
print("GRAB");
other.BroadcastMessage("Grab", grabber);
grabbedObject = other.gameObject;
throwable = true;
}
}
示例7: OnTriggerEnter
void OnTriggerEnter(Collider other)
{
if(other.CompareTag("Player"))
{
if(!singleUse || (singleUse && !used))
{
other.BroadcastMessage("StartDialogue", speakToIndex);
if(singleUse)
used = true;
}
}
}
示例8: OnTriggerEnter
void OnTriggerEnter(Collider other)
{
other.BroadcastMessage("Hit", -damage,SendMessageOptions.DontRequireReceiver);
owner.RaiseAttackLanded(owner.attackIndex);
Destroy(this.gameObject);
}
示例9: OnTriggerStay
void OnTriggerStay(Collider col)
{
if (col.gameObject.tag == "Player")
{
// Fog
if (fogChange)
{
startFog = fog.heightDensity;
fogLerp = 0;
}
}
// Memory
if (memory && memoryRetrigger <= 0 && !thisMemTriggered)
{
if (memoryEventNumber == EventManager.inst.currentMemory || memoryEventNumber <= 1)
{
EventManager.inst.subtitleNum = subtitleNum;
EventManager.inst.memoryPlaying = true;
dialogueAudio.clip = memoryDialogue;
dialogueAudio.Play();
memoryDuration = memoryDialogue.length - endEarlyTimer;
col.BroadcastMessage("EnterMemory", memoryDuration);
col.BroadcastMessage("NightCheck", nightTime);
col.BroadcastMessage("SetSwitch", switchObjects);
col.BroadcastMessage("ExtraDim", extraDiminish);
if (disableControls)
{
col.BroadcastMessage("DisableControls", true);
}
if (newBGM != null)
{
col.BroadcastMessage("SetBGM", newBGM);
}
if (memoryObj != null)
{
memoryObj.SetActive(true);
startTimer = true;
}
Invoke("DelayedMemoryPlaying", 2f);
memoryRetrigger = 1f;
}
}
if (!EventManager.inst.memoryPlaying) {
memoryRetrigger -= Time.deltaTime;
} else
{
thisMemTriggered = true;
}
}
示例10: OnTriggerEnter
void OnTriggerEnter(Collider col)
{
if (col.gameObject.tag == "Player" && !triggered)
{
triggered = true;
// Credits
if (credits)
{
exhaustion.GetComponent<Exhaustion>().enabled = false;
EventManager.inst.credits = true;
col.BroadcastMessage("LoadCredits", true);
endMemLerp.enabled = true;
}
// Checkpoint
if (checkpoint)
{
EventManager.inst.currentCheckPoint = checkpointNo;
}
// Enemy
if (enemyTrigger)
{
enemy.SetActive(true);
}
// End Level
if (endLevel)
{
EventManager.inst.currentLevel = setLevel;
EventManager.inst.currentCheckPoint = 0;
if (loadScreenUI != null)
{
loadScreenUI.SetActive(true);
}
StartCoroutine("LoadNextScene");
}
}
}