Пример #1
0
 private void Awake()
 {
     ballLauncher       = GetComponent <BallLauncher>();
     mainCamera         = Camera.main;
     levelManager       = FindObjectOfType <LevelManager>();
     trajectoryRenderer = GetComponent <TrajectoryRenderer>();
 }
Пример #2
0
 private void Start()
 {
     archerController   = GetComponent <ArcherTopDownController>();
     currentArrow       = arrowPosition.GetComponentInChildren <Arrow>();
     gravity            = Physics.gravity.y;
     trajectoryRenderer = GetComponent <TrajectoryRenderer>();
 }
Пример #3
0
    private void Start()
    {
        rb  = GetComponent <Rigidbody2D>();
        cam = Camera.main;

        trajectoryRenderer = GameObject.FindGameObjectWithTag("TrajectoryRenderer").GetComponent <TrajectoryRenderer>();
    }
Пример #4
0
    private void Start()
    {
        trajectoryRenderer = GetComponent <TrajectoryRenderer>();

        if (currentArrow == null)
        {
            currentArrow = Instantiate(arrowPrefab, arrowSpawnPosition.position, arrowSpawnPosition.rotation, arrowSpawnPosition);
        }

        Physics.gravity = new Vector3(0, -40f, 0);
    }
    private bool m_bDisplayLandingPosition;               // Whether or not to display the landing position.

    /// <summary>
    /// Make sure that the critical value - the soccer ball and its velocity - as well as the optional values are set up correctly.
    /// </summary>
    void Start()
    {
        m_vInitialPosition = Vector3.zero;
        m_vKickVelocity    = Vector3.zero;

        m_trajectory = GetComponent <TrajectoryRenderer>();

        // Create the landing display object - if both possible and necessary
        if (m_templateObject != null && m_landingPosition == null)
        {
            m_landingPosition = new GameObject("Soccer Ball Landing Display");
            m_landingPosition.transform.position   = m_templateObject.transform.position;
            m_landingPosition.transform.localScale = m_templateObject.transform.localScale;
            m_landingPosition.AddComponent <MeshFilter>();
            m_landingPosition.GetComponent <MeshFilter>().mesh = m_templateObject.GetComponent <MeshFilter>().mesh;
            m_landingPosition.AddComponent <MeshRenderer>();
            m_landingPosition.GetComponent <MeshRenderer>().material = m_landingMaterial;
        }
    }