// 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
파일: RSManager.cs 프로젝트: HappySaila/RIR
    // Use this for initialization
    void Start()
    {
        robotMovement = GetComponentInChildren <RSMovement>();
        robotAttack   = GetComponentInChildren <RSAttack>();
        robotFollow   = GetComponentInChildren <RobotFollow>();
        rigid         = GetComponentInChildren <Rigidbody>();

        robotLaborerControl = GetComponentInChildren <RSLaborerControl>();
        agent = GetComponentInChildren <NavMeshAgent>();

        if (isAI)
        {
            //turn off cameras
            robotFollow.DisableCameras();
            robotFollow.enabled     = false;
            robotMovement.moveSpeed = 0;
        }

        //sound town
        audioSource  = GetComponentInChildren <AudioSource>();
        isMainPlayer = false;
        //if in multiplayer dont need to do the is red check
        if (audioListener != null && !isRed && !isAI)      //at the start only the blue player in single and split screen
        {
            isMainPlayer          = true;
            audioListener.enabled = true;
        }
    }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        robotMovement       = GetComponentInChildren <RSMovement>();
        robotAttack         = GetComponentInChildren <RSAttack>();
        robotFollow         = GetComponentInChildren <RobotFollow>();
        rigid               = GetComponentInChildren <Rigidbody>();
        robotLaborerControl = GetComponentInChildren <RSLaborerControl>();
        agent               = GetComponentInChildren <NavMeshAgent>();

        if (isAI)
        {
            //turn off cameras
            robotFollow.DisableCameras();
            robotFollow.enabled     = false;
            robotMovement.moveSpeed = 0;
        }
    }