public NavigationComponent(NavMeshAgent agent, IEnumerable <DestinationPoint> destinationPoints, Transform mainTransform, Transform syncTransform, HealthController healthController, WinLoseController winLoseController, GameObject hitEffect, IInstantiator instantiator) { _agent = agent; _mainTransform = mainTransform; _syncTransform = syncTransform; _healthController = healthController; _winLoseController = winLoseController; _hitEffect = hitEffect; _instantiator = instantiator; var random = new System.Random(); _destination = destinationPoints.OrderBy(x => random.Next()).First(); mainTransform.LookAt(_destination.transform.position); }
private void Awake() { Inistance = this; ToastHolder = GameSetup.instance.ToastHolder; ObjectsToDisable = GameSetup.instance.ObjectsToDisable; BackgroundWinArabic = GameSetup.instance.BackgroundWinArabic; BackgroundWinEnglish = GameSetup.instance.BackgroundWinEnglish; BackgroundLoseArabic = GameSetup.instance.BackgroundLoseArabic; BackgroundLoseEnglish = GameSetup.instance.BackgroundLoseEnglish; ButtonBackArabic = GameSetup.instance.ButtonBackArabic; ButtonBackEnglish = GameSetup.instance.ButtonBackEnglish; ImageGoldArabic = GameSetup.instance.ImageGoldArabic; ImageGoldEnglish = GameSetup.instance.ImageGoldEnglish; CanvasWinLose = GameSetup.instance.CanvasWinLose; ShouldStart = false; CanvasDisplayedBefore = false; CanvasWinLose.transform.GetChild(2).GetComponent <Button>().onClick.AddListener(() => { LoadScene(); }); }
public void SetUp(IEnumerable <DestinationPoint> destinations, HealthController healthController, WinLoseController winLoseController, IInstantiator instantiator) { AnimationComponent = new AnimationComponent(_animator); NavigationComponent = new NavigationComponent(_navMeshAgent, destinations, transform, _syncTransform, healthController, winLoseController, _hitEffect, instantiator); PhysicsComponent = new PhysicsComponent(gameObject.GetComponentsInChildren <Rigidbody>(), AnimationComponent, NavigationComponent); StunComponent = new StunComponent(PhysicsComponent, _onStun); NavigationComponent.Init(StunComponent); }
public Cheat(WinLoseController winLoseController) { _winLoseController = winLoseController; }
void Start() { winLose = loseWinPanel.GetComponent <WinLoseController>(); winLoseEnable = loseWinPanel.GetComponent <Image>(); winLoseEnable.enabled = false; }