示例#1
0
        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);
        }
示例#2
0
    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(); });
    }
示例#3
0
 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);
 }
示例#4
0
 public Cheat(WinLoseController winLoseController)
 {
     _winLoseController = winLoseController;
 }
示例#5
0
 void Start()
 {
     winLose               = loseWinPanel.GetComponent <WinLoseController>();
     winLoseEnable         = loseWinPanel.GetComponent <Image>();
     winLoseEnable.enabled = false;
 }