Inheritance: MonoBehaviour
Esempio n. 1
0
    public override void InitializeAgent()
    {
        base.InitializeAgent();
        goalDetect       = block.GetComponent <GoalDetect>();
        goalDetect.agent = this;
        rayPer           = GetComponent <RayPerception>();
        localDifficulty  = academy.difficulty;
        scanAgent        = GetComponent <ScanAgent>();
        SetActive(true);

        if (academy.useScan)
        {
            SetActive(false);
            scanAgent.SetActive(true);
        }
        else
        {
            scanAgent.SetActive(false);
        }


        // Cache the agent rigidbody
        agentRB = GetComponent <Rigidbody>();
        // Cache the block rigidbody
        blockRB = block.GetComponent <Rigidbody>();
        // Get the ground's bounds
        areaBounds = ground.GetComponent <Collider>().bounds;
        // Get the ground renderer so we can change the material when a goal is scored
        groundRenderer = ground.GetComponent <Renderer>();
        // Starting material
        groundMaterial = groundRenderer.material;
    }
Esempio n. 2
0
    public override void InitializeAgent()
    {
        base.InitializeAgent();
        goalDetect       = block.GetComponent <GoalDetect>();
        goalDetect.agent = this;
        rayPer           = GetComponent <RayPerception>();

        // Cache the agent rigidbody
        agentRB = GetComponent <Rigidbody>();
        // Cache the block rigidbody
        blockRB = block.GetComponent <Rigidbody>();
        // Get the ground's bounds
        areaBounds = ground.GetComponent <Collider>().bounds;
        // Get the ground renderer so we can change the material when a goal is scored
        groundRenderer = ground.GetComponent <Renderer>();
        // Starting material
        groundMaterial = groundRenderer.material;
    }
Esempio n. 3
0
    public override void Initialize()
    {
        goalDetect       = block.GetComponent <GoalDetect>();
        goalDetect.agent = this;

        // Cache the agent rigidbody
        m_AgentRb = GetComponent <Rigidbody>();
        // Cache the block rigidbody
        m_BlockRb = block.GetComponent <Rigidbody>();
        // Get the ground's bounds
        areaBounds = ground.GetComponent <Collider>().bounds;
        // Get the ground renderer so we can change the material when a goal is scored
        m_GroundRenderer = ground.GetComponent <Renderer>();
        // Starting material
        m_GroundMaterial = m_GroundRenderer.material;

        SetResetParameters();
    }
Esempio n. 4
0
    void Awake()
    {
        m_PushBlockSettings = FindObjectOfType <PushBlockSettings>();

        goalDetect       = block.GetComponent <GoalDetect>();
        goalDetect.agent = this;

        // Cache the agent rigidbody
        m_AgentRb = GetComponent <Rigidbody>();
        // Cache the block rigidbody
        m_BlockRb = block.GetComponent <Rigidbody>();
        // Get the ground's bounds
        areaBounds = ground.GetComponent <Collider>().bounds;
        // Get the ground renderer so we can change the material when a goal is scored
        m_GroundRenderer = ground.GetComponent <Renderer>();
        // Starting material
        m_GroundMaterial = m_GroundRenderer.material;
    }
    //初期化処理
    public override void InitializeAgent()
    {
        base.InitializeAgent();
        goalDetect       = block.GetComponent <GoalDetect>();
        goalDetect.agent = this;
        m_RayPer         = GetComponent <RayPerception>();

        // Cache the agent rigidbody
        m_AgentRb = GetComponent <Rigidbody>();
        // Cache the block rigidbody
        m_BlockRb = block.GetComponent <Rigidbody>();
        // Get the ground's bounds
        areaBounds = ground.GetComponent <Collider>().bounds;
        //レンダラーを取得しておくことで、ゴールした時変えれるようにする
        // Get the ground renderer so we can change the material when a goal is scored
        m_GroundRenderer = ground.GetComponent <Renderer>();
        //最初のは初期のマテリアルを読み込むだけでいい
        // Starting material
        m_GroundMaterial = m_GroundRenderer.material;

        SetResetParameters();
    }