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; }
public int Compare(FishControl first,FishControl second) { if ((transform.position - first.transform.position).sqrMagnitude <= (transform.position - second.transform.position).sqrMagnitude) { return -1; } return +1; }
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; }
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>(); }
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); }
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; }
public void Awake() { pcCountdown = UnityEngine.Random.Range(0.0f, pcCountdownInterval); fishControl = GetComponent<FishControl>(); }
public void registerFish(FishControl fishControl) { _fishs.Add(fishControl); }
void Awake() { _thisTransform = transform; _enemyControl = _thisTransform.parent.GetComponent <FishControl>(); }