Пример #1
0
        protected void CreateBeat(float rotation)
        {
            if (float.IsNaN(rotation))
            {
                return;
            }

            //Debug.Log(rotation + "/" + float.IsNaN(rotation));

            Beat lBeat = Instantiate(GameRootAndObjectLibrary.Instance.BeatPrefab, gameContainer.transform);

            lBeat.target     = new Vector3(Mathf.Cos(rotation * Mathf.Deg2Rad), Mathf.Sin(rotation * Mathf.Deg2Rad)) * player.GetCannonRadius();
            lBeat.travelTime = currentDiff.ApproachRate;
            lBeat.EnablePlay();
            lBeat.autoClear = autoClear;
        }