// Use this for initialization void Start() { if (type == Type.Player) { myText = transform.parent.parent.GetComponentInChildren <Text> (); } RtPos = GetComponent <RectTransform> (); TankStat = GetComponentInParent <TankStatScript> (); vOriPos = RtPos.localPosition; }
// Use this for initialization void Start() { TankStat = GetComponent <TankStatScript> (); GMScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <GameManagerScript> (); MoveSpeed = 10; RotSpeed = 100; Boost = 0; RocketMax = 10; BoostMax = 50; RBTank = GetComponent <Rigidbody> (); myGuiScript = GetComponentInChildren <GuiLifeBar> (); }
// Use this for initialization void Awake() { TankStat = GetComponent <TankStatScript> (); nmAgent = GetComponent <NavMeshAgent> (); lTargets = new List <GameObject>(GameObject.FindGameObjectsWithTag("Player")); lTargets.ForEach(SearchDoublon); gCat = transform.GetChild(0).gameObject; gCanon = transform.GetChild(1).gameObject; NextShoot = 1; NextShoot = 0.1f; lTargets.ForEach(SearchDoublon); }
//private GameManagerScript GMScript; // Use this for initialization void Start() { TankStat = GetComponent <TankStatScript> (); //Image[] tmpi = GetComponentInChildren<Canvas> ().GetComponentsInChildren<Image> (); //LifeBar = tmpi[1].rectTransform; ParticleSystem[] tmp = GetComponentsInChildren <ParticleSystem> (); psSmoke = tmp [0]; psBurn = tmp [1]; HP = 150; RDamage = 50; SDamage = 1; Speed = 30; // RocketMax = 10; }