Exemplo n.º 1
0
 public void Awake()
 {
     fishControl = GetComponent<FishControl>();
     proxControl = GetComponent<ProximityControl>();
     fishMove = GetComponent<FishMove>();
     closestFishTimer = UnityEngine.Random.Range(0.0f, closestFishTimerInterval);
 }
    // Use this for initialization
    void Start()
    {
        fishControl = fishControlGO.GetComponent<FishControl>();
        protocolText = protocolTextGO.GetComponent<Text>();

        fishControl.OnProtocolChange += OnProtocolTextChange;
    }
Exemplo n.º 3
0
 public int Compare(FishControl first,FishControl second)
 {
     if ((transform.position - first.transform.position).sqrMagnitude <= (transform.position - second.transform.position).sqrMagnitude)
     {
         return -1;
     }
     return +1;
 }
Exemplo n.º 4
0
    public void Awake()
    {
        fishControl = GetComponent<FishControl>();
        fishMove = GetComponent<FishMove>();
        schooling = GetComponent<Schooling>();
        updateTimer = UnityEngine.Random.Range(0.0f, updateInterval);

        hit = new RaycastHit();
    }
 void OnEnable()
 {
     _swim                  = GetComponent <Swim>();
     _swimLeader            = null;
     transform.position     = Vector3.zero;
     transform.right        = Vector3.right;
     _fishControl           = GetComponent <FishControl>();
     _fishControl._callDie += calldie;
 }
Exemplo n.º 6
0
 public void Awake()
 {
     changeDirectionTimer = Random.Range(0.0f, changeDirectionInterval);
     targetDirection = Random.rotation.eulerAngles.normalized * 2 - Vector3.one;
     transform.forward = Vector3.forward;
     moveDirection = transform.forward;
     transform.LookAt(Vector3.forward);
     fishControl = GetComponent<FishControl>();
 }
Exemplo n.º 7
0
    public void Awake()
    {
        fishControl = GetComponent<FishControl>();

        fishMove = GetComponent<FishMove>();
        schooling = GetComponent<Schooling>();
        updateTimer = UnityEngine.Random.Range(0.0f, UpdateInterval);

        GL_OctreeRenderer.AddRenderDelegate(GL_Draw);
    }
 void OnEnable()
 {
     _fishControl = GetComponent <FishControl>();
     if (gameObject.tag == "fish")
     {
         _fishControl._callDie += calldie;
     }
     _swim      = GetComponent <Swim>();
     TimeRotate = RotateInterval + Random.Range(-RotateIntervalRndRange, RotateIntervalRndRange);
 }
Exemplo n.º 9
0
    void OnEnable()
    {
        _swim        = GetComponent <Swim>();
        _fishControl = GetComponent <FishControl>();
        _tr          = transform;

        _fishControl._callDie += calldie;

        IsRotating = true;

        TimeRotate  = 1;
        SpeedRotate = 180;

        RndForceRotate         = Random.insideUnitCircle.normalized * 96;
        TimeIntervalRotate     = Random.Range(0.1f, 2.5f);
        RotateSpdWithDirection = (Random.Range(0, 2) == 0 ? -1f : 1f) * SpeedRotate;
    }
Exemplo n.º 10
0
 public void Awake()
 {
     pcCountdown = UnityEngine.Random.Range(0.0f, pcCountdownInterval);
     fishControl = GetComponent<FishControl>();
 }
Exemplo n.º 11
0
 public void registerFish(FishControl fishControl)
 {
     _fishs.Add(fishControl);
 }
Exemplo n.º 12
0
 void Awake()
 {
     _thisTransform = transform;
     _enemyControl  = _thisTransform.parent.GetComponent <FishControl>();
 }