private void ShipInBase(Collider2D other)
    {
        if (_lightSwitchingAudio != null)
        {
            _lightSwitchingAudio.Play();
        }
        Destroy(_trailLight);
        Cursor.visible = false;

        if (_enterLight != null)
        {
            _enterLight.color = _enterLightColor;
        }

        _shipInBase = true;

        ShipInBase shipInBaseScript = other.GetComponent <ShipInBase>();

        if (transform.parent.parent != null)
        {
            shipInBaseScript.InBase(true, _moveShipToPosition.position, _moveShipRoationZ + transform.parent.parent.rotation.eulerAngles.z, true);
        }
        else
        {
            shipInBaseScript.InBase(true, _moveShipToPosition.position, _moveShipRoationZ, true);
        }

        PlayerGUIScript playerUI = GameManager.CameraObject.GetComponentInChildren <PlayerGUIScript>();

        playerUI.gameObject.SetActive(false);

        // Play sound here, or perhaps in the function EndLevel()

        StartCoroutine(DockingAnimation());
    }
Beispiel #2
0
    private void Awake()
    {
        RectTransform = GetComponent <RectTransform>();

        if (_arrayID == 0 && BASE_POSITION.x == 0)
        {
            BASE_POSITION = RectTransform.anchoredPosition;
        }
        Parent = GetComponentInParent <PlayerGUIScript>();
        Parent.FlareAmmountChange += OnFlareAmmountChange;
    }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        playerGUI = gameObject.GetComponent <PlayerGUIScript>();
        view      = gameObject.GetComponent <NetworkView>();

        //mats = new Dictionary<string, Material>();
        //mats.Add("normal", Resources.Load("Materials/Blue") as Material);
        //mats.Add("stealth", Resources.Load("Materials/trail_stealth_mat") as Material);

        trail     = gameObject.GetComponentInChildren <LineRenderer>();
        positions = new Vector3[maxPoints];
        trailArr  = new GameObject[maxPoints];
    }
 private void Awake()
 {
     _lineRenderer = GetComponent <LineRenderer>();
     //_soundIndicatorCapture = GetComponentInChildren<Camera>();
     _playerGUIScript = FindObjectOfType <PlayerGUIScript>();
     _playerGUIScript.NoiseAmmountChange += OnNoiseChange;
     _pauseMenuScript             = FindObjectOfType <PauseMenuScript>();
     _pauseMenuScript.PauseState += OnPause;
     _lineRenderer.positionCount  = _numberOfLineSegments;
     _oldLineCount = _numberOfLineSegments;
     _lineWidth    = _lineRenderer.widthMultiplier;
     _lineRenderer.widthMultiplier = 0;
     GenerateLineData();
     _lineUpdate = LineRender();
     //_colourUpdateFraction = Mathf.InverseLerp(0, MAX_GRADIENT_INDEX, 1);
 }
    public Material StealthColor;    // = Resources.Load("Materials/trail_stealth_mat") as Material;

    // Use this for initialization
    void Start()
    {
        StealthColor = Resources.Load("Materials/trail_stealth_mat") as Material;
        view         = gameObject.GetComponent <NetworkView>();
        playerGUI    = gameObject.GetComponent <PlayerGUIScript>();
    }