Esempio n. 1
0
        public override void Stop()
        {
            //主角
            if (StoryConst.SELF_ID == createId)
            {
                (AppMap.Instance.me.Controller as ActionControler).StopWalk();
            }
            //npc或者monster
            else
            {
                CreateAction action = Singleton <StoryMode> .Instance.GetCreateAction(createId);

                if (null == action)
                {
                    return;
                }

                if (action.IsMonster)
                {
                    (AppMap.Instance.GetMonster(action.MonsterId).Controller as ActionControler).StopWalk();
                }
                else
                {
                    role = action.Role;
                    StoryRoleMove roleMove = role.GetComponent <StoryRoleMove>();
                    if (null != roleMove)
                    {
                        roleMove.Stop();
                    }
                }
            }
        }
Esempio n. 2
0
        public override void Run()
        {
            targetPos = new Vector3(targetX, targetY, 0);

            //主角
            if (StoryConst.SELF_ID == createId)
            {
                (AppMap.Instance.me.Controller as ActionControler).MoveSpeed = speed;
                AppMap.Instance.me.Controller.MoveTo(targetX, targetY, null);
            }
            //npc或者monster
            else
            {
                CreateAction action = Singleton <StoryMode> .Instance.GetCreateAction(createId);

                if (null == action)
                {
                    return;
                }

                if (action.IsMonster)
                {
                    (AppMap.Instance.GetMonster(action.MonsterId).Controller as ActionControler).MoveSpeed = speed;
                    AppMap.Instance.GetMonster(action.MonsterId).Controller.MoveTo(targetPos.x, targetPos.y, null);
                }
                else
                {
                    role = action.Role;
                    StoryRoleMove roleMove = role.GetComponent <StoryRoleMove>();

                    if (null != roleMove)
                    {
                        GameObject.Destroy(roleMove);
                    }

                    roleMove           = role.AddComponent <StoryRoleMove>();
                    targetPos.z        = role.transform.position.z;
                    roleMove.TargetPos = targetPos;
                    roleMove.MoveSpeed = speed;
                }
            }
        }