/// <summary> /// 初始化接口 /// </summary> /// <param name="control"></param> public PlayerPosBehaviour(IPosControl control) { posControl = control; currentPos = new Triggable <Vector2>(control.GetPos(), OnCurrentPosChanged); timeSpanCalculator = new TriggerGroup(RecalulateTimeSpan, OnBeforeChange); timeSpanCalculator.AddTrigger(targetPos); timeSpanCalculator.AddTrigger(speed); }
public PlayerStructs(Transform trans) { //注意 此时可以将AnimProxy传给Model temp = trans; control = new PosImplementation(trans); animControl = new AnimProxy(); targetTime = RPGLogicBase.Time.realTimeSinceStartUp + Random.Range(0, 5f); rotControl = new RotationImplementation(trans); GameLoopTrigger.inst.RegisteUpdate(Update); }