Exemple #1
0
    void Start()
    {
        if (_itemsInInventory == null)
        {
            _itemsInInventory = new List <string>();
        }

        _itemsInInventory.Add(GameManager_References.legsTag);

        _batteryObject = GameObject.FindWithTag("BatteryText");
        _fuelObject    = GameObject.FindWithTag("FuelText");

        _batteryText = _batteryObject.GetComponent <Text>();
        _fuelText    = _fuelObject.GetComponent <Text>();

        _batteryText = _batteryObject.GetComponent <Text>();
        _fuelText    = _fuelObject.GetComponent <Text>();

        _batteryTextMenu = _batteryObjectMenu.GetComponent <Text>();
        _fuelTextMenu    = _fuelObjectMenu.GetComponent <Text>();

        Debug.Assert(laserGunOnPlayer != null);
        laserGunOnPlayer.SetActive(false);

        _laserGunObject = GameObject.Find("LaserGunImage");
        _wheelObject    = GameObject.Find("WheelImage");
        _springsObject  = GameObject.Find("SpringsImage");

        _laserGunSprite = _laserGunObject.GetComponent <Image>();
        _wheelSprite    = _wheelObject.GetComponent <Image>();
        _springsSprite  = _springsObject.GetComponent <Image>();

        _laserGunSpriteMenu = _laserGunObjectMenu.GetComponent <Image>();
        _wheelSpriteMenu    = _wheelObjectMenu.GetComponent <Image>();
        _springsSpriteMenu  = _springsObjectMenu.GetComponent <Image>();

        _laserGunSprite.color = new Color(0f, 0f, 0f);
        _wheelSprite.color    = new Color(0f, 0f, 0f);
        _springsSprite.color  = new Color(0f, 0f, 0f);

        _laserGunSpriteMenu.color = new Color(0f, 0f, 0f);
        _wheelSpriteMenu.color    = new Color(0f, 0f, 0f);
        _springsSpriteMenu.color  = new Color(0f, 0f, 0f);

        LoadInventory();

        _soundManager = Game_Manager.Instance.GetSoundManager();

        Debug.Assert(_soundManager != null);
        Debug.Assert(_laserGunObject != null);
        Debug.Assert(_wheelObject != null);
        Debug.Assert(_springsObject != null);
    }
Exemple #2
0
    public static void Init()
    {
        _soundManager = Game_Manager.Instance.GetSoundManager();

        footStepSound    = _soundManager.GetAudioClip(footStepSoundName);
        runSound         = _soundManager.GetAudioClip(runSoundName);
        jumpSound        = _soundManager.GetAudioClip(jumpSoundName);
        landSound        = _soundManager.GetAudioClip(landSoundName);
        wheelSound       = _soundManager.GetAudioClip(wheelSoundName);
        transitionSound  = _soundManager.GetAudioClip(transitionSoundName);
        collectUsable    = _soundManager.GetAudioClip(collectUsableSoundName);
        collectItem      = _soundManager.GetAudioClip(collectItemSoundName);
        collectStoryItem = _soundManager.GetAudioClip(collectStoryItemSoundName);
        useItemSound     = _soundManager.GetAudioClip(useItemSoundName);
    }
Exemple #3
0
    private void Awake()
    {
        if (_instance != null)
        {
            Destroy(_instance);
            _instance = this;
        }
        else
        {
            _instance = this;
            DontDestroyOnLoad(this);
        }

        Debug.Assert(_soundManager == null);

        _soundManager = new Game_SoundManager();
    }
Exemple #4
0
    // Use this for initialization
    void Start()
    {
        _movementType = MovementType.MOVE_WALK;

        animator = GetComponentInChildren <Animator>();

        _controller   = GetComponent <CharacterController>();
        _soundManager = Game_Manager.Instance.GetSoundManager();
        Player_SoundHolder.audioSource = GetComponent <AudioSource>();

        Debug.Assert(animator != null);
        Debug.Assert(_soundManager != null);
        Debug.Assert(_controller != null);

        Physics.gravity = new Vector3(0, -1.0f, 0);

        isChangeingWalkMode = false;

        _nextStepCycle = _stepCycle / 2.0f;
    }
 void Awake()
 {
     instance = this;
 }