Beispiel #1
0
 void Start()
 {
     cannon = GetComponent<CannonController>();
     motor = GetComponent<ShipMotor>();
     ship = GetComponent<Ship>();
     ship.OnDead += OnDead;
 }
Beispiel #2
0
    private void Start()
    {
        motor = GetComponent<ShipMotor>();
        cannon = GetComponent<CannonController>();

        lockCursor();
    }
Beispiel #3
0
    /// <summary>
    /// Initialises the script
    /// </summary>
    void Start()
    {
        m_fireScript = GetComponent<BulletFireScript>();

        //TODO: figure out if cannons need to know about their cannon controller.
        m_controller = GetComponentInParent<CannonController>();
        m_swivelRangeDegrees = m_controller.SwivelRangeDegrees;
    }
	public TurretUndeployingState(GameObject npc, CannonController[] cannonControllers, BodyController baseController, AnimationController animationController): base(npc)
	{
		stateID 					= StateID.UnDeploying;
		turretActor	 				= npc.GetComponent<SuperTurret>();
		this.cannonControllers 		= cannonControllers;
		this.baseController 		= baseController;
		this.animationController 	= animationController;
	}
Beispiel #5
0
 // Use this for initialization
 void Start()
 {
     navAgent = GetComponent<NavMeshAgent>();
     body = GetComponent<Rigidbody>();
     cannonController = GetComponentInChildren<AICannonController>();
     if (navAgent != null)
     {
         if (navAgent.isOnNavMesh)
         {
             navAgent.SetDestination(new Vector3(10, 1, 100));
         }
     }
 }
Beispiel #6
0
	protected override void Start () {
		base.Start ();
		controller = new CannonController (this);
		health = 6;
		numMaxBullets = 1;
		timeBetweenSteps = 0f;
		t_timeBetweenSteps = 3f;
		renderer.enabled = false;

		if (Application.loadedLevelName == "Level_2") {
			cannonYRange = 1f;
		}

	}
    void Start()
    {
        if (soundSystem == null) {
            this.enabled = false;
            return;
        }

        cannon = GetComponent<CannonController>();
        motor = GetComponent<ShipMotor>();
        ship = GetComponent<Ship>();

        Bind();

        shootSoundPriority = soundSystem.MinPriority();
        boostSoundPriority = soundSystem.MaxPriority();
    }
Beispiel #8
0
 // Use this for initialization
 void Start()
 {
     cannonController = GetComponentInChildren<AICannonController>();
     networkAI = GetComponentInParent<NetworkedAI>();
     if (networkAI != null)
     {
         aiType = networkAI.aiType;
     }
     else
     {
         Debug.LogError("NetworkedAI was unable to be found in parent.");
     }
 }
 /// <summary>
 /// Initialises the aiming script
 /// </summary>
 void Start()
 {
     m_controller = GetComponentInChildren<PlayerCannonController>();
 }
Beispiel #10
0
	private IEnumerator InstantiateCannon(float delay)
    {
        yield return new WaitForSeconds(delay);
             
		inprocess=false;
		GameObject cannon = Instantiate(Resources.Load(_unitPath), spawner.transform.position, Quaternion.identity)as GameObject;
		cannon.transform.SetParent(this.gameObject.transform);
		_cannonController = cannon.GetComponent<CannonController>();
		_cannonController.flag=Flag;
		_cannonController.life=life;
		_cannonController.shield = shield;
		_cannonController.damage = Damage[_level];
        _cannonController.AttackDelay = 1f / AttackSpeed[_level];
        cannon.name = "Cannon";
	}
 // Use this for initialization
 void Start()
 {
     mousePos   = Camera.main.ScreenToWorldPoint(Input.mousePosition);
     controller = GetComponentInChildren <CannonController>();
 }
Beispiel #12
0
    public Image windStrength;       // image GUI

    void Start()
    {
        cannonController = CannonController.instance;   // create the pathways to the instances
        windController   = WindController.instance;
    }
Beispiel #13
0
	void InspectorCannons(SuperTurret turret)
	{
		turret.cannonsExpanded = EditorGUILayout.Foldout( turret.cannonsExpanded,"Cannons");

		if(turret.cannonsExpanded)
		{
			turret.cannonsNumber = EditorGUILayout.IntField("Number of cannons",turret.cannonsNumber);
			
			if(turret.cannonsNumber == 0)
				// 1 canon minimum
				turret.cannonsNumber = 1;
			
			if(turret.cannonControllers.Length != turret.cannonsNumber)
			{
				CannonController[] cannons  = new CannonController[turret.cannonsNumber];
				
				for (int x = 0; x< turret.cannonsNumber; x++)
				{
					if (turret.cannonControllers.Length > x)
						cannons[x] = turret.cannonControllers[x];
				}
				
				turret.cannonControllers = cannons;
			}
			
			for (int x =0; x < turret.cannonControllers.Length; x++)
			{
				turret.cannonControllers[x] = EditorGUILayout.ObjectField("Cannon "+x, turret.cannonControllers[x], typeof(CannonController),true) as CannonController;
			}
		}	
	}
Beispiel #14
0
 // Use this for initialization
 void Start()
 {
     controller = GetComponentInChildren <CannonController>();
 }