コード例 #1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.tag == "Dock")
        {
            GameHandler gh  = GameObject.FindObjectOfType <GameHandler> ();
            UIHandler   uih = GameObject.FindObjectOfType <UIHandler> ();

            gh.AddFunds(fishPrice * fish);
            uih.AddRefugeeSaved(refugees);

            gh.SubtractFunds(20);

            fish     = 0;
            refugees = 0;

            capacity = 0;

            fuel = maxFuel;

            docked = true;
        }
    }