Пример #1
0
    void Start()
    {
        cc  = transform.parent.GetComponent <CharacterControl>();
        cam = Camera.main.transform;
        pn  = new MovePos(false, Vector2.zero);

        if (cc.IsMine)
        {
            Main_Character = this;
            EnemyCheck     = transform.GetChild(0);
        }
    }
Пример #2
0
    void NextUp()
    {
        distancePosition = transform.position;
        dirChangePos.SetPos(new Vector3(positions[currentPosition].pos.x, dirChangePos.pos.y, positions[currentPosition].pos.z));

        ///////////////////////////////////////////////
        if (transform.position == dirChangePos.pos)
        {
            currentPos = positions[currentPosition];
            waitNext   = false;
        }
        else
        {
            waitNext   = true;
            currentPos = dirChangePos;
        }
        ///////////////////////////////////////////////
    }
Пример #3
0
    void Start()
    {
        gameObject.layer = 12;
        gameObject.tag   = "Ground";
        Ply = GameSystem.instance.Ply;
        cam = Camera.main.transform;
        //gameObject.layer = 23;
        if (MovePos == null)
        {
            MovePos = transform;
        }
        Vector3 aa = (Vector2)transform.position + GetComponent <Collider2D>().offset;

        if (MovePos == transform)
        {
            Debug.DrawLine(aa, aa + Vector3.one * 5, Color.red, 10000);
        }
        Debug.DrawLine(aa, MovePos.position + (Vector3)MovePos.GetComponent <Collider2D>().offset, Color.yellow, 10000);
    }
Пример #4
0
    void Next()
    {
        distancePosition = transform.position;

        if (!waitNext)
        {
            if (currentPosition >= positions.Count - 1)
            {
                currentPosition = 0;
            }
            else
            {
                currentPosition++;
            }
        }
        else
        {
            waitNext = false;
        }

        currentPos = positions[currentPosition];
    }
Пример #5
0
 public void SetMovePoint(MovePos p)
 {
     pn = p;
     cc.ResetTarget();
     GetTarget();
 }
Пример #6
0
        protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state)
        {
            PropertyDescriptor property = context.DataContext.GetProperties()[WordCreate.GetWordAppTag];
            Application        wordApp  = property.GetValue(context.DataContext) as Application;

            try
            {
                Int32     _movePos = MovePos.Get(context);
                Selection sel      = wordApp.Selection;

                if (Left)
                {
                    if (IsSelect)
                    {
                        sel.MoveLeft(WdUnits.wdCharacter, _movePos, WdMovementType.wdExtend);
                    }
                    else
                    {
                        sel.MoveLeft(WdUnits.wdCharacter, _movePos, WdMovementType.wdMove);
                    }
                }
                else if (Right)
                {
                    if (IsSelect)
                    {
                        sel.MoveRight(WdUnits.wdCharacter, _movePos, WdMovementType.wdExtend);
                    }
                    else
                    {
                        sel.MoveRight(WdUnits.wdCharacter, _movePos, WdMovementType.wdMove);
                    }
                }
                else if (Up)
                {
                    if (IsSelect)
                    {
                        sel.MoveUp(WdUnits.wdLine, _movePos, WdMovementType.wdExtend);
                    }
                    else
                    {
                        sel.MoveUp(WdUnits.wdLine, _movePos, WdMovementType.wdMove);
                    }
                }
                else if (Down)
                {
                    if (IsSelect)
                    {
                        sel.MoveDown(WdUnits.wdLine, _movePos, WdMovementType.wdExtend);
                    }
                    else
                    {
                        sel.MoveDown(WdUnits.wdLine, _movePos, WdMovementType.wdMove);
                    }
                }
            }
            catch (Exception e)
            {
                SharedObject.Instance.Output(SharedObject.enOutputType.Error, "Word执行过程出错", e.Message);
                CommonVariable.realaseProcessExit(wordApp);
            }

            m_Delegate = new runDelegate(Run);
            return(m_Delegate.BeginInvoke(callback, state));
        }
Пример #7
0
 private void OnEnable()
 {
     movePos = (MovePos)target;
 }