void Awake() { chainMovement = GameObject.Find("SpawnController") .GetComponent <ChainMovement>(); explosion = GameObject.Find("ExplosionController") .GetComponent <ExplosionController>(); }
void Awake() { chainMovement = GetComponent <ChainMovement>(); gameController = GameObject.Find("GameController") .GetComponent <GameController> (); villain = GameObject.Find("JamODrum") .GetComponent <VillainController>(); villain.RegisterMagicStartAction(() => { forwardPercentagePerSecond *= 0.02f; spawnInterval *= 50f; }); villain.RegisterMagicEndAction(() => { forwardPercentagePerSecond *= 50f; spawnInterval *= 0.02f; }); gameController.OnGameStart += () => { spawnLock = false; }; gameController.OnVillainWin += () => { spawnLock = true; }; gameController.OnHeroWin += () => { spawnLock = true; }; }
void Awake () { chainMovement = GetComponent<ChainMovement>(); gameController = GameObject.Find ("GameController") .GetComponent<GameController> (); villain = GameObject.Find ("JamODrum") .GetComponent<VillainController>(); villain.RegisterMagicStartAction (() => { forwardPercentagePerSecond *= 0.02f; spawnInterval *= 50f; }); villain.RegisterMagicEndAction (() => { forwardPercentagePerSecond *= 50f; spawnInterval *= 0.02f; }); gameController.OnGameStart += () => { spawnLock = false; }; gameController.OnVillainWin += () => { spawnLock = true; }; gameController.OnHeroWin += () => { spawnLock = true; }; }
private void Start() { //Application.targetFrameRate = 30; _movement = new ChainMovement(_balls) { Speed = _speed, Friction = _friction, MaxSpeed = _maxSpeed, SelfFriction = _selfFriction }; _movement.CollisionAccepted += args => { var groupCount = GroupCount(args.Id, _balls.Count - 1, j => j + 1, (k, i) => _balls[k].Type == _balls[i].Type); if (groupCount > 2) { RemoveGroup(args.Id, args.Id + groupCount - 1); } }; var types = _prototype.GetComponent <BallDecorator>().Types; _ballsFactory.SetCount(_ballsCount) .SetPrototype(_prototype) .SetTypes(types); //TODO remove this var testobj = _prototype.Clone() as Ball; testobj.Move(_prototype.Size * _ballsCount * 3); _balls.Add(testobj); testobj = _prototype.Clone() as Ball; testobj.Move(_prototype.Size * (_ballsCount * 3 + 1)); _balls.Add(testobj); testobj = _prototype.Clone() as Ball; testobj.Move(_prototype.Size * (_ballsCount * 3 + 2)); _balls.Add(testobj); testobj = _prototype.Clone() as Ball; testobj.Move(_prototype.Size * (_ballsCount * 4)); testobj.Type = 0; _balls.Add(testobj); _balls.Reverse(); }
void Awake () { chainMovement = GameObject.Find ("SpawnController") .GetComponent <ChainMovement>(); explosion = GameObject.Find ("ExplosionController") .GetComponent<ExplosionController>(); }