Exemplo n.º 1
0
 public void Start()
 {
     plsh = GetComponent<playerShooting>();
     rb = GetComponent<Rigidbody>();
     col = GetComponent<SphereCollider>();
     calculator = GameObject.FindGameObjectWithTag("scripts").GetComponent<Calculator>();
     sightConstant = calculator.getSightConstant();
     fieldofViewAngle = calculator.getFieldOfView();
     sensitivity = calculator.getSensitivity();
     rotateToTargetSpeed = calculator.getRotateSpeed();
     index = calculator.addBot(this);
     targets = calculator.getTargets(index);
     col.radius= (float)sightConstant;
     shootFlag = false;
     playerInSight = false;
     moveBool = new bool[calculator.getMasterBoolLength()];
     bestPoint = transform.position;
     bestPoints = new Vector3[moveBool.Length];
     bestPointsSV = new float[moveBool.Length];
     team = GetComponent<TeamMember>().teamID;
     teamFinder();
     if (team == 1)
     {
         goal = new Vector3(-37f, -30f, 28f);
     }
     else if(team == 2)
     {
         goal = new Vector3(64f, -30f, -43f);
     }
 }