예제 #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
 // Update is called once per frame
 void Update()
 {
     foreach (Monster mon in monsters)
     {
         close = PlayerCloseEnough(mon);
         if (close)
         {
             //Debug.Log("ADDING INTERCEPT ");
             Intercept intercept = new Intercept(mon, Player.inst);
             UnitAI    uai       = mon.GetComponent <UnitAI>();
             uai.AddCommand(intercept);
             //Debug.Log(mon.velocity);
         }
         //Debug.Log("Player close false ");
     }
 }
예제 #4
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);
        }
    }