// 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");
    }
示例#2
0
 // Use this for initialization
 void Start()
 {
     anim           = GetComponent <Animator> ();
     rigid          = GetComponent <Rigidbody> ();
     laborerControl = GetComponent <RobotLaborerControl> ();
     robotManager   = GetComponentInParent <RobotManagement> ();
 }