コード例 #1
0
 public OpenWIndowCommand(FireTeam executor, Window window)
     : base(executor)
 {
     this.window = window;
     this.executor = executor;
     executor.teammates[0].GetComponent<Soldier>().AddIPersonListener(this);
 }
コード例 #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);
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 public ClaymoreCommand(FireTeam executor)
     : base(executor)
 {
 }
コード例 #5
0
 public MoveCommand(FireTeam executor, Vector3 nextPos)
     : base(executor)
 {
     this.targetPos = nextPos;
     executor.teammates[0].GetComponent<Teammate>().AddIPersonListener(this);
 }
コード例 #6
0
    // 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);
                        }
                    }
                }
            }
        }
    }
コード例 #7
0
 // Use this for initialization
 void Start()
 {
     team = GetComponent<FireTeam>();
 }
コード例 #8
0
 public FragGrenadeCommand(FireTeam executor)
     : base(executor)
 {
 }
コード例 #9
0
 public DoorCommand(FireTeam executor, GameObject doorGO)
     : base(executor)
 {
     this.door = doorGO;
 }
コード例 #10
0
 public C4Command(FireTeam executor)
     : base(executor)
 {
 }
コード例 #11
0
 public MineCommand(FireTeam executor)
     : base(executor)
 {
 }
コード例 #12
0
 public Command(FireTeam fireTeam)
 {
     this.fireTeam = fireTeam;
     commandListeners = new List<ICommand>();
 }
コード例 #13
0
 public void SetFireTeam(FireTeam ft)
 {
     fireTeam = ft;
 }