Esempio n. 1
0
 // Use this for initialization
 void Start()
 {
     rb    = GetComponent <Rigidbody2D> ();
     score = 0;
     audio = GetComponent <AudioSource> ();
     l     = GetComponent <LifeControll> ();
 }
Esempio n. 2
0
 private void OnTriggerExit(Collider other)
 {
     if (other.gameObject == enemy.gameObject)
     {
         enemy = null;
     }
 }
Esempio n. 3
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Player" && other.gameObject != this.gameObject)
     {
         enemy = other.gameObject.GetComponent <LifeControll>();
     }
 }
Esempio n. 4
0
 // Use this for initialization
 void Start()
 {
     rotDirec      = 1;
     rb            = GetComponent <Rigidbody> ();
     player        = GameObject.FindGameObjectWithTag("Player");
     refUpFaceLeft = GameObject.Find("RefUpFaceLeft").transform.localRotation;
     refList.Add(refUpFaceLeft);
     refUpFaceRight   = GameObject.Find("RefUpFaceRight").transform.localRotation;
     refDownFaceRight = GameObject.Find("RefDownFaceRight").transform.localRotation;
     refList.Add(refDownFaceRight);
     refDownFaceLeft = GameObject.Find("RefDownFaceLeft").transform.localRotation;
     refLeftFaceDown = GameObject.Find("RefLeftFaceDown").transform.localRotation;
     refList.Add(refLeftFaceDown);
     refLeftFaceUp  = GameObject.Find("RefLeftFaceUp").transform.localRotation;
     refRightFaceUp = GameObject.Find("RefRightFaceUp").transform.localRotation;
     refList.Add(refRightFaceUp);
     refRightFaceDown = GameObject.Find("RefRightFaceDown").transform.localRotation;
     grav             = new Vector2(0, -35);
     life             = GameObject.Find("GameController").GetComponent <LifeControll> ();
     uiC     = GameObject.Find("GameController").GetComponent <UIControll> ();
     gravHor = true;
 }
Esempio n. 5
0
 // Use this for initialization
 void Start()
 {
     rb       = GetComponent <Rigidbody> ();
     life     = GameObject.FindGameObjectWithTag("GameController").GetComponent <LifeControll>();
     hitTimer = 0.5f;
 }
Esempio n. 6
0
 // Use this for initialization
 void Start()
 {
     mvC = GetComponent <MovController> ();
     l   = GetComponent <LifeControll> ();
 }
Esempio n. 7
0
 void Start()
 {
     life    = GameObject.FindGameObjectWithTag("GameController").GetComponent <LifeControll> ();
     hitTime = 0.5f;
 }