コード例 #1
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;
        }
    }
コード例 #2
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;
        }
    }