コード例 #1
0
    protected override void OnCollisionEnter(Collision collision)
    {
        if (!isPlayer && collision.collider.tag == PongBall.TAG)
        {
            PlayerVs_GameManager.GetInstance().AddNARSBlock(GetSensorimotor().GetNARSHost().type.ToString());

            if (GetSensorimotor() != null)
            {
                GetSensorimotor().Praise();
            }
        }
    }
コード例 #2
0
ファイル: PlayerVs_Goal.cs プロジェクト: yuanbei/NARS-Pong
 private void OnTriggerEnter(Collider other)
 {
     //scored a goal
     if (other.tag == PongBall.TAG)
     {
         if (isNARS)                                                                //score on NARS
         {
             PlayerVs_GameManager.GetInstance().AddPlayerPoint();                   //player gets a point
         }
         else if (isPlayer)                                                         //score on Player
         {
             PlayerVs_GameManager.GetInstance().AddNARSPoint(host.type.ToString()); //NARS gets a point
         }
         other.GetComponent <PongBall>().ResetPosition();
     }
 }
コード例 #3
0
 private void Start()
 {
     _instance = this;
 }