コード例 #1
0
 // 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;
 }
コード例 #2
0
ファイル: TankScript.cs プロジェクト: Hhasni/Unity-D07
 // 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> ();
 }
コード例 #3
0
ファイル: IAScript.cs プロジェクト: Hhasni/Unity-D07
 // 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);
 }
コード例 #4
0
ファイル: TankStatScript.cs プロジェクト: Hhasni/Unity-D07
    //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;
    }