当前位置: 首页>>代码示例>>C#>>正文


C# Fighter类代码示例

本文整理汇总了C#中Fighter的典型用法代码示例。如果您正苦于以下问题:C# Fighter类的具体用法?C# Fighter怎么用?C# Fighter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Fighter类属于命名空间,在下文中一共展示了Fighter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnEndTurn

 public override void OnEndTurn(Fighter fighter)
 {
     if (fighter.CurrentMP > 0)
     {
         this.ChallengeFailed(fighter);
     }
 }
开发者ID:nightwolf93,项目名称:Crystal,代码行数:7,代码来源:NomadeChallenge.cs

示例2: sorcererStart

	protected void sorcererStart(){
		//important that this happens first, other initializations depend on it
		fighter = (Fighter) GameObject.FindObjectOfType (typeof (Fighter));
		//logically the sorcerer shouldn't be an enabled player unless it's the client in a game
		playerEnabled = false;
		if (Network.isClient) {
			playerEnabled = true;
			fighter.playerEnabled = false;
		}
		
		//inititalize skills before Player start
		activeSkill1 = null;
		activeSkill2 = null;
		activeSkill3 = null;
		activeSkill4 = null;
		activeSkill5 = null;
		activeSkill6 = null;
		
		playerStart ();
		initializePlayer();
		initializeLevel();
		initializePrimaryStats();
		initializeSecondaryStatsBase();
		initializeSecondaryStats();
		calculateSecondaryStats();
		health = maxHealth;
		fighter.energy = fighter.maxEnergy;
		
		target = null;
		startPosition = transform.position;
	
		//networking:
		sorcererNetworkScript = (SorcererNetworkScript)gameObject.GetComponent<SorcererNetworkScript> ();
		//database.readPrimaryStats();
	}
开发者ID:marouen-lamiri,项目名称:Second-Soul,代码行数:35,代码来源:Sorcerer.cs

示例3: Start

	// Use this for initialization
	void Start () {

		subscribeToSorcererInstancePublisher (); // jump into game

		fighter = (Fighter) GameObject.FindObjectOfType (typeof (Fighter));
		sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); // sorcerer = (Sorcerer) GameObject.FindObjectOfType (typeof (Sorcerer));
	}
开发者ID:marouen-lamiri,项目名称:Second-Soul,代码行数:8,代码来源:PlayerIcon.cs

示例4: Start

	// Use this for initialization
	void Start () {
		player = (Fighter) GameObject.FindObjectOfType (typeof (Fighter));
		healthFrameWidth = (float)Screen.width*healthFrameWidthFix;
		healthFrameHeight = (float)Screen.height*healthFrameHeightFix;
		healthFillWidth = (float)Screen.width*healthFillWidthFix;
		healthFillHeight =(float)Screen.height*healthFillHeightFix;
	}
开发者ID:marouen-lamiri,项目名称:Second-Soul,代码行数:8,代码来源:HealthBar.cs

示例5: SetUp

        public override void SetUp()
        {
            Params.Load("default.properties");
            List<Entity> children = XNAGame.Instance.Children;

            Ground ground = new Ground();
            children.Add(ground);
            XNAGame.Instance.Ground = ground;

            Fighter fighter = new Fighter();
            fighter.ModelName = "cobramk1";
            fighter.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.arrive);
            fighter.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.obstacle_avoidance);
            fighter.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.wall_avoidance);
            fighter.Position = new Vector3(2, 20, -50);
            fighter.TargetPos = fighter.Position * 2;
            XNAGame.Instance.Leader = fighter;
            children.Add(fighter);

            Fighter fighter1 = new Fighter();
            fighter1.ModelName = "viper";
            fighter1.Target = fighter;
            fighter1.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.pursuit);
            fighter1.Position = new Vector3(-20, 20, -20);
            children.Add(fighter1);
            foreach (Entity child in children)
            {
                child.LoadContent();
            }
        }
开发者ID:skooter500,项目名称:XNA-3D-Steering-Behaviours-for-Space-Ships,代码行数:30,代码来源:PursuitScenario.cs

示例6: AttackDetect

    public void AttackDetect(Fighter plr)
    {
        //projectile checks
        SPoint[] pHdr = new SPoint[8];
        SPoint[] plBox;
        plBox = plr.GetHitBox();
        int hbLen=4;
        float[] plAng ={0, Mathf.PI/2, Mathf.PI, -Mathf.PI/2};
        bool hitflag = true;
                for (int i=0; i<8; i++)
                        pHdr [i] = new SPoint (v [i].x + pos.x, v [i].y +pos.y);
        float atkLen = GetVNum ();
                for (int j = 0; j < atkLen; j++)
                        if (!CheckAxis (pHdr [0], ang [j], plBox, pHdr, hbLen, GetVNum ())) //no axis intersection
                                hitflag = false;

                if (hitflag)//test on the axis of the player hit box to confirm
                        for (int j = 0; j < 4; j++)
                                if (!CheckAxis (plBox [j], plAng [j], plBox, pHdr, hbLen,GetVNum ())) //no axis intersection
                                        hitflag = false;
                if (hitflag) {
                        active = false;
                        plr.GetHit (hitdata);
                        Detonate ();
                }
    }
开发者ID:cWalters2,项目名称:ShSoul,代码行数:26,代码来源:projectile.cs

示例7: OnGotHit

 void OnGotHit(Fighter attacker)
 {
     Alive attackersAlive = attacker.GetComponent<Alive>();
     if (!charController.CommandIssued && !attackersAlive.IsDead) {
         charController.Command_Attack( attackersAlive );
     }
 }
开发者ID:fanfreeman,项目名称:LinkBattle,代码行数:7,代码来源:Hero.cs

示例8: Fire

    public virtual bool Fire(Fighter plr, SPoint o, SPoint v)
    {
        plNum = plr.plNum;
        vel = new SPoint (velx*v.x, vely);
        float diff;
        if (!plr.fHelper.IsFacingRight()) {
            diff = ((Mathf.PI / 2) - dir) * 2.0f;
            dir += diff;
        }
        //dir 2.0fis the vector to travel in per second
        //if(active)
        //	return false;
        active=true;
        pos=new SPoint(o.x,o.y+16);
        transform.position = new Vector3 (pos.x, pos.y, 0);

        ttl.SetTimer(2);
        for (int i=0; i<ps.Length; i++) {
            if (ps != null) {
                ps[i].transform.position = new Vector3 (pos.x, pos.y, 0);
                ps[i].enableEmission = true;
                ps[i].Play ();

            }
        }
        return true;
    }
开发者ID:cWalters2,项目名称:ShSoul,代码行数:27,代码来源:plKirochFBall.cs

示例9: OnMove

 public override void OnMove(Fighter fighter, int value)
 {
     if (value > 1)
     {
         this.ChallengeFailed(fighter);
     }
 }
开发者ID:nightwolf93,项目名称:Crystal,代码行数:7,代码来源:ZombieChallenge.cs

示例10: DoSpawn

    private IEnumerator DoSpawn(float delay, Action callback, Transform targetTransform)
    {
        yield return new WaitForSeconds(delay);

        if (!_hasSpawned)
        {
            _fighterInst = Instantiate<Fighter>(FighterPrefab);
            _fighterInst.SpawnVehicle(_fighterInst.gameObject, _fighterInst.VehiclePrefab, Universe.Current.GetUniversePosition(transform.position), transform.rotation);
            if (targetTransform != null)
                _fighterInst.SetTarget(targetTransform);
            if (AddWarpEffect)
            {
                _warpEffect = _fighterInst.VehicleInstance.gameObject.AddComponent<WarpEffect>();
                _warpEffect.transform.position = transform.position;
                _warpEffect.transform.forward = transform.forward;

                _warpEffect.WarpEffectPrefab = SpawnEffect;
                _warpEffect.Timeout = 0.4f;
                _warpEffect.Distance = 20f;
            }
            _hasSpawned = true;
            if (callback != null)
                callback();
            if (OnSpawn != null)
                OnSpawn(_fighterInst.gameObject);
        }
    }
开发者ID:talford2,项目名称:SpaceX,代码行数:27,代码来源:Spawner.cs

示例11: Add

	public static Player Add(Fighter player) {
		if (Players == null) {
			Players = new Fighter[4];
			isFull = false;
			numPlayers = 0;
		}
		for (int i = 0; i < Players.Length; i++) {
			if (Players [i] == null) {
				Players [i] = player;
				numPlayers++;
				UpdateContainer ();
				switch (i) {
				case 0:
					Player1 = player;
					return Player.Player1;
				case 1:
					Player2 = player;
					return Player.Player2;
				case 2:
					Player3 = player;
					return Player.Player3;
				case 3:
					Player4 = player;
					return Player.Player4;
				default:
					Player1 = player;
					return Player.Player1;
				}
			}
		}
		return Player.Null;
	}
开发者ID:andrewpk95,项目名称:CS492Week4-5,代码行数:32,代码来源:PlayerContainer.cs

示例12: Execute

 public override void Execute(Fighter fighterRef, PlayerCombatScript combatScript)
 {
     fighterRef.GetComponent<Animator>().SetTrigger(_jumpHash);
        Vector2 v = gameObject.GetComponent<Rigidbody2D>().velocity;
        v.y = _jumpSpeed;
        fighterRef.gameObject.GetComponent<Rigidbody2D>().velocity = v;
 }
开发者ID:chozoace,项目名称:ProjectAnubis,代码行数:7,代码来源:Jump.cs

示例13: SetUp

        public override void SetUp()
        {
            Params.Load("default.properties");
            List<Entity> children = XNAGame.Instance.Children;
            Fighter leader = new Fighter();
            leader.Position = new Vector3(10, 120, 20);
            leader.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.wander);
            leader.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.obstacle_avoidance);
            leader.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.wall_avoidance);
            children.Add(leader);

            Fighter camFighter = new Fighter();
            camFighter.Leader = leader;
            camFighter.Position = new Vector3(10, 120, 0);
            camFighter.offset = new Vector3(0, 5, 10);
            camFighter.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.offset_pursuit);
            camFighter.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.wall_avoidance);
            camFighter.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.obstacle_avoidance);
            XNAGame.Instance.CamFighter = camFighter;
            children.Add(camFighter);

            Ground ground = new Ground();
            children.Add(ground);
            XNAGame.Instance.Ground = ground;

            XNAGame.Instance.Camera.Position = new Vector3(10, 120, 50);
            foreach (Entity child in children)
            {
                child.LoadContent();
            }
        }
开发者ID:skooter500,项目名称:XNA-3D-Steering-Behaviours-for-Space-Ships,代码行数:31,代码来源:WanderScenario.cs

示例14: BeginAttack

 public virtual void BeginAttack(Damage damageToDeal, Fighter attacker)
 {
     weaponUser = attacker;
     attackCast.OnHit += OnWeaponHit;
     damageOut = damageToDeal;
     attackCast.Begin ();
 }
开发者ID:redbluegames,项目名称:ness,代码行数:7,代码来源:Weapon.cs

示例15: FixedUpdate

	// Update is called once per frame
	void FixedUpdate() {
		if(mainCamera == null || fighter == null || sorcerer == null){
			mainCamera = GameObject.FindGameObjectWithTag("MainCamera") as GameObject;;
			fighter = GameObject.FindObjectOfType(typeof(Fighter))as Fighter;
			sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); // sorcerer= GameObject.FindObjectOfType (typeof (Sorcerer))as Sorcerer;
		}
		else{
			Player player = (fighter.playerEnabled)? (Player) fighter : sorcerer;
			float distance = Vector3.Distance(mainCamera.transform.position,player.transform.position);
			RaycastHit[] hits = Physics.RaycastAll (mainCamera.transform.position, player.transform.position, distance,checkLayers);
			foreach (GameObject gO in invisibleList){
				gO.layer = LayerMask.NameToLayer(visibleLayerName);
			}
			invisibleList = new List<GameObject>();
			foreach(RaycastHit hit in hits){
				if(Vector3.Distance (mainCamera.transform.position,hit.collider.gameObject.transform.position)<distance){
					hit.collider.gameObject.layer = LayerMask.NameToLayer(invisibleLayerName);
					invisibleList.Add(hit.collider.gameObject);
				}
			}
//			foreach(GameObject gO in gameObjects){
//				if (gO == this.gameObject){
//					this.gameObject.layer = invisibleLayer.value;
//				}
//				else{
//					this.gameObject.layer = visibleLayer.value;
//					}
//			}
		}
		
	}
开发者ID:marouen-lamiri,项目名称:Second-Soul,代码行数:32,代码来源:OnHoverTransparent.cs


注:本文中的Fighter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。