Beispiel #1
0
    void GenerateUnit(UnitT type)
    {
        GameObject created = GameObject.Instantiate(units[type], (Info.GetWaypoint("recruit", faction) + new Vector3(0, 0.75f, 0)), Quaternion.identity) as GameObject;       // TODO Cambiarlo por un waypoint
        AgentUnit  newUnit = created.GetComponent <AgentUnit>();

        newUnit.transform.parent = transform.parent;
        newUnit.gameObject.name += "" + Time.frameCount;
        newUnit.Start();

        Map.unitList.Add(newUnit);
        //Debug.Log ("Generada una unidad de " + type);

        stratManager.CycleLayer12();
    }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        // Z = Defbase, X = Defhalf, C = Atkhalf, V = Atkbase
        // B = Faction B, N = Faction A
        // M = Massive Attack (A and B -> Atkbase)


        if (Input.GetKeyDown(KeyCode.Z))
        {
            strat.strategyLayer.priority = new Dictionary <StrategyT, float>()
            {
                { StrategyT.ATK_BASE, 0.0f },
                { StrategyT.ATK_HALF, 0.0f },
                { StrategyT.DEF_BASE, 1f },
                { StrategyT.DEF_HALF, 0.0f }
            };

            strat.CycleLayer12();
        }

        if (Input.GetKeyDown(KeyCode.V))
        {
            strat.strategyLayer.priority = new Dictionary <StrategyT, float>()
            {
                { StrategyT.ATK_BASE, 1f },
                { StrategyT.ATK_HALF, 0.0f },
                { StrategyT.DEF_BASE, 0.0f },
                { StrategyT.DEF_HALF, 0.0f }
            };

            strat.CycleLayer12();
        }

        if (Input.GetKeyDown(KeyCode.X))
        {
            strat.strategyLayer.priority = new Dictionary <StrategyT, float>()
            {
                { StrategyT.ATK_BASE, 0.0f },
                { StrategyT.ATK_HALF, 0.0f },
                { StrategyT.DEF_BASE, 0.0f },
                { StrategyT.DEF_HALF, 1f }
            };

            strat.CycleLayer12();
        }

        if (Input.GetKeyDown(KeyCode.C))
        {
            strat.strategyLayer.priority = new Dictionary <StrategyT, float>()
            {
                { StrategyT.ATK_BASE, 0.0f },
                { StrategyT.ATK_HALF, 1f },
                { StrategyT.DEF_BASE, 0.0f },
                { StrategyT.DEF_HALF, 0.0f }
            };

            strat.CycleLayer12();
        }

        if (Input.GetKeyDown(KeyCode.N))
        {
            strat = stratA;
        }

        if (Input.GetKeyDown(KeyCode.B))
        {
            strat = stratB;
        }

        if (Input.GetKeyDown(KeyCode.M))
        {
            stratA.strategyLayer.priority = new Dictionary <StrategyT, float>()
            {
                { StrategyT.ATK_BASE, 1f },
                { StrategyT.ATK_HALF, 0.0f },
                { StrategyT.DEF_BASE, 0.0f },
                { StrategyT.DEF_HALF, 0.0f }
            };
            stratA.block = true;
            stratA.CycleLayer12();

            stratB.strategyLayer.priority = new Dictionary <StrategyT, float>()
            {
                { StrategyT.ATK_BASE, 1f },
                { StrategyT.ATK_HALF, 0.0f },
                { StrategyT.DEF_BASE, 0.0f },
                { StrategyT.DEF_HALF, 0.0f }
            };
            stratB.block = true;
            stratB.CycleLayer12();
        }
    }