Ejemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     // get requried compoents
     mover = GetComponent <TankMover> ();
     pawn  = GetComponent <TankData> ();
     shoot = GetComponent <TankShooter> ();
 }
    private Color hearingColor = Color.red;                     //Color for hearing sphere gizmo, init. red.



    // Start is called before the first frame update
    void Start()
    {
        //Get and set data and motor on Start
        data    = GetComponent <TankData>();
        motor   = GetComponent <TankMotor>();
        tf      = GetComponent <Transform>();
        shooter = GetComponent <TankShooter>();

        //get reference to manager player (temporary until next milestone)
        player = GameManager.instance.instantiatedPlayerTank;

        //Add self to GameManager list of enemies
        GameManager.instance.instantiatedEnemyTanks.Add(this.gameObject);

        //Get and Set Territory from randomly generated room, if not pre-set
        if (!territory)
        {
            //Set Territory to a random territory from the level game object - map generator list of territories
            territory = GameManager.instance.LevelGameObject.GetComponent <MapGenerator>().instantiatedTerritories[UnityEngine.Random.Range(0, GameManager.instance.LevelGameObject.GetComponent <MapGenerator>().instantiatedTerritories.Count)];
        }

        //Get and Set Waypoints array from territory, if waypoints array is null
        if (waypoints == null || waypoints.Length == 0)
        {
            waypoints = territory.waypoints;
        }

        //Teleport Swiss on start to middle of assigned territory (to avoid getting lost and stuck in generated map
        if (personality == Personalities.Swiss)
        {
            transform.position = territory.gameObject.transform.position;
        }
    }
Ejemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     shooter = GetComponent <TankShooter>();
     motor   = GetComponent <TankMotor>();
     data    = GetComponent <TankData>();
     health  = GetComponent <Health>();
 }
Ejemplo n.º 4
0
 private void Awake()
 {
     tf     = GetComponent <Transform>();
     motor  = GetComponent <TankMotor>();
     attack = GetComponent <TankShooter>();
     health = GetComponent <Health>();
 }
Ejemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     mover   = GetComponent <TankMover>();
     shooter = GetComponent <TankShooter>();
     health  = GetComponent <TankHealth>();
     Bullet  = GetComponent <Bullet>();
 }
Ejemplo n.º 6
0
 // Start is called before the first frame update
 void Start()
 {
     // get components for each variable for inspector
     mover   = GetComponent <TankMover>();
     shooter = GetComponent <TankShooter>();
     health  = GetComponent <TankHealth>();
 }
Ejemplo n.º 7
0
 // Start is called before the first frame update
 void Start()
 {
     //tells when the game starts what these objects mean
     data    = gameObject.GetComponent <TankData>();
     motor   = gameObject.GetComponent <TankMotor>();
     shooter = gameObject.GetComponent <TankShooter>();
 }
 // Start is called before the first frame update
 void Start()
 {
     data    = gameObject.GetComponent <TankData>();
     motor   = gameObject.GetComponent <TankMotor>();
     tf      = gameObject.GetComponent <Transform>();
     shooter = gameObject.GetComponent <TankShooter>();
 }
Ejemplo n.º 9
0
 // Start is called before the first frame update
 void Start()
 {
     motor   = GetComponent <TankMotor>();
     data    = GetComponent <TankData>();
     shooter = GetComponent <TankShooter>();
     CanSee  = GetComponent <AISenses>();
     CanHear = GetComponent <AISenses>();
 }
Ejemplo n.º 10
0
 // Start is called before the first frame update
 void Start()
 {
     data    = gameObject.GetComponent <TankData>();
     motor   = gameObject.GetComponent <TankMotor>();
     tf      = gameObject.GetComponent <Transform>();
     shooter = gameObject.GetComponent <TankShooter>();
     target  = GameManager.instance.instantiatedPlayerTank.transform;
 }
Ejemplo n.º 11
0
    // Start is called before the first frame update
    void Start()
    {
        data = GetComponent <TankData>();

        motor = GetComponent <TankMotor>();

        shooter = GetComponent <TankShooter>();
    }
Ejemplo n.º 12
0
    //TODO Set up a method. bool isNotAtFinalWaypoint = currentWaypoint < (waypoints.Length - 1);
    // Start is called before the first frame update
    void Start()
    {
        data    = GetComponent <TankData>();
        motor   = GetComponent <TankMotor>();
        shooter = GetComponent <TankShooter>();

        lastEventTime = Time.time - timerDelay;

        waypoints = GameObject.FindGameObjectsWithTag("patrolPoint");
    }
 // Initialize the variables and game state
 private void Awake()
 {
     // Recall and intialize Transform component
     tf = GetComponent <Transform>();
     // Recall and intialize TankMotor component
     mover = GetComponent <TankMotor>();
     // Recall and intialize TankShooter component
     shoot = GetComponent <TankShooter>();
     // Recall and intialize TankHealth component
     health = GetComponent <TankHealth>();
 }
Ejemplo n.º 14
0
    /* Private Variables */


    private void Awake()
    {
        // Component reference assignments
        tankTf         = this.gameObject.GetComponent <Transform>();
        tankMover      = this.gameObject.GetComponent <TankMover>();
        tankShooter    = this.gameObject.GetComponent <TankShooter>();
        tankCc         = this.gameObject.GetComponent <CharacterController>();
        tankHealthMan  = this.gameObject.GetComponent <TankHealthManager>();
        tankScorer     = this.gameObject.GetComponent <TankScorer>();
        tankNoisemaker = this.gameObject.GetComponent <TankNoisemaker>();
    }
Ejemplo n.º 15
0
 /// <summary>
 /// Sets up this InputController's references to the new tank
 /// </summary>
 /// <param name="newTankData">The TankData component of the new tank being controlled by this InputController.</param>
 public void SetTankComponentReferences(TankData newTankData)
 {
     tankData    = newTankData;
     tankShooter = newTankData.tankShooter;
     tankMover   = newTankData.tankMover;
     if (playerNumber == PlayerNumber.Player1)
     {
         tankData.tankCamera.cullingMask = GameManager.gm.p1UILayer;
     }
     else if (playerNumber == PlayerNumber.Player2)
     {
         tankData.tankCamera.cullingMask = GameManager.gm.p2UILayer;
     }
 }
    // Start is called before the first frame update
    void Start()
    {
        data    = GetComponent <TankData>();
        motor   = GetComponent <TankMotor>();
        shooter = GetComponent <TankShooter>();

        if (this.gameObject == GameManager.Instance.Players[0])
        {
            inputScheme = InputScheme.WASD;
        }
        else
        {
            inputScheme = InputScheme.arrowKeys;
        }
    }
Ejemplo n.º 17
0
    // Start is called before the first frame update
    void Start()
    {
        senses     = gameObject.GetComponent <Senses>();
        data       = GetComponent <TankData>();
        motor      = GetComponent <TankMotor>();
        shooter    = GetComponent <TankShooter>();
        health     = GetComponent <Health>();
        controller = GetComponent <AIController>();

        lastEventTime = Time.time;

        playerOne = GameManager.Instance.Players[0];
        playerTwo = GameManager.Instance.Players[1];
        shooter.cannonBallPrefab = GameManager.Instance.projectilePrefab;
    }
Ejemplo n.º 18
0
    public InputScheme inputScheme = InputScheme.arrowKeys; // Default control scheme is set to arrow keys, but can be changed

    // Start is called before the first frame update
    void Start()
    {
        data    = GetComponent <TankData>();
        motor   = GetComponent <TankMotor>();
        shooter = GetComponent <TankShooter>();

        lastEventTime = Time.time - timerDelay;

        if (this.gameObject == GameManager.Instance.Players[0])
        {
            inputScheme = InputScheme.arrowKeys;
        }
        if (this.gameObject == GameManager.Instance.Players[1])
        {
            inputScheme = InputScheme.WASD;
        }
    }
Ejemplo n.º 19
0
    [HideInInspector] public TankShooter shooter; // For TankShooter

    void Start()
    {
        // Fill the variables with the proper componets
        mover   = GetComponent <TankMover> ();
        shooter = GetComponent <TankShooter> ();
    }
Ejemplo n.º 20
0
    private TankShooter ts;                                     //tank shooter data

    // Use this for initialization
    void Start()
    {
        ts = GetComponent <TankShooter> ();             //sets ts to tank shooter data

        Destroy(gameObject, bulletLife);                //destroys bullet after set amount of time
    }
Ejemplo n.º 21
0
 protected override void Awake()
 {
     base.Awake();
     _tankShooter = GetComponent <TankShooter>();
     _nodeManager = GameObject.FindObjectOfType <NodeManager>();
 }
Ejemplo n.º 22
0
 // Use this for initialization
 void Start()
 {
     data = GetComponent <TankData> ();                                              //sets data to tank data
     ts   = GetComponent <TankShooter> ();                                           //sets ts to tank shooter
 }
Ejemplo n.º 23
0
 void Awake()
 {
     tankshooter = TankGameObject.GetComponent <TankShooter> ();
     guiDisplay  = GuiGameObject.GetComponent <GuiDisplay> ();
     agent       = AgentGameObject.GetComponent <UnityEngine.AI.NavMeshAgent> ();
 }
Ejemplo n.º 24
0
 void Start()
 {
     mover   = GetComponent <TankMover> ();
     shooter = GetComponent <TankShooter> ();
 }