Ejemplo n.º 1
0
    public void GetRigidbody(Collider col)
    {
        PlayerContoller player = col.GetComponent <PlayerContoller>();

        if (player)
        {
            Rigidbody rb = player.GetComponent <Rigidbody>();
            CheckDirection(rb);
        }
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Awake()
    {
        m_Player = FindObjectOfType <PlayerContoller>();


        if (m_Player != null)
        {
            m_PlayerCamera = FindObjectOfType <CameraFollow>();
            LoadLevel();
            m_vPlayerInitialPos = m_Player.transform.position;
            m_abiPulse          = m_Player.GetComponent <LightPulse>();
        }
    }
Ejemplo n.º 3
0
 // Use this for initialization
 void Awake()
 {
     if (m_fRotationSpeed < 5)
     {
         m_fRotationSpeed = 5f;
     }
     SoundManager.Instance.SetState(MusicState.Idle);
     SoundManager.Instance.PlayEvent(SoundEvents.Play_Music, this.gameObject);
     SoundManager.Instance.PlayEvent(SoundEvents.Play_Wind, this.gameObject);
     SoundManager.Instance.PlayEvent(SoundEvents.Play_BG, this.gameObject);
     GetAxisSetting();
     m_pcTarget         = FindObjectOfType <PlayerContoller>();
     m_rbPlayer         = m_pcTarget.GetComponent <Rigidbody>();
     m_tCameraContainer = transform.Find("CamContainer");
     transform.position = m_pcTarget.transform.position;
     m_Sequence         = DOTween.Sequence();
     m_cMainCamera      = GetComponentInChildren <Camera>();
 }
Ejemplo n.º 4
0
    // Use this for initialization
    void Awake()
    {
        transform.eulerAngles = Vector3.zero;
        if (!m_bIsTransparent)
        {
            _Activated = true;
        }
        m_Shader = Shader.Find("Custom/Waving");
        if (m_Shader == null)
        {
            throw new System.Exception("You forgot the shader.");
        }

        m_mat = new Material(m_Shader);

        m_player = GameManager.Instance.m_Player;
        if (m_player)
        {
            m_pulse = m_player.GetComponent <LightPulse>();
        }



        SetBounds();
        m_Points = CalculatePoints();

        m_ShowPoints = new GrassPoints[m_Points.Length];

        m_ShowPoints = (GrassPoints[])m_Points.Clone();

        for (int i = 0; i < m_ShowPoints.Length; i++)
        {
            m_ShowPoints[i].opacity = 1;
        }



        m_OutputBuffer = new ComputeBuffer(m_Points.Length, 24);
        m_OutputBuffer.SetData(m_Points);
        if (m_bIsTransparent && m_player != null)
        {
            StartCoroutine(ShowGrass());
        }
    }
Ejemplo n.º 5
0
    public void Update()
    {
#if UNITY_EDITOR
        //Bug Report
        if (Input.GetKeyDown(KeyCode.B))
        {
            Application.OpenURL("https://goo.gl/forms/GgYxsACr0adXpzGc2");
        }
#endif
        if (m_Player == null)
        {
            m_Player = FindObjectOfType <PlayerContoller>();
            if (m_Player != null)
            {
                m_vPlayerInitialPos = m_Player.transform.position;
                m_abiPulse          = m_Player.GetComponent <LightPulse>();
            }
        }
    }