예제 #1
0
 public DoTweenBounceObstacleJellyOfCollisionReaction(Jelly jelly, float bounceStateDuration, float bounceDistance, float bouncePower)
 {
     this.bounceStateDuration = bounceStateDuration;
     this.bounceDistance      = bounceDistance;
     this.bouncePower         = bouncePower;
     this.jelly = jelly;
 }
예제 #2
0
        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();
        }