當前位置: 首頁>>代碼示例>>C#>>正文


C# Component.SendMessage方法代碼示例

本文整理匯總了C#中UnityEngine.Component.SendMessage方法的典型用法代碼示例。如果您正苦於以下問題:C# Component.SendMessage方法的具體用法?C# Component.SendMessage怎麽用?C# Component.SendMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UnityEngine.Component的用法示例。


在下文中一共展示了Component.SendMessage方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Call

 public void Call(Component caller)
 {
     caller.SendMessage(function, SendMessageOptions.DontRequireReceiver);
 }
開發者ID:ninjapretzel,項目名稱:zsharp,代碼行數:4,代碼來源:GUIF.cs

示例2: Trigger

    // ------------------------------------------------------------------ 
    /// Calls the method named methodName on every Component target game object.
    // ------------------------------------------------------------------ 

    public void Trigger (Component _target, exSpriteAnimationClip.EventInfo _event) {
        if (_event.methodName == "")
            return;
        switch (_event.paramType) {
        case exSpriteAnimationClip.EventInfo.ParamType.None:
            _target.SendMessage(_event.methodName, _event.msgOptions);
            break;
        case exSpriteAnimationClip.EventInfo.ParamType.String:
            _target.SendMessage(_event.methodName, _event.stringParam, _event.msgOptions);
            break;
        case exSpriteAnimationClip.EventInfo.ParamType.Float:
            _target.SendMessage(_event.methodName, _event.floatParam, _event.msgOptions);
            break;
        case exSpriteAnimationClip.EventInfo.ParamType.Int:
            _target.SendMessage(_event.methodName, _event.intParam, _event.msgOptions);
            break;
        case exSpriteAnimationClip.EventInfo.ParamType.Bool:
            _target.SendMessage(_event.methodName, _event.boolParam, _event.msgOptions);
            break;
        case exSpriteAnimationClip.EventInfo.ParamType.Object:
            _target.SendMessage(_event.methodName, _event.objectParam, _event.msgOptions);
            break;
        }
    }
開發者ID:knoxHuang,項目名稱:ex2d-dev,代碼行數:28,代碼來源:exSpriteAnimation.cs

示例3: FadeInCoroutine

    /// <summary>
    /// Coroutine to fade the scene in from whatever opacity the fader 
    /// was at. Use FadeIn to do this. 
    /// </summary>
    /// <param name="caller"></param>
    /// <returns></returns>
    private IEnumerator FadeInCoroutine(Component caller)
    {
        fading = true;

        while (gt.color.a > 0)
        {
            Color tempColor = gt.color;
            ChangeAlpha(ref tempColor, -fadeSpeed * Time.deltaTime);
            gt.color = tempColor;
            yield return null;
        }

        caller.SendMessage("OnFadeFinish");
        fading = false;
    }
開發者ID:Bungee54,項目名稱:symposium2016,代碼行數:21,代碼來源:ScreenFader.cs


注:本文中的UnityEngine.Component.SendMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。