Download Project/Assets/ML-Agents/Examples/PushBlock/Scripts/GoalDetect.cs from ashish2244/ppo-SnowballTarget: direct link, hf CLI and curl.
- Browser
- Download file 725 Bytes
-
https://huggingface.co/ashish2244/ppo-SnowballTarget/resolve/main/Project/Assets/ML-Agents/Examples/PushBlock/Scripts/GoalDetect.cs
- Command line
-
hf download hf://ashish2244/ppo-SnowballTarget/Project/Assets/ML-Agents/Examples/PushBlock/Scripts/GoalDetect.cs
-
curl -L -o GoalDetect.cs https://huggingface.co/ashish2244/ppo-SnowballTarget/resolve/main/Project/Assets/ML-Agents/Examples/PushBlock/Scripts/GoalDetect.cs
725 Bytes
| //Detect when the orange block has touched the goal. | |
| //Detect when the orange block has touched an obstacle. | |
| //Put this script onto the orange block. There's nothing you need to set in the editor. | |
| //Make sure the goal is tagged with "goal" in the editor. | |
| using UnityEngine; | |
| public class GoalDetect : MonoBehaviour | |
| { | |
| /// <summary> | |
| /// The associated agent. | |
| /// This will be set by the agent script on Initialization. | |
| /// Don't need to manually set. | |
| /// </summary> | |
| [] | |
| public PushAgentBasic agent; // | |
| void OnCollisionEnter(Collision col) | |
| { | |
| // Touched goal. | |
| if (col.gameObject.CompareTag("goal")) | |
| { | |
| agent.ScoredAGoal(); | |
| } | |
| } | |
| } | |