예제 #1
0
        public void Initialize(Vector2 speed, float deflectionAngle)
        {
            Movable movable = GetComponent <Movable>();

            movable.Speed = speed;
            movable.RotateSpeedVector(deflectionAngle);
        }
예제 #2
0
        private void ChangePartSpeed(Asteroid part, int deflectionDirection)
        {
            float speedModifier   = Random.Range(MinPartSpeedCoefficient, MaxPartSpeedCoefficient);
            float deflectionAngle = Random.Range(MinPartDeflectionAngle, MaxPartDeflectionAngle);

            Movable movableComponent = part.GetComponent <Movable>();

            movableComponent.Speed = GetComponent <Movable>().Speed;
            movableComponent.IncreaseSpeedVector(speedModifier);
            movableComponent.RotateSpeedVector(deflectionAngle * deflectionDirection);
        }