private void Start()
        {
            Application.targetFrameRate = 60;

            this.jelly = Instantiate(
                this.gameConfig.jellyPrefab,
                this.gameConfig.jellyInitPosition,
                Quaternion.Euler(Vector3.zero));

            this.LoadCurrentLevelIndex();

            var level = Instantiate(
                this.gameConfig.levels[this.currentLevel],
                this.gameConfig.levelInitPosition,
                Quaternion.Euler(Vector3.zero));

            this.jellyResizer = new JellyResizer(
                this.jelly.transform.localScale,
                this.gameConfig.resizerConfig.maxScale,
                this.gameConfig.resizerConfig.minScale);

            this.jelly.collisionJellyOfObstacleReaction = new DoTweenBounceObstacleJellyOfCollisionReaction(
                this.jelly,
                this.gameConfig.obstacleBounceConfig.bounceStateDuration,
                this.gameConfig.obstacleBounceConfig.bounceDistance,
                this.gameConfig.obstacleBounceConfig.bouncePower);

            this.jelly.collisionObstacleOfJellyReaction = new CollisionObstacleOfJellyReaction(
                this.gameConfig.collisionObstacleOfJellyConfig.obstacleMass,
                this.gameConfig.collisionObstacleOfJellyConfig.forceFrom,
                this.gameConfig.collisionObstacleOfJellyConfig.forceTo);

            this.objectMover = new ForceObjectMover(
                this.jelly.gameObject.GetComponent <Rigidbody>(),
                this.gameConfig.moveConfig.maxSpeed,
                this.gameConfig.moveConfig.moveForce);

            this.jellyInputController = new JellyInputController();

            this.cameraMover = new CameraMoveRelative(
                this.gameCamera.transform,
                this.jelly.transform,
                this.gameConfig.cameraMoveConfig);

            this.targetObstacleProjection = new TargetObstacleProjection(
                this.jelly.transform,
                this.jelly.targetPlane,
                this.jelly.targetBox,
                this.gameConfig.projectionConfig.maxDistance,
                this.gameConfig.projectionConfig.obstacleViewMask);

            this.winEffects = new WinEffects(this.jelly.gameObject);

            this.Init();
        }
Exemple #2
0
    private void Start()
    {
        _objectMover = GetComponent <IObjectMover>();

        if (_objectMover == null)
        {
            Debug.LogError("Forgot to Add the ObjectMover!");
        }
        else
        {
            _objectMover.MoveForward();
        }
    }