private void UpdateMouseClick()
 {
     if (Input.GetMouseButtonDown(0))
     {
         ECSBindings.SpawnTower(m_HighlightedTile.transform.position.x, m_HighlightedTile.transform.position.z);
     }
 }
Beispiel #2
0
    void Update()
    {
        Vector3 pos = ECSBindings.GetPosition(m_View.EntityRef).value;

        pos.y = 0.5f;

        transform.position = GUI.Instance.MainCamera.WorldToScreenPoint(pos);

        var health = ECSBindings.GetHealth(m_View.EntityRef);

        if (health.max > 0)
        {
            m_Foreground.fillAmount = health.current / health.max;
        }
    }
    void Update()
    {
        Vector3 pos = ECSBindings.GetPosition(m_View.EntityRef).value;

        pos.y = 0.5f;

        transform.position = GUI.Instance.MainCamera.WorldToScreenPoint(pos);

        var cooldown = ECSBindings.GetCooldown(m_View.EntityRef);

        if (cooldown.remaining <= 0)
        {
            Destroy(gameObject);
            return;
        }

        m_Foreground.fillAmount = cooldown.remaining / cooldown.max;
    }
    void Update()
    {
        if (m_ViewPosition)
        {
            Vector3 pos = ECSBindings.GetPosition(m_View.EntityRef).value;
            transform.position = new Vector3(pos.x, pos.y, pos.z);
        }

        if (m_ViewOrientation)
        {
            Vector3 orientation = ECSBindings.GetOrientation(m_View.EntityRef).value;
            transform.forward = new Vector3(orientation.x, orientation.y, orientation.z);
        }

        if (m_UpdateOnce)
        {
            enabled = false;
        }
    }
Beispiel #5
0
    private void Update()
    {
        float elapsed = ECSBindings.GetStateElapsedTime().value;

        m_Time.fillAmount = elapsed / m_ExpectedMaxTime;
    }