void Start() { cannon = GetComponent<CannonController>(); motor = GetComponent<ShipMotor>(); ship = GetComponent<Ship>(); ship.OnDead += OnDead; }
private void Start() { motor = GetComponent<ShipMotor>(); cannon = GetComponent<CannonController>(); lockCursor(); }
/// <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; }
// 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)); } } }
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(); }
// 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>(); }
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>(); }
public Image windStrength; // image GUI void Start() { cannonController = CannonController.instance; // create the pathways to the instances windController = WindController.instance; }
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; } } }
// Use this for initialization void Start() { controller = GetComponentInChildren <CannonController>(); }