コード例 #1
0
    public void Teleport(string plane, Vector3 pos, Vector3?rotation)
    {
        Vector3 rot = rotation ?? transform.eulerAngles;

        pos.y    = 0;
        navPlane = NavigationPlane.FindPlane(plane);
        NavigationPlane.ValidMove(ref pos, ref navPlane);
        transform.position    = pos;
        transform.eulerAngles = rot;
        targetRotation        = transform.rotation;
    }
コード例 #2
0
    // Utilities:

    public static void ApplyUpgrades()
    {
        NavigationPlane store = NavigationPlane.FindPlane("Store_Main");

        if (State.currentGameUpgrade > 6)
        {
            StoreReferances.instance.belt.moveSpeed = new Vector3(2.0f, 0, 0);
            StoreReferances.instance.belt.spawnMin  = 0.75f;
            StoreReferances.instance.belt.spawnMax  = 0.75f;
        }
        else if (State.currentGameUpgrade > 1)
        {
            StoreReferances.instance.belt.moveSpeed = new Vector3(1.0f, 0, 0);
            StoreReferances.instance.belt.spawnMin  = 1.0f;
            StoreReferances.instance.belt.spawnMax  = 3.0f;
        }
        else
        {
            StoreReferances.instance.belt.moveSpeed = new Vector3(0.5f, 0, 0);
            StoreReferances.instance.belt.spawnMin  = 3.0f;
            StoreReferances.instance.belt.spawnMax  = 5.0f;
        }

        StoreReferances.instance.table1.SetActive(State.currentGameUpgrade > 2);
        store.exceptions[1].navigable = !(State.currentGameUpgrade > 2);

        StoreReferances.instance.table2.SetActive(State.currentGameUpgrade > 7);
        store.exceptions[2].navigable = !(State.currentGameUpgrade > 7);

        InteractionCheckout.instances[1].gameObject.SetActive(State.currentGameUpgrade > 4);
        store.exceptions[7].navigable = !(State.currentGameUpgrade > 4);
        store.exceptions[8].navigable = !(State.currentGameUpgrade > 4);
        store.exceptions[9].navigable = !(State.currentGameUpgrade > 4);

        InteractionCheckout.instances[2].gameObject.SetActive(State.currentGameUpgrade > 9);
        store.exceptions[10].navigable = !(State.currentGameUpgrade > 9);
        store.exceptions[11].navigable = !(State.currentGameUpgrade > 9);
        store.exceptions[12].navigable = !(State.currentGameUpgrade > 9);

        if (!StoreReferances.instance.storeTimerOn)
        {
            StoreReferances.instance.storeTimerLeft = (State.currentGameUpgrade > 5) ? 300 : 150;
        }
    }
コード例 #3
0
 void Start()
 {
     cam      = Camera.main.transform;
     navPlane = NavigationPlane.FindPlane(startingPlane);
 }