public OpenWIndowCommand(FireTeam executor, Window window)
     : base(executor)
 {
     this.window = window;
     this.executor = executor;
     executor.teammates[0].GetComponent<Soldier>().AddIPersonListener(this);
 }
Ejemplo n.º 2
0
 public IntelCommand(FireTeam executor, Vector3 nextPos, Objective intel)
     : base(executor)
 {
     this.targetPos = nextPos;
     this.intel = intel;
     this.executor = executor;
     executor.teammates[0].GetComponent<Soldier>().AddIPersonListener(this);
 }
 public BreachWindowCommand(FireTeam executor, Vector3 nextPos, Window window)
     : base(executor)
 {
     this.targetPos = nextPos;
     this.window = window;
     this.executor = executor;
     executor.teammates[0].GetComponent<Soldier>().AddIPersonListener(this);
 }
 public ClaymoreCommand(FireTeam executor)
     : base(executor)
 {
 }
Ejemplo n.º 5
0
 public MoveCommand(FireTeam executor, Vector3 nextPos)
     : base(executor)
 {
     this.targetPos = nextPos;
     executor.teammates[0].GetComponent<Teammate>().AddIPersonListener(this);
 }
    // Update is called once per frame
    void Update()
    {
        if(Input.GetMouseButtonDown(1)){
            rigthClickPos = new Vector2(Input.mousePosition.x, Screen.height-Input.mousePosition.y);

            Ray ray = Camera.mainCamera.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;

            if(Physics.Raycast(ray, out hit) && ((hit.transform.tag == "Floor") || (hit.transform.tag == "ClosedDoor") || (hit.transform.tag == "OpenDoor") || (hit.transform.tag == "Hostage") || (hit.transform.tag == "ClosedWindow") || (hit.transform.tag == "OpenWindow"))){
                leftClicked = hit;
                SetAvailableCommands(hit.transform.tag);
                DrawMenu(rigthClickPos);
            }
        }

        if(Input.GetMouseButtonDown(0)){
            if(menuActive){
                leftClickPos = new Vector2(Input.mousePosition.x, Screen.height-Input.mousePosition.y);
                if(leftClickPos.x < menuLeft || leftClickPos.x > menuRigth || leftClickPos.y<menuTop || leftClickPos.y > menuBottom){
                    menuActive=false;
                }
            }else{
                Ray ray = Camera.mainCamera.ScreenPointToRay(Input.mousePosition);
                RaycastHit hit;

                if(Physics.Raycast(ray, out hit)){
                    //Debug.Log(hit.transform.tag);
                    if(hit.transform.tag == "Floor"){
                        CallCommand(CommandEnum.Move, hit);
                    }else{
                        if(hit.transform.tag == "Fireteam"){
                            team = hit.transform.parent.GetComponent<FireTeam>();
                            //Debug.Log(team);
                        }else{
                            CallCommand(CommandEnum.Move, hit);
                        }
                    }
                }
            }
        }
    }
 // Use this for initialization
 void Start()
 {
     team = GetComponent<FireTeam>();
 }
 public FragGrenadeCommand(FireTeam executor)
     : base(executor)
 {
 }
Ejemplo n.º 9
0
 public DoorCommand(FireTeam executor, GameObject doorGO)
     : base(executor)
 {
     this.door = doorGO;
 }
Ejemplo n.º 10
0
 public C4Command(FireTeam executor)
     : base(executor)
 {
 }
Ejemplo n.º 11
0
 public MineCommand(FireTeam executor)
     : base(executor)
 {
 }
Ejemplo n.º 12
0
 public Command(FireTeam fireTeam)
 {
     this.fireTeam = fireTeam;
     commandListeners = new List<ICommand>();
 }
Ejemplo n.º 13
0
 public void SetFireTeam(FireTeam ft)
 {
     fireTeam = ft;
 }