Ejemplo n.º 1
0
        public override void ParseCue(string cueToken, string cueData)
        {
            switch (cueToken)
            {
            case "APPEAR_TYPE":
                string[] cues = cueData.Split(ParseTokens.CUE_SEPARATOR);

                string typeStr = cues[0].Trim();

                AppearType type = (AppearType)Enum.Parse(typeof(AppearType), typeStr);
                def.AppearType = type;
                def.AppearData = int.Parse(cues[1].Trim());
                break;

            default:

                if (!mSettings.KnownSpeakerNames.Contains(cueToken))
                {
                    throw new InvalidOperationException($"[CUTSCENE] Unknown cue token: {cueToken}");
                    break;
                }

                break;
                // throw new System.NotImplementedException($"[NEW_PATIENT] cue: {cueToken}, {cueData}");
            }
        }
Ejemplo n.º 2
0
    /// <summary>
    /// Toggles the panel without triggering the 'OnPanelToggle' event.
    /// </summary>
    /// <param name="type">Transition Type</param>
    /// <param name="value">If the panel is being turned on or off</param>
    /// <param name="action">Action to be executed before or after the Toggle Transition</param>
    public void RawToggle(AppearType type, bool value, UnityAction action)
    {
        if (transitionCorout != null)
        {
            StopCoroutine(transitionCorout);
        }

        if (!overrideSound)
        {
            if (group.blocksRaycasts)
            {
                PlaySingle(profile.closeSound);
            }
            else
            {
                PlaySingle(profile.openSound);
            }
        }

        transform.localScale  = refSize;
        rect.anchoredPosition = refPosition;

        IEnumerator routine = null;

        switch (type)
        {
        case AppearType.Pop:
            routine = PopRoutine(value, action);
            break;

        case AppearType.BottomToTop:
            routine = MovementRoutine(value, new Vector2(0, 1.0f), action);
            break;

        case AppearType.TopToBottom:
            routine = MovementRoutine(value, new Vector2(0, -1.0f), action);
            break;

        case AppearType.RightToLeft:
            routine = MovementRoutine(value, new Vector2(-1.0f, 0.0f), action);
            break;

        case AppearType.LeftToRight:
            routine = MovementRoutine(value, new Vector2(1.0f, 0.0f), action);
            break;

        case AppearType.Instant:
            GroupToggle(value);
            if (action != null)
            {
                action();
            }
            return;

        default:
            return;
        }

        transitionCorout = StartCoroutine(routine);
    }
Ejemplo n.º 3
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (AppearType != 0)
            {
                hash ^= AppearType.GetHashCode();
            }
            if (Rate != 0F)
            {
                hash ^= Rate.GetHashCode();
            }
            if (Time != 0F)
            {
                hash ^= Time.GetHashCode();
            }
            if (Num != 0)
            {
                hash ^= Num.GetHashCode();
            }
            if (Interval != 0F)
            {
                hash ^= Interval.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 4
0
    public Menu(float _spacing, Orientation _orientation, AppearType _appearType, Vector2 _defaultElementSize)
    {
        spacing            = _spacing;
        orientation        = _orientation;
        appearType         = _appearType;
        defaultElementSize = _defaultElementSize;

        elements   = new List <MenuElement>();
        isEnabled  = false;
        autoResize = true;
    }
Ejemplo n.º 5
0
        public static uint MakeGroupFlag(AppearType Type, bool Linked, bool AppearOK, bool LinkInvoke, byte Step, bool Fire, byte ID, bool Specified, bool GameTriggerFire, bool MissionFire, bool AllDeadNoAppear, byte GroupID)
        {
            uint val = 0;

            val = BitsUtil.Int.SetBits(val, 0, 4, (uint)Type);
            val = BitsUtil.Int.SetBit(val, 4, Linked);
            val = BitsUtil.Int.SetBit(val, 5, AppearOK);
            val = BitsUtil.Int.SetBit(val, 6, LinkInvoke);
            val = BitsUtil.Int.SetBits(val, 7, 4, Step);
            val = BitsUtil.Int.SetBit(val, 11, Fire);
            val = BitsUtil.Int.SetBits(val, 12, 8, ID);
            val = BitsUtil.Int.SetBit(val, 20, Specified);
            val = BitsUtil.Int.SetBit(val, 21, GameTriggerFire);
            val = BitsUtil.Int.SetBit(val, 22, MissionFire);
            val = BitsUtil.Int.SetBit(val, 23, AllDeadNoAppear);
            val = BitsUtil.Int.SetBits(val, 24, 5, GroupID);

            return(val);
        }
Ejemplo n.º 6
0
    void TransitionGUI(ref AppearType type, PanelTransitionData data, bool value)
    {
        Label(string.Format("{0} transition", value ? "Open" : "Close"), true, TextAnchor.MiddleLeft);

        type = (AppearType)EditorGUILayout.EnumPopup("Type", type);

        if (data == null)
        {
            return;
        }
        var curve = value ? data.openCurve : data.closeCurve;

        curve = EditorGUILayout.CurveField("Curve", curve);

        //data.closeCurve = EditorGUILayout.CurveField("Close Curve", data.closeCurve);

        data.useLocalSpeed = EditorGUILayout.Toggle("Local Speed", data.useLocalSpeed);

        if (data.useLocalSpeed)
        {
            data.speedModifier = EditorGUILayout.Slider("Speed Modifier", data.speedModifier, 0.5f, 3.0f);
        }
    }
Ejemplo n.º 7
0
    /// <summary>
    /// 显示UI
    /// </summary>
    /// <param name="type">出现类型</param>
    /// <param name="obj">被控制的结点</param>
    public void Open(AppearType _type, GameObject obj, float delay = 0, Action callback = null)
    {
        if (!obj)
        {
            return;
        }
        BeingContObj = obj;
        type         = _type;

        OpenOverCB = callback;

        if (!BeingContObj.activeSelf)
        {
            BeingContObj.SetActive(true);
            if (type == AppearType.Popup)
            {
                BeingContObj.transform.localScale = new Vector3(0.01f, 0.01f, 0.01f);
                TweenAlpha.Begin(gameObject, 0, 1);
            }
        }
        iTween.Stop(gameObject);
        StartCoroutine("_Open", delay);
    }
Ejemplo n.º 8
0
    /// <summary>
    /// Toggles the panel without triggering the 'OnPanelToggle' event.
    /// </summary>
    /// <param name="value">If the panel is being turned on or off</param>
    /// <param name="action">Action to be executed before or after the Toggle Transition</param>
    public void RawToggle(bool value, UnityAction action)
    {
        AppearType type = group.blocksRaycasts ? profile.closeTransitionType : profile.openTransitionType;

        RawToggle(type, value, action);
    }
Ejemplo n.º 9
0
 public void Close(AppearType _type, Action callback = null)
 {
     type = _type;
     Close(callback);
 }