コード例 #1
0
    public bool Release()
    {
        Thruster closestThruster = FindClosestThruster();

        Debug.Log("Trying to load " + closestThruster);
        if (closestThruster != null && closestThruster.FuelInRange && !closestThruster.IsLoaded)
        {
            Debug.Log("Loading " + closestThruster);
            closestThruster.Load();
            GameManager.instance.DestroyObject(this.GetComponent <ObjectController>());
            GlobalSoundManager.instance.PlayClip(GlobalSounds.PlaceFuelTank, SourcePosition.Center, 1);

            foreach (Thruster t in _thrusters)
            {
                t.FuelHighlightEnabled = false;
            }
            return(true);
        }
        else
        {
            if (!closestThruster.IsLoaded)
            {
                Debug.Log("Thruster too far away!");
            }
            else
            {
                Debug.Log("Thruster already loaded!");
            }
        }
        return(false);
    }