Ejemplo n.º 1
0
    void Start()
    {
        behaviorPanels.transform.gameObject.SetActive(false); // hide behavior panels at start

        flockBox        = GetComponent <CloudFine.FlockBox>();
        cameraTransform = FindObjectOfType <Camera>().GetComponent <Transform>();

        isPortraitMode  = (Screen.width < Screen.height);
        wasPortraitMode = isPortraitMode; // used to watch for screen orientation changes
        lastHeight      = Screen.height;

        ChangeOrientation(); // this will set up the correct FlockBox size and camera angle
        statusText.text = "";
    }
Ejemplo n.º 2
0
 public override void Spawn(FlockBox neighborhood, Vector3 position)
 {
     base.Spawn(neighborhood, position);
     LockPosition(false);
     speedThrottle = 1;
     Acceleration  = Vector3.zero;
     if (activeSettings)
     {
         Velocity = UnityEngine.Random.insideUnitSphere * activeSettings.maxSpeed;
     }
     else
     {
         Debug.LogWarning("No BehaviorSettings for SteeringAgent " + this.name);
     }
 }
Ejemplo n.º 3
0
 public override void Spawn(FlockBox neighborhood, Vector3 position)
 {
     base.Spawn(neighborhood, position);
     rigidbody.velocity = Velocity;
 }