public void Initialize() { layerTransform = transform; layer = layerTransform.GetComponent <SimplePlatformLayer>(); AngleBetweenPlatforms = layer.AngelBetweenPlatforms; deltaAngelForAlignmentY = -AngleBetweenPlatforms / 2; camera = Camera.main; prevY = (int)layerTransform.eulerAngles.y; if (AngleBetweenPlatforms == 120) { rotateController = new RotateControllerForSecondLayer(layer); } else { rotateController = new SimpleRotateController(layer); } }
public RotateControllerForSecondLayer(SimplePlatformLayer simplePlatformLayer) { this.SimplePlatformLayer = simplePlatformLayer; }
public SimpleRotateController(SimplePlatformLayer simplePlatformLayer) { SimplePlatformLayer = simplePlatformLayer; }