Esempio n. 1
0
    // Start is called before the first frame update
    void Start()
    {
        bb     = gameObject.GetComponent <base_behavior>();
        target = bb.target;


        if (bb.seekScript == null)
        {
            bb.seekScript         = gameObject.AddComponent <Seek>();
            bb.seekScript.target  = target;
            bb.seekScript.weight  = 0.7f;
            bb.seekScript.enabled = true;


            bb.boidcoh         = gameObject.AddComponent <BoidCohesion>();
            bb.boidcoh.targets = bb.target.GetComponent <squad_parent_script>().children;
            bb.boidcoh.weight  = 0.4f;
            bb.boidcoh.enabled = true;

            bb.boidsep         = gameObject.AddComponent <BoidSeparation>();
            bb.boidsep.targets = bb.target.GetComponent <squad_parent_script>().children;
            bb.boidsep.weight  = 70.0f;
            bb.boidsep.enabled = true;
        }
    }
Esempio n. 2
0
    // Start is called before the first frame update
    void Start()
    {
        bb     = gameObject.GetComponent <base_behavior>();
        target = bb.target;


        if (bb.seekScript == null)
        {
            bb.seekScript         = gameObject.AddComponent <Seek>();
            bb.seekScript.target  = target;
            bb.seekScript.weight  = 1.0f;
            bb.seekScript.enabled = true;

            //bb.fleeScript = gameObject.AddComponent<Flee>();
            //bb.fleeScript.target = target;
            //bb.fleeScript.enabled = true;
        }
    }
Esempio n. 3
0
 // Start is called before the first frame update
 void Start()
 {
     bb = gameObject.GetComponent <base_behavior>();
 }
Esempio n. 4
0
 // Start is called before the first frame update
 void Start()
 {
     bb     = gameObject.GetComponent <base_behavior>();
     target = bb.target;
 }