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


C# Collider.BroadcastMessage方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:rajabala,项目名称:ggj14_guidance,代码行数:7,代码来源:PortalExit.cs

示例2: OnTriggerEnter

 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "enemy"){
         other.BroadcastMessage("hit", SendMessageOptions.DontRequireReceiver);
         Destroy(gameObject);
     }
 }
开发者ID:ConcoMB,项目名称:Concord,代码行数:7,代码来源:bullet.cs

示例3: OnTriggerEnter

 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Next")
     {
         Generador.OK = true;
         other.BroadcastMessage("Destruyete", SendMessageOptions.RequireReceiver);
     }
 }
开发者ID:hagi07,项目名称:Cerlol,代码行数:8,代码来源:Killer.cs

示例4: OnTriggerEnter

 void OnTriggerEnter(Collider coll)
 {
     if (activated)
     {
         coll.BroadcastMessage("AAShot", SendMessageOptions.DontRequireReceiver);
         Destroy(gameObject);
     }
 }
开发者ID:NWin95,项目名称:Guerrilla,代码行数:8,代码来源:AAShot.cs

示例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();
        }
    }
开发者ID:rajabala,项目名称:ggj14_guidance,代码行数:30,代码来源:KillPlayer.cs

示例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;
     }
 }
开发者ID:wavioli,项目名称:evolution,代码行数:9,代码来源:PlayerMovement.cs

示例7: OnTriggerEnter

 void OnTriggerEnter(Collider other)
 {
     if(other.CompareTag("Player"))
     {
         if(!singleUse || (singleUse && !used))
         {
             other.BroadcastMessage("StartDialogue", speakToIndex);
             if(singleUse)
                 used = true;
         }
     }
 }
开发者ID:JGaddes,项目名称:GDS210_TheKillerMonkeys,代码行数:12,代码来源:Interact.cs

示例8: OnTriggerEnter

 void OnTriggerEnter(Collider other)
 {
     other.BroadcastMessage("Hit", -damage,SendMessageOptions.DontRequireReceiver);
     owner.RaiseAttackLanded(owner.attackIndex);
     Destroy(this.gameObject);
 }
开发者ID:slayer3600,项目名称:sproj,代码行数:6,代码来源:DamageArea.cs

示例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;
        }
    }
开发者ID:BenjaminLovegrove,项目名称:ATR,代码行数:56,代码来源:TriggerManager.cs

示例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");
            }

        }
    }
开发者ID:BenjaminLovegrove,项目名称:ATR,代码行数:42,代码来源:TriggerManager.cs


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