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); } }
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; } /////////////////////////////////////////////// }
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); }
void Next() { distancePosition = transform.position; if (!waitNext) { if (currentPosition >= positions.Count - 1) { currentPosition = 0; } else { currentPosition++; } } else { waitNext = false; } currentPos = positions[currentPosition]; }
public void SetMovePoint(MovePos p) { pn = p; cc.ResetTarget(); GetTarget(); }
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)); }
private void OnEnable() { movePos = (MovePos)target; }