예제 #1
0
 public void Initialize(Player targetPlayer, FragmentController fragmentController)
 {
     this.targetPlayer  = targetPlayer;
     FragmentController = fragmentController;
     transform.position = targetPlayer.Position + new Vector3(UnityEngine.Random.Range(-5, 5), 0, UnityEngine.Random.Range(-5, 5));
     PathFindingAgent.Initialize(this);
 }
예제 #2
0
    protected override void OnInitialize()
    {
        FragmentController fragmentController = MainController.GetControllerOfType(typeof(FragmentController)) as FragmentController;
        FriendlyController friendlyController = MainController.GetControllerOfType(typeof(FriendlyController)) as FriendlyController;

        Player.Initialize(fragmentController, friendlyController);
    }
    protected override void OnInitialize()
    {
        Player             player             = (MainController.GetControllerOfType(typeof(PlayerController)) as PlayerController).Player;
        FragmentController fragmentController = MainController.GetControllerOfType(typeof(FragmentController)) as FragmentController;

        foreach (var robot in robots)
        {
            robot.Initialize(player, fragmentController);
        }
    }
예제 #4
0
    private IEnumerator Initialize()
    {
        if (isFake)
        {
            yield break;
        }

        fc                 = transform.root.GetComponent <FragmentController>();
        health             = fc.fragmentHealth;
        base.hitIndication = false;
    }
예제 #5
0
    protected override void OnInitialize()
    {
        for (int i = whisps.Count - 1; i >= 0; i--)
        {
            if (whisps[0].gameObject.activeSelf == false)
            {
                whisps.RemoveAt(i);
            }
        }

        FragmentController fragmentController = MainController.GetControllerOfType(typeof(FragmentController)) as FragmentController;

        foreach (Whisp whisp in whisps)
        {
            whisp.Initialize(fragmentController);
        }
    }
예제 #6
0
    public void DoPuzzleSetup()
    {
        base.DoSetup();

        forceField = Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/Puzzles/Forcefield"));
        forceField.transform.parent   = this.transform;
        forceField.transform.position = Vector3.zero;
        GameObject fragment_case = Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/Puzzles/FragmentCase"));

        fragment_case.transform.parent   = this.transform;
        fragment_case.transform.position = Vector3.zero;
        fragment_case.GetComponent <CircleCollider2D>().isTrigger = true;
        fragmentCase = fragment_case.GetComponent <FragmentCase>();

        fragment = fragmentCase.getFragment();
        fragment.currentState = FragmentController.states.IDLE;
        Debug.Log("Fragment : " + fragment.name);
    }
예제 #7
0
 public void Initialize(FragmentController fragmentController, FriendlyController friendlyController)
 {
     pathfindingAgent.Initialize(this);
     this.fragmentController = fragmentController;
     this.friendlyController = friendlyController;
 }
예제 #8
0
 public void Initialize(FragmentController fragmentController)
 {
     FragmentController = fragmentController;
     //StateMachine = new StateMachine<Whisp>();
     pathfindingAgent.Initialize(this);
 }
예제 #9
0
    private IEnumerator DeleteFragments(FragmentController fragment)
    {
        yield return(new WaitForSeconds(1.5f));

        Destroy(fragment.gameObject);
    }