//for the first time, start too is a routine... IEnumerator Start() { //sort the shooting pattern in order to launch just one routine; splineShootingPositions.Sort(); //setting the variables; moverComponent = GetComponent <TransformMover> (); bool repeated = true; //(moverComponent.pathMode != PathMode.Normal); //repeat the routine every spline cycle (if movement is repeated then launch a coroutine every time it resets); while (repeated) { StartCoroutine(ShootRoutine()); //wait for the time it takes to complete the spline; yield return(new WaitForSeconds(1f / moverComponent.speed)); } }
public void Init() { switch (_moveInputType) { case InputType.Keyboard: _moveInput = new KeyboradMoveInput(); break; case InputType.Mouse: _moveInput = new MouseMoveInput(_transform); break; case InputType.StandartDrag: //WIP, not working _moveInput = _transform.gameObject.AddComponent <StandartDragMoveInput>(); break; } _transformMover = new TransformMover(_moveInput, _transform, _sensivity); }