// Use this for initialization

    void Start()
    {
        robotMovement       = GetComponentInChildren <RobotMovement>();
        robotAttack         = GetComponentInChildren <RobotAttack>();
        robotFollow         = GetComponentInChildren <RobotFollow>();
        robotLaborerControl = GetComponentInChildren <RobotLaborerControl>();
        rigid = GetComponentInChildren <Rigidbody>();
        robotFollow.DisableCameras();

        /*if (isAI)
         * {
         *  //turn off cameras
         *  Camera[] cameras = GetComponentsInChildren<Camera>();
         *  foreach (Camera c in cameras)
         *  {
         *      Destroy(c.gameObject);
         *  }
         *  robotFollow.enabled = false;
         *  robotMovement.moveSpeed = 0;
         *  robotAttack.canRam = false;
         * }*/
        /* NetworkManager.Instance.OwnerSh+= (newPlayer) =>
         * {
         *   Debug.Log("hi");
         *   ipAddress = Network.player.ipAddress;
         *   log = GameObject.Find("Log").GetComponent<Text>();
         *   log.text = "owner changed to me";
         *
         * };*/
        Debug.Log("event listener created");
    }
Ejemplo n.º 2
0
 void Start()
 {
     health      = GameLogic.health;
     robotAttack = this.gameObject.GetComponent <RobotAttack>();
 }