public new Rect RenderEvent(Rect myArea, USEventBase thisEvent)
    {
        USMatchObjectEvent matchObjectEvent = thisEvent as USMatchObjectEvent;

        if (!matchObjectEvent)
            Debug.LogWarning("Trying to render an event as a USMatchObjectEvent, but it is a : " + thisEvent.GetType().ToString());

        thisEvent.Duration = matchObjectEvent.inCurve[matchObjectEvent.inCurve.length-1].time;

        // Draw our Whole Box.
        if (thisEvent.Duration > 0)
        {
            float endPosition = USControl.convertTimeToEventPanePosition(thisEvent.Firetime + thisEvent.Duration);
            myArea.width = endPosition - myArea.x;
        }
        DrawDefaultBox(myArea, thisEvent);

        GUILayout.BeginArea(myArea);
        {
            GUILayout.Label(thisEvent.name, defaultBackground);

            if(matchObjectEvent.objectToMatch != null)
                GUILayout.Label(matchObjectEvent.objectToMatch.name, defaultBackground);
            else
                GUILayout.Label("NULL", defaultBackground);
        }
        GUILayout.EndArea();

        return myArea;
    }
    public new Rect RenderEvent(Rect myArea, USEventBase thisEvent)
    {
        USLookAtObjectEvent lookAtObjectEvent = thisEvent as USLookAtObjectEvent;

        if (!lookAtObjectEvent)
            Debug.LogWarning("Trying to render an event as a USLookAtObjectEvent, but it is a : " + thisEvent.GetType().ToString());

        float fadeInStartTime = lookAtObjectEvent.Firetime;
        float fadeInEndTime = lookAtObjectEvent.Firetime + lookAtObjectEvent.inCurve[lookAtObjectEvent.inCurve.length-1].time;

        float fadeOutStartTime = fadeInEndTime + lookAtObjectEvent.lookAtTime;
        float fadeOutEndTime = fadeOutStartTime + lookAtObjectEvent.outCurve[lookAtObjectEvent.outCurve.length-1].time;

        thisEvent.Duration = fadeOutEndTime - fadeInStartTime;

        lookAtObjectEvent.lookAtTime = Mathf.Max(lookAtObjectEvent.lookAtTime, 0.0f);

        // Draw our Whole Box.
        if (thisEvent.Duration > 0)
        {
            float endPosition = USControl.convertTimeToEventPanePosition(thisEvent.Firetime + thisEvent.Duration);
            myArea.width = endPosition - myArea.x;
        }
        DrawDefaultBox(myArea, thisEvent);

        Rect FadeInBox = myArea;
        // Draw our FadeInBox
        if (thisEvent.Duration > 0)
        {
            float endPosition = USControl.convertTimeToEventPanePosition(fadeInEndTime - fadeInStartTime);
            FadeInBox.width = endPosition;
        }
        DrawDefaultBox(FadeInBox, thisEvent);

        Rect FadeOutBox = myArea;
        // Draw our FadeOutBox
        if (thisEvent.Duration > 0)
        {
            float startPosition = USControl.convertTimeToEventPanePosition(fadeOutStartTime);
            float endPosition = USControl.convertTimeToEventPanePosition(fadeOutEndTime);

            FadeOutBox.x = startPosition;
            FadeOutBox.width = endPosition - startPosition;
        }
        DrawDefaultBox(FadeOutBox, thisEvent);

        GUILayout.BeginArea(myArea);
        {
            GUILayout.Label(thisEvent.name, defaultBackground);

            if(lookAtObjectEvent.objectToLookAt != null)
                GUILayout.Label(lookAtObjectEvent.objectToLookAt.name, defaultBackground);
            else
                GUILayout.Label("NULL", defaultBackground);
        }
        GUILayout.EndArea();

        return myArea;
    }
    public new Rect RenderEvent(Rect myArea, USEventBase thisEvent)
    {
        USPauseResumeAudioEvent audioEvent = thisEvent as USPauseResumeAudioEvent;

        if (!audioEvent)
            Debug.LogWarning("Trying to render an event as a USPauseResumeAudioEvent, but it is a : " + thisEvent.GetType().ToString());

        DrawDefaultBox(myArea, thisEvent);

        GUILayout.BeginArea(myArea);
            if (audioEvent)
                GUILayout.Label(audioEvent.pause?"Pause Audio":"Resume Audio", defaultBackground);
        GUILayout.EndArea();

        return myArea;
    }
    public new Rect RenderEvent(Rect myArea, USEventBase thisEvent)
    {
        USAttachToParentEvent attachEvent = thisEvent as USAttachToParentEvent;

        if (!attachEvent)
            Debug.LogWarning("Trying to render an event as a USAttachToParent, but it is a : " + thisEvent.GetType().ToString());

        DrawDefaultBox(myArea, thisEvent);

        GUILayout.BeginArea(myArea);
            GUILayout.Label(thisEvent.name, defaultBackground);
            if (attachEvent)
                GUILayout.Label(attachEvent.parentObject?attachEvent.parentObject.name:"null", defaultBackground);
        GUILayout.EndArea();

        return myArea;
    }
Exemplo n.º 5
0
    public new Rect RenderEvent(Rect myArea, USEventBase thisEvent)
    {
        USMessageEvent messageEvent = thisEvent as USMessageEvent;

        if (!messageEvent)
            Debug.LogWarning("Trying to render an event as a USMessageEvent, but it is a : " + thisEvent.GetType().ToString());

        DrawDefaultBox(myArea, thisEvent);

        GUILayout.BeginArea(myArea);
            GUILayout.Label(GetReadableEventName(thisEvent), defaultBackground);
            if (messageEvent)
                GUILayout.Label(messageEvent.message, defaultBackground);
        GUILayout.EndArea();

        return myArea;
    }
    public new Rect RenderEvent(Rect myArea, USEventBase thisEvent)
    {
        USPlayAudioEvent audioEvent = thisEvent as USPlayAudioEvent;

        if (!audioEvent)
            Debug.LogWarning("Trying to render an event as a USPlayAudioEvent, but it is a : " + thisEvent.GetType().ToString());

        if (thisEvent.Duration > 0)
        {
            float endPosition = USControl.convertTimeToEventPanePosition(thisEvent.Firetime + thisEvent.Duration);
            myArea.width = endPosition - myArea.x;
        }

        if (audioEvent && audioEvent.loop)
        {
            float endPosition = USControl.convertTimeToEventPanePosition(thisEvent.Sequence.Duration);
            myArea.width = endPosition - myArea.x;
        }

        DrawDefaultBox(myArea, thisEvent);

        GUILayout.BeginArea(myArea);
        #if (UNITY_4_0)

        #else
            if (audioEvent && audioEvent.audioClip)
                audioWaveTexture = EditorUtility.GetAssetPreview(audioEvent.audioClip);
        #endif

            if(audioWaveTexture)
            {
                audioWaveTexture.filterMode = FilterMode.Point;
                audioWaveTexture.anisoLevel = 1;

                Rect imageArea = new Rect(0.0f, 0.0f, audioWaveTexture.width, myArea.height);
                GUI.DrawTexture(imageArea, audioWaveTexture, ScaleMode.StretchToFill);
            }

            GUILayout.Label(thisEvent.name, defaultBackground);
            if (audioEvent)
                GUILayout.Label("Audio : " + audioEvent.audioClip, defaultBackground);
        GUILayout.EndArea();

        return myArea;
    }
    public new Rect RenderEvent(Rect myArea, USEventBase thisEvent)
    {
        USDisplayImageEvent DisplayImageEvent = thisEvent as USDisplayImageEvent;

        if (!DisplayImageEvent)
            Debug.LogWarning("Trying to render an event as a USDisplayImageEvent, but it is a : " + thisEvent.GetType().ToString());

        float endPosition = USControl.convertTimeToEventPanePosition(thisEvent.Firetime + (thisEvent.Duration<=0.0f?3.0f:thisEvent.Duration));
        myArea.width = endPosition - myArea.x;

        DrawDefaultBox(myArea, thisEvent);

        GUILayout.BeginArea(myArea);
            GUILayout.Label(thisEvent.name, defaultBackground);
        GUILayout.EndArea();

        return myArea;
    }
    public new Rect RenderEvent(Rect myArea, USEventBase thisEvent)
    {
        USEnableObjectEvent toggleEvent = thisEvent as USEnableObjectEvent;

        if (!toggleEvent)
            Debug.LogWarning("Trying to render an event as a USEnableObjectEvent, but it is a : " + thisEvent.GetType().ToString());

        DrawDefaultBox(myArea, thisEvent);

        GUILayout.BeginArea(myArea);
            if (toggleEvent)
            {
                GUILayout.Label(toggleEvent.enable?"Enable : ":"Disable : ", defaultBackground);
                GUILayout.Label(toggleEvent.AffectedObject.name, defaultBackground);
            }
        GUILayout.EndArea();

        return myArea;
    }
    public new Rect RenderEvent(Rect myArea, USEventBase thisEvent)
    {
        USSpawnPrefabEvent spawnEvent = thisEvent as USSpawnPrefabEvent;

        if (!spawnEvent)
            Debug.LogWarning("Trying to render an event as a USSpawnPrefabEvent, but it is a : " + thisEvent.GetType().ToString());

        DrawDefaultBox(myArea, thisEvent);

        GUILayout.BeginArea(myArea);
            GUILayout.Label("Spawn : ", defaultBackground);
            if (spawnEvent)
                GUILayout.Label(spawnEvent.spawnPrefab?spawnEvent.spawnPrefab.name:"null", defaultBackground);
            GUILayout.Label("At : ", defaultBackground);
            GUILayout.Label(spawnEvent.spawnTransform?spawnEvent.spawnTransform.name:"Identity", defaultBackground);
        GUILayout.EndArea();

        return myArea;
    }
    public new Rect RenderEvent(Rect myArea, USEventBase thisEvent)
    {
        USPlayAdvancedAnimEvent animEvent = thisEvent as USPlayAdvancedAnimEvent;

        if(!animEvent)
            Debug.LogWarning("Trying to render an event as a USPlayAdvancedAnimEvent, but it is a : " + thisEvent.GetType().ToString());

        float endPosition = USControl.convertTimeToEventPanePosition(thisEvent.Firetime + (thisEvent.Duration<=0.0f?3.0f:thisEvent.Duration));
        myArea.width = endPosition - myArea.x;

        DrawDefaultBox(myArea, thisEvent);

        GUILayout.BeginArea(myArea);
            GUILayout.Label(GetReadableEventName(thisEvent), defaultBackground);
            if(animEvent)
                GUILayout.Label("Animation : " + animEvent.animationClip, defaultBackground);
        GUILayout.EndArea();

        return myArea;
    }
    public new Rect RenderEvent(Rect myArea, USEventBase thisEvent)
    {
        USApplyForceEvent forceEvent = thisEvent as USApplyForceEvent;

        if (!forceEvent)
            Debug.LogWarning("Trying to render an event as a USApplyForceEvent, but it is a : " + thisEvent.GetType().ToString());

        DrawDefaultBox(myArea, thisEvent);

        GUILayout.BeginArea(myArea);
            GUILayout.Label(GetReadableEventName(thisEvent), defaultBackground);
            if(forceEvent)
            {
                GUILayout.Label(forceEvent.type.ToString(), defaultBackground);
                GUILayout.Label("Strength : " + forceEvent.strength, defaultBackground);
            }
        GUILayout.EndArea();

        return myArea;
    }
Exemplo n.º 12
0
    public new Rect RenderEvent(Rect myArea, USEventBase thisEvent)
    {
        USWarpToObject warpEvent = thisEvent as USWarpToObject;

        if (!warpEvent)
            Debug.LogWarning("Trying to render an event as a USWarpToObject, but it is a : " + thisEvent.GetType().ToString());

        myArea.width += 10.0f;
        DrawDefaultBox(myArea, thisEvent);

        GUILayout.BeginArea(myArea);
            GUILayout.Label(GetReadableEventName(thisEvent), defaultBackground);
            if (warpEvent)
            {
                GUILayout.Label(warpEvent.objectToWarpTo?warpEvent.objectToWarpTo.name:"null", defaultBackground);
                GUILayout.Label(warpEvent.useObjectRotation?"Using Warp Rotation":"Keep Original Rotation", defaultBackground);
            }
        GUILayout.EndArea();

        return myArea;
    }
    public new Rect RenderEvent(Rect myArea, USEventBase thisEvent)
    {
        USSetPlaybackRateEvent setPlaybackRateEvent = thisEvent as USSetPlaybackRateEvent;

        if (!setPlaybackRateEvent)
            Debug.LogWarning("Trying to render an event as a setPlaybackRateEvent, but it is a : " + thisEvent.GetType().ToString());

        DrawDefaultBox(myArea, thisEvent);

        GUILayout.BeginArea(myArea);
            if(setPlaybackRateEvent)
            {
                GUILayout.Label("Set Playback Rate for : " + (setPlaybackRateEvent.sequence?setPlaybackRateEvent.sequence.name:"null"), defaultBackground);
                GUILayout.Label(setPlaybackRateEvent.sequence?setPlaybackRateEvent.sequence.name:"null", defaultBackground);
            }
            if (setPlaybackRateEvent)
                GUILayout.Label("Playback Rate : " + setPlaybackRateEvent.playbackRate, defaultBackground);
        GUILayout.EndArea();

        return myArea;
    }