// Use this for initialization
    void Start()
    {
        // Find the player script on the Player, find the player targetPostions, choose Random target from the targetPositions
        playerScript = GameObject.Find("Player(Clone)").GetComponent <Player1>();
        playerScript.targetPositions = GameObject.FindGameObjectsWithTag("PlayerRagdoll");
        indexP = Random.Range(0, playerScript.targetPositions.Length);
        playerScript.currentTarget = playerScript.targetPositions[indexP];

        //  playerScript.bodyPartsTriggers = GameObject.FindGameObjectsWithTag("PlayerRagdoll");

        enemyScript = GameObject.Find("Enemy(Clone)").GetComponent <BanditHealth>();
        enemyScript.targetPositions = GameObject.FindGameObjectsWithTag("BanditRagdoll");
        indexE = Random.Range(0, enemyScript.targetPositions.Length);
        enemyScript.currentTarget = enemyScript.targetPositions[indexE];

        propsMNG = GameObject.Find("PropsRandomManager(Clone)").GetComponent <PropsManager>();
        propsMNG.targetPositions = GameObject.FindGameObjectsWithTag("Props");
        if (propsMNG.targetPositions.Length > 0)
        {
            indexPROPS             = Random.Range(0, propsMNG.targetPositions.Length);
            propsMNG.currentTarget = propsMNG.targetPositions[indexPROPS];
        }

        //   float height = Random.Range(1.0f, 3.0f);
        shotDir = (playerScript.currentTarget.transform.position - gameObject.transform.position).normalized;

        // set the initial bullet speed
        speed = NewBulletSpeed();
    }
Exemplo n.º 2
0
    private void Awake()
    {
        Instance      = this;
        _propsManager = GetComponent <PropsManager>();
        _ending       = GetComponent <Ending>();

        EverythingbutMenuBus = FMODUnity.RuntimeManager.GetBus("Bus:/Everything but Menu");
    }
Exemplo n.º 3
0
    void Start()
    {
        _propsManager = FindObjectOfType <PropsManager> ();

        if (_propsManager.CanAddProps)
        {
            _propsManager.InitializePropsInPropsList(gameObject);
        }
    }
Exemplo n.º 4
0
 void Start()
 {
     _mapGrid       = GetComponent <Grid>();
     _navSurface    = GetComponent <NavMeshSurface>();
     _levelManager  = GetComponent <LevelManager>();
     _propsManager  = GetComponent <PropsManager>();
     _tileGenerator = GetComponent <TileGenerator>();
     Generate();
 }