public static RedLightEnemyController Create(PlayerController player, Vector2 enemeyPos) { var rleCtrl = new RedLightEnemyController(); rleCtrl.enemyPos = enemeyPos; var rlCtrl = RedLightController.Create(player, enemeyPos); ApCtrl.SetAlphaImmediately(rlCtrl.lightAlpha, 0); ApCtrl.SetAlphaImmediately(rlCtrl.spriteAlpha, 0); rleCtrl.rlCtrl = rlCtrl; rleCtrl.player = player; return(rleCtrl); }
public static RedLightPlayerController Create(PlayerController player, Vector2 _pos) { SinMove sm = new SinMove(player.rdLtSinMovDt); sm.data.originDeg = VectorUtils.Do(Vector2.zero, f => UnityEngine.Random.value * 360); var rdLtCtrl = new RedLightPlayerController(); rdLtCtrl.playerPosQueue = player.playerPosDisQueue; rdLtCtrl.sinMove = sm; rdLtCtrl.distanceSpeedCurve = player.rdLtDisSpdCv; rdLtCtrl.rlCtrl = RedLightController.Create(player, _pos); player.StartCoroutine(rdLtCtrl.FollowCor()); return(rdLtCtrl); }