Beispiel #1
0
    void Start()
    {
        player          = GameObject.FindGameObjectWithTag("Player");
        resourceSystem  = GetComponent <ResourceSystem>();
        rigidBodyInf    = player.GetComponent <RigidBodyInfo>();
        moneyText2.text = resourceSystem.GetMoney().ToString() + "¥";
        moneyText1.text = "+0¥";
        audioManager    = FindObjectOfType <AudioManager>();

        if (inGameHub)
        {
            // Set up for when in the game hub
            overlay.sprite = spriteOverlay[0];
            boostText.gameObject.SetActive(false);
            fishText.gameObject.SetActive(false);
            timeText.gameObject.SetActive(false);
            moneyText1.gameObject.SetActive(false);
            moneyText2.gameObject.SetActive(true);
        }
        else if (!inGameHub)
        {
            currentFishAmount = missionManager.fishLeft;
            fishText.text     = currentFishAmount + "/" + missionManager.fishMax;
        }
    }
    //-----------------------------------------------------------------------------------
    private void UpdateRigidBody( Transform tr, BodyInfo bdInfo )
    {
      RigidBodyInfo rigidInfo = (RigidBodyInfo)bdInfo;

      tr.localPosition = rigidInfo.position_;
      tr.localRotation = rigidInfo.orientation_;
    }
Beispiel #3
0
    void Start()
    {
        if (player = GameObject.FindGameObjectWithTag("Player"))
        {
            Debug.Log("EnginePitch Script: Player object found");
        }

        if (player != null)
        {
            rigidBodyInf = player.GetComponent <RigidBodyInfo>();
            engineSound  = player.GetComponent <AudioSource>();
        }
        else
        {
            Debug.Log("Car GameObject not attached to EnginePitch script in SoundManager!");
        }
    }