Пример #1
0
 void AddOrSet(UnitAI uai, Command c)
 {
     if (Input.GetKey(KeyCode.LeftShift))
     {
         uai.AddCommand(c);
     }
     else
     {
         uai.SetCommand(c);
     }
 }
Пример #2
0
    public void CreateIntercept(Entity source, Entity target, bool isAdd)
    {
        Intercept intercept = new Intercept(source, target);
        UnitAI    uai       = source.GetComponent <UnitAI>();

        if (isAdd)
        {
            uai.AddCommand(intercept);
        }
        else
        {
            uai.SetCommand(intercept);
        }
    }
Пример #3
0
    void HandleMove(Vector3 point)
    {
        Move   m   = new Move(SelectionMgr.inst.selectedEntity, hit.point);
        UnitAI uai = SelectionMgr.inst.selectedEntity.GetComponent <UnitAI>();

        //AddOrSet(uai, m);

        if (Input.GetKey(KeyCode.LeftShift))
        {
            uai.AddCommand(m);
        }
        else
        {
            uai.SetCommand(m);
        }
    }