public override IState Update() { durTemp += Time.deltaTime; PropertyAnimationManager.GetInstance().EndAnimatingPropertyVector3(param.mark.transform, "position", PropertyAnimationManager.EndPropertyState.Keep); if (toEnd) { return(new StateEnd()); } return(null); }
public override IState Update() { if (toBounceBack) { PropertyAnimationManager.GetInstance().EndAnimatingPropertyVector3(param.mark.transform, "position", PropertyAnimationManager.EndPropertyState.Keep); return(new StateMarkBouncingBack(param)); } if (toBeActivated) { return(new StateMarkActivated(param)); } return(null); }
public override void OnEntrance() { Debug.Log("Deploy"); param.mark.GoZone.SetActive(false); PropertyAnimationManager.GetInstance().StartAnimatingPropertyVector3(param.mark.transform, "position", (val) => { param.mark.transform.position = val; }, () => { return(param.mark.transform.position); }, param.mark.transform.position, param.posTarg, param.mark.durDeploy, null, null, null, CallbackOnDeployed); param.isDeploying = true; param.mark.onDeploying?.Invoke(); }
public override void OnEntrance() { Debug.Log("Retrieve"); durTemp = 0; durLeft = param.mark.durRetrieve; PropertyAnimationManager.GetInstance().StartAnimatingPropertyVector3(param.mark.transform, "position", (val) => { param.mark.transform.position = val; }, () => { return(param.mark.transform.position); }, param.mark.transform.position, param.transformMarkShooter.position, durLeft, null, null, null, CallbackOnEachFrame); param.isRetrieving = true; param.mark.onRetrieving?.Invoke(); }
public override void OnEntrance() { Debug.Log("Bounce back"); // Animator param.animator.SetTrigger("ToFail"); param.mark.ColliderMark.enabled = false; param.mark.Inflicter.enabled = false; durTemp = 0; durLeft = param.mark.durRetrieve; PropertyAnimationManager.GetInstance().StartAnimatingPropertyVector3(param.mark.transform, "position", (val) => { param.mark.transform.position = val; }, () => { return(param.mark.transform.position); }, param.mark.transform.position, param.transformMarkShooter.position, durLeft, null, null, null, CallbackOnEachFrame); param.isBouncingBack = true; param.mark.onBouncingBack?.Invoke(); }
private void CallbackOnEachFrame(PropertyAnimationManager.EndPropertyState state) { if (state == PropertyAnimationManager.EndPropertyState.Keep) { durLeft -= durTemp; durTemp = 0f; Vector3 pos = param.transformMarkShooter.position; PropertyAnimationManager.GetInstance().StartAnimatingPropertyVector3(param.mark.transform, "position", (val) => { param.mark.transform.position = val; }, () => { return(param.mark.transform.position); }, param.mark.transform.position, param.transformMarkShooter.position, durLeft, null, null, null, CallbackOnEachFrame); } else if (state == PropertyAnimationManager.EndPropertyState.Targ) { toEnd = true; } else { Debug.LogError("不可能存在Src的啊"); } }