コード例 #1
0
ファイル: VisionSystem.cs プロジェクト: Lywona/IP2_Game
    void CheckIfAtRecyclingPlant()
    {
        Debug.DrawLine(new Vector2(this.transform.position.x, this.transform.position.y), new Vector2(this.transform.position.x - 0.3f, this.transform.position.y));
        atRecyclingPlant = Physics2D.Linecast(new Vector2(this.transform.position.x, this.transform.position.y), new Vector2(this.transform.position.x - 0.3f, this.transform.position.y), 1 << LayerMask.NameToLayer("RecyclingPlant"));

        if (Input.GetKey(KeyCode.Space) && atRecyclingPlant)
        {
            PlayerMovement.ResetSpeed();
            PlayerScore.ChangeSafeScore();
        }
    }