Esempio n. 1
0
        public void Process()
        {
            Animator animator;

            if (!TargetActor.GetActorAnimator(out animator))
            {
                throw new Exception("Error while playing the dialog: you are trying to set the value of an animator parameter, " +
                                    "but the actor can't access to it's animator.");
            }

            switch (Variable.Type)
            {
            case AnimatorVariableType.BOOL:
                animator.SetBool(Variable.Name, Variable.GetValueAs <bool>());
                break;

            case AnimatorVariableType.FLOAT:
                animator.SetFloat(Variable.Name, Variable.GetValueAs <float>());
                break;

            case AnimatorVariableType.INT:
                animator.SetInteger(Variable.Name, Variable.GetValueAs <int>());
                break;

            case AnimatorVariableType.TRIGGER:
                animator.SetTrigger(Variable.Name);
                break;
            }
        }
Esempio n. 2
0
 public void ReceiveWaitTimeOut2Test()
 {
     TestLauncherActor.Test(() =>
     {
         var actor      = new ReceiveActor <int, string>();
         var target     = new TargetActor();
         var resultEven = actor.WaitAsync((IActor)target, 2, 2000);
         Assert.IsTrue(resultEven.Result.Item2 == "even");
     });
 }
Esempio n. 3
0
 public void ReceiveWaitTimeOut1Test()
 {
     TestLauncherActor.Test(() =>
     {
         var actor     = new ReceiveActor <int, string>();
         var target    = new TargetActor();
         var resultOdd = actor.WaitAsync(target, 1, 10000);
         Assert.IsTrue(resultOdd.Result.Item2 == "odd");
     });
 }
Esempio n. 4
0
        virtual public void ResetResource(NResourceLoc loc)
        {
            if (TargetActor != null && animMesh == null)
            {
                NActorComponent comp = TargetActor.CreateComponent(animMeshNameGenerator.GetNextUniqueName(), "nanim_mesh_component");
                animMesh = comp as NAnimMeshComponent;
            }

            animMesh.ResetResource(loc);
        }
        public int GetVariableAsInteger()
        {
            Animator animator;

            if (TargetActor.GetActorAnimator(out animator))
            {
                return(animator.GetInteger(VariableName));
            }
            throw new Exception("Error while playing the dialog: you are trying to get the value of an animator parameter, " +
                                "but the actor can't access to it's animator.");
        }
Esempio n. 6
0
    /// <summary>
    /// 走路到某地-
    /// </summary>
    /// <param name="target"></param>
    public void WalkTo(Vector3 target)
    {
        if (TargetActor != null)
        {
            target.y = RoleHelp.GetHeightInScene(TargetActor.ActorId, target.x, target.z);
            target   = InstanceHelper.ClampInWalkableRange(target, 10);

            if (TargetActor.IsAttacking() == true)
            {
                Skill cur_skill = TargetActor.GetCurSkill();
                if (cur_skill != null)
                {
                    cur_skill.End();
                }
            }
            m_WalkId = TargetActor.MoveCtrl.TryWalkToAlong(target);
        }

        mWalkType  = WalkType.WALK;
        mTargetPos = target;
    }
Esempio n. 7
0
 private void TimerCallback(object state)
 {
     TargetActor.PostAsync(Callback);
 }