コード例 #1
0
 void FixedUpdate()
 {
     if (Platform != null)
     {
         transform.position += (-Platform.TranslateVector);
     }
     if (!Player.Grounded)
     {
         Platform = null;
     }
 }
コード例 #2
0
    public void OnTriggerStay(Collider col)
    {
        //Hazard
        if (col.tag == "Hazard")
        {
            DamagePlayer();
        }

        if (col.gameObject.tag == "MovingPlatform")
        {
            Platform = col.gameObject.GetComponent <MovingPlatformControl>();
        }
        else
        {
            Platform = null;
        }
    }