Пример #1
0
    public void StartUnitMovement(Action unitMovementComplete, Action unitMovementCancelled)
    {
        if (m_unitMovementGuide == null)
        {
            m_unitMovementGuide = UnitManager.UnitMovementGuide;
        }

        m_unitMovementComplete  = unitMovementComplete;
        m_unitMovementCancelled = unitMovementCancelled;

        if (!m_playerCamera)
        {
            m_playerCamera = m_unitView.PlayerView.PlayerCamera;
        }

        m_originalPosition = transform.position;

        gameObject.layer = LayerMask.NameToLayer("Ignore Raycast");

        m_unitMovementGuide.EnableMovementGuide();
        m_unitCollider.enabled = false;
        Cursor.visible         = false;
        this.enabled           = true;

        GameManager.Instance.UnitManager.UnitStartedMoving();
    }
Пример #2
0
    private void Start()
    {
        GameObject movementGuide = Instantiate(m_unitMovementGuidePrefab);

        m_unitMovementGuide = movementGuide.GetComponent <UnitMovementGuide>();

        GameObject shootingGuide = Instantiate(m_unitShootingGuidePrefab);

        m_unitShootingGuide = shootingGuide.GetComponent <UnitShootingGuide>();
    }