Ejemplo n.º 1
0
    public void SetUp(ModelOrganizer modelOrganizer)
    {
        this.modelOrganizer    = modelOrganizer;
        this.dialogueModel     = modelOrganizer.dialogueModel;
        this.dialogueProcessor = modelOrganizer.dialogueModel.dialogueProcessor;

        this.dialogueTypeTable = new Dictionary <string, ProcessDialogueComp>();
        this.dialogueTypeTable.Add(EventFlag.DialogueType.TEXT, ProcessTextLog);
    }
Ejemplo n.º 2
0
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }

        dialogueOptionText = new List <Text>();

        foreach (Button b in dialogueOptions)
        {
            dialogueOptionText.Add(b.gameObject.transform.GetChild(0).gameObject.GetComponent <Text>());
        }

        dialogueUI = transform.GetChild(0).gameObject;
        dialogueUI.SetActive(false);
    }
Ejemplo n.º 3
0
        public override void Process(Action _action, Track _track)
        {
            GameObject gameObject = _action.GetGameObject(this.targetId);

            if (gameObject != null)
            {
                GameObject actorMesh = gameObject;
                PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.targetId);
                if (this.GetAnimation(gameObject) == null)
                {
                    if (actorHandle != 0)
                    {
                        actorMesh = actorHandle.handle.ActorMesh;
                    }
                    else
                    {
                        actorMesh = null;
                    }
                }
                if (actorMesh != null)
                {
                    Animation      animation = this.GetAnimation(actorMesh);
                    AnimationState state     = animation[this.clipName];
                    if (state != null)
                    {
                        if (this.alwaysAnimate && (animation.cullingType != AnimationCullingType.AlwaysAnimate))
                        {
                            animation.cullingType = AnimationCullingType.AlwaysAnimate;
                        }
                        float num = this.playSpeed * (!this.applyActionSpeed ? 1f : _action.playSpeed.single);
                        if (this.bNoTimeScale)
                        {
                            DialogueProcessor.PlayAnimNoTimeScale(animation, this.clipName, this.loop, null);
                        }
                        else
                        {
                            AnimPlayComponent component = (actorHandle == 0) ? null : actorHandle.handle.AnimControl;
                            if (component != null)
                            {
                                PlayAnimParam param = new PlayAnimParam {
                                    animName  = this.clipName,
                                    blendTime = this.crossFadeTime,
                                    loop      = this.loop,
                                    layer     = this.layer,
                                    speed     = num
                                };
                                component.Play(param);
                            }
                            else
                            {
                                if (state.enabled)
                                {
                                    animation.Stop();
                                }
                                if (this.crossFadeTime > 0f)
                                {
                                    animation.CrossFade(this.clipName, this.crossFadeTime);
                                }
                                else
                                {
                                    animation.Play(this.clipName);
                                }
                            }
                        }
                        state.speed = num;
                    }
                }
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Destroys the current instance of dialogue processor
 /// </summary>
 private void OnDestroy()
 {
     instance = null;
 }
Ejemplo n.º 5
0
        public override void Process(Action _action, Track _track)
        {
            GameObject gameObject = _action.GetGameObject(this.targetId);

            if (gameObject == null)
            {
                return;
            }
            GameObject gameObject2 = gameObject;
            PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.targetId);

            if (this.GetAnimation(gameObject) == null)
            {
                if (actorHandle)
                {
                    gameObject2 = actorHandle.get_handle().ActorMesh;
                }
                else
                {
                    gameObject2 = null;
                }
            }
            if (gameObject2 == null)
            {
                return;
            }
            Animation      animation      = this.GetAnimation(gameObject2);
            AnimationState animationState = animation[this.clipName];

            if (animationState == null)
            {
                return;
            }
            if (this.alwaysAnimate && animation.cullingType != AnimationCullingType.AlwaysAnimate)
            {
                animation.cullingType = AnimationCullingType.AlwaysAnimate;
            }
            float speed = this.playSpeed * ((!this.applyActionSpeed) ? 1f : _action.playSpeed.get_single());

            if (this.bNoTimeScale)
            {
                DialogueProcessor.PlayAnimNoTimeScale(animation, this.clipName, this.loop, null);
            }
            else
            {
                AnimPlayComponent animPlayComponent = (!actorHandle) ? null : actorHandle.get_handle().AnimControl;
                if (animPlayComponent != null)
                {
                    animPlayComponent.Play(new PlayAnimParam
                    {
                        animName  = this.clipName,
                        blendTime = this.crossFadeTime,
                        loop      = this.loop,
                        layer     = this.layer,
                        speed     = speed
                    });
                }
                else
                {
                    if (animationState.enabled)
                    {
                        animation.Stop();
                    }
                    if (this.crossFadeTime > 0f)
                    {
                        animation.CrossFade(this.clipName, this.crossFadeTime);
                    }
                    else
                    {
                        animation.Play(this.clipName);
                    }
                }
            }
            animationState.speed = speed;
        }
Ejemplo n.º 6
0
 public DialogueModel(WorldModel worldModel)
 {
     this.worldModel    = worldModel;
     _dialogueProcessor = new DialogueProcessor(worldModel, this);
 }