Exemplo n.º 1
0
    // Display an arrow at the start of the path
    public void DisplayVisualHint(Transform start)
    {
        DirectionalPath path      = GetDirectionStartingFrom(start);
        Vector3         direction = path.GetDirectionVector();
        Quaternion      rotation  = hintInstance.transform.rotation;

        rotation.SetLookRotation(direction);

        hintInstance.transform.rotation = rotation;
        hintInstance.transform.position = path.shipStart;
        hintInstance.SetActive(true);
    }
Exemplo n.º 2
0
    public void LaunchShipOnPath(PathScript path, Transform from, AbstractPlanet targetPlanet)
    {
        this.targetPlanet = targetPlanet;
        ManagerScript.Instance.audioManager.PlaySound("shipMove");
        switch (shipOwnership)
        {
        case AbstractPlanet.Ownership.Player:
            dockedPlanet.ships[Indices.SHIP_PLAYER] = null;
            break;

        case AbstractPlanet.Ownership.Enemy:
            dockedPlanet.ships[Indices.SHIP_ENEMY] = null;
            break;

        case AbstractPlanet.Ownership.Neutral:
            break;
        }
        isShipMoving    = true;
        this.travelPath = path.GetDirectionStartingFrom(from);

        this.transform.position   = travelPath.shipStart;
        this.transform.rotation   = Quaternion.LookRotation(travelPath.shipEnd - travelPath.shipStart);
        this.transform.localScale = Vector3.zero;
    }