コード例 #1
0
    private void EatFish(GameObject fishObject)
    {
        if (isFull) return; // Cant eat other fish while full.
        isFull = true;

        penguinArea.RemoveSpecificFish(fishObject);

        AddReward(1f);
    }
コード例 #2
0
 private void EatFish(GameObject fishObject)
 {
     if (isFull)
     {
         return;
     }
     isFull = true;
     penguinArea.RemoveSpecificFish(fishObject);
     AddReward(1f);
 }
コード例 #3
0
ファイル: PenguinAgent.cs プロジェクト: egoquat/MLTestUnity01
    private void EatFish(GameObject objectFish)
    {
        if (true == isFull)
        {
            return; // Can't eat another fish while full.
        }
        isFull = true;

        penguinArea.RemoveSpecificFish(objectFish);
        AddReward(1.0f);
    }
コード例 #4
0
    private void EatFish(GameObject fishObject)
    {
        if (isFull)
        {
            return;                 // can't eat another fish while full
        }
        isFull = true;

        penguinArea.RemoveSpecificFish(fishObject);

        // reward for eaing fish
        AddReward(1f);
    }
コード例 #5
0
    /// <summary>
    /// Check if agent is full, if not, eat the fish and get a reward
    /// </summary>
    /// <param name="fishObject">The fish to eat</param>
    public void EatFish(GameObject fishObject)
    {
        if (isFull)
        {
            return;         // Can't eat another fish while full
        }
        isFull = true;

        penguinArea.RemoveSpecificFish(fishObject);

        if (isAgent)
        {
            this.GetComponent <PenguinAgent>().AddReward(1f);
        }
    }