Beispiel #1
0
 // Use this for initialization
 void Start()
 {
     animator           = GetComponent <Animator> ();
     render             = GetComponent <SpriteRenderer> ();
     original_color     = render.color;
     is_player_in_sight = false;
     is_in_sight        = false;
     visiable_range     = 8f;
     game  = GameObject.Find("Root").GetComponent <GameController> ();
     sight = transform.Find("Sight").gameObject.GetComponent <SightController> ();
     original_sight_rotation = transform.Find("Sight").rotation.eulerAngles;
     speed               = Random.Range(10f, 12f);
     original_x          = transform.position.x;
     is_walking          = true;
     is_looking          = true;
     is_right            = true;
     is_right_last_frame = true;
     x_this_frame        = original_x;
     x_last_frame        = original_x;
     movement_speed      = Random.Range(0.15f, 0.25f);
     movement_range      = Random.Range(10f, 15f);
     destroy_delay       = 2f;
     start_time          = Time.time;
 }