Represents an attack that can be performed by a player character.
コード例 #1
0
 // Use this for initialization
 void Awake()
 {
     anim = GetComponent<Animator>();
     playerMovement = GetComponent<PlayerMovement>();
     playerAttack = GetComponentInChildren<PlayerAttack>();
     currentHealth = startingHealth;
 }
コード例 #2
0
ファイル: LifeBar.cs プロジェクト: BraveKids/DreamGuardian
    // Use this for initialization
    void Start()
    {
        player = GameObject.FindGameObjectWithTag ("Player");

        playerLifeScript = player.gameObject.GetComponent ("CharacterControllerScript") as CharacterControllerScript;
        playerEnergyScript = player.gameObject.GetComponent ("PlayerAttack") as PlayerAttack;
    }
コード例 #3
0
	public override void Awake(){
		base.Awake();
		CameraControl.main.AddTarget(this.transform);

		motor = GetComponent<MoveAttacker>();
		atk = GetComponent<PlayerAttack>();
	}
コード例 #4
0
ファイル: PlayerHealth.cs プロジェクト: kkiniaes/Fire-On-Ice
	void Awake ()
	{
		onFire = false;
		announcerAudio = GetComponents<AudioSource> () [1];
		playerAttack = GetComponent<PlayerAttack> ();

		canvas = GameObject.Find ("HUDCanvas");
		//Debug.Log ("PlayerHealthUI_" + playerAttack.playerNum);

		inGameHealthUI = canvas.GetComponent<RectTransform> ().Find ("PlayerHealthUI_" + playerAttack.playerNum)
			.GetComponent<InGameHealthUI>();
		inGameHealthUI.playerHealth = this;
		rigid = GetComponent<Rigidbody> ();
		gm = GameObject.Find ("GameManager").GetComponent<GameManager> ();
		uim = GameObject.Find ("GameManager").GetComponent<UI_Manager> ();
		joystickNum = playerAttack.joystickNum;
		damageReduction = 1;
		allgrounds = GameObject.FindGameObjectsWithTag("Island");
		anim = GetComponent <Animation> ();
		playerAudio = GetComponent <AudioSource> ();
		playerMovement = GetComponent <PlayerMovement> ();

		//playerShooting = GetComponentInChildren <PlayerShooting> ();
		currentHealth = startingHealth;
		SetupHealthUI ();
	}
コード例 #5
0
ファイル: JamesCombatant.cs プロジェクト: metanymie/jga
	// Use this for initializationl
	public override void Start () {
		base.Start ();

		//set up basic stats
		MaxHitPoints = 120;
		HitPoints = 120;

		//set up the list of attacks
		PlayerAttack attack1 = new PlayerAttack();
		attack1.Name = "Gas Blast";
		attack1.Description = "Unleashes a blast of foul-smelling gas upon the target, dealing damage.";
		attack1.Power = 240;
		attack1.Accuracy = 100;
		attack1.Type = AttackType.Damage;

		PlayerAttack attack2 = new PlayerAttack();
		attack2.Name = "Can of Beans";
		attack2.Description = "A delicious can of baked beans, scientifically proven to promote good heart health.";
		attack2.Power = MaxHitPoints;
		attack2.Accuracy = 100;
		attack2.Type = AttackType.Heal;

		Attacks.Add (attack1);
		Attacks.Add (attack2);

	
	}
コード例 #6
0
ファイル: PlayerWalk.cs プロジェクト: ziyihu/TheWolfKillerU3D
	// Use this for initialization
	void Start () {
		//get the PlayerDirection.cs in the component
		dir = this.GetComponent<PlayerDirection> ();
		//get the character controller in the component
		controller = this.GetComponent<CharacterController> ();
		playerAttack = this.GetComponent<PlayerAttack>();
	}
コード例 #7
0
ファイル: MobCleaning.cs プロジェクト: Smlep/Illumnia
 // Use this for initialization
 void Start()
 {
     isintheroom = false;
     playerAttack = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerAttack>();
     player = GameObject.FindGameObjectWithTag("Player");
     scriptPersonnage = GameObject.FindGameObjectWithTag("Player").GetComponent<ScriptPersonnage>();
 }
コード例 #8
0
	public void levelUP(PlayerEnergy playerEnergy, PlayerAttack playerAttack) { // level up
		/*
		 * if the score >= the score required to level up(lvlScore), the player will level up.
		 * the lvlScore will be multiplied by 3
		 */

		level++;
		scoreLevel *= 3;

		switch (level) {
		case 1:
			playerEnergy.setMaxEnergy (110);
			playerAttack.setAtk (2);
			break;
		case 2:
			playerEnergy.setMaxEnergy (120);
			playerAttack.setAtk (3);
			break;
		case 3:
			playerEnergy.setMaxEnergy (130);
			playerAttack.setAtk (4);
			break;
		case 4:
			playerEnergy.setMaxEnergy (140);
			playerAttack.setAtk (5);
			break;
		case 5:
			playerEnergy.setMaxEnergy (150);
			playerAttack.setAtk (6);
			break;
		}
	}
コード例 #9
0
    public Animator anim;                                  // The animator component from the player.

    public void Start()
    {
        playerManager = GetComponent<PlayerManager>();
        playerController = GetComponent<PlayerController>();
        playerAttack = GetComponent<PlayerAttack>();
        anim = GetComponent<Animator>();
    }
コード例 #10
0
	void Start () {
		// initialize player's attributes
		player = GameObject.FindGameObjectWithTag("Player"); // find player's gamobject in the scene
		playerAttribute = player.GetComponent<Player> ();
		playerScore = player.GetComponent<PlayerScore> ();
		playerAttack = player.GetComponent<PlayerAttack> ();
	}
コード例 #11
0
 public void Awake()
 {
     playerController = GetComponent<PlayerController>();
     playerAttack = GetComponentInChildren<PlayerAttack>();
     anim = GetComponent<Animator>();
     currentHealth = startHealth;
 }
コード例 #12
0
ファイル: PlayerGrab.cs プロジェクト: windywyll/test3D
	// Use this for initialization
	void Start () {
        stamina = maxStamina;

        pc = this.gameObject.GetComponent<PlayerControler>();
        pa = this.gameObject.GetComponent<PlayerAttack>();
        anim = this.gameObject.GetComponent<Animator>();
	}
コード例 #13
0
ファイル: Mahp.cs プロジェクト: zermie557/TurkeyTactical
 void Awake()
 {
     playerAttack = GameObject.Find("PlayerBody").GetComponent<PlayerAttack>();
     //Debug.Log (GameObject.Find("PlayerBody").GetComponent<PlayerAttack>());
     attackForce = playerAttack.attackForce;
     playerTransform = GameObject.FindGameObjectWithTag ("Player").transform;
 }
コード例 #14
0
ファイル: LikeMikeCombatant.cs プロジェクト: metanymie/jga
	// Use this for initializationl
	public override void Start () {
		base.Start ();

		//set up basic stats
		MaxHitPoints = 120;
		HitPoints = 120;

		//set up the list of attacks
		PlayerAttack attack1 = new PlayerAttack();
		attack1.Name = "Slam Dunk";
		attack1.Description = "Scores a totally radical slam dunk, damaging a single target.";
		attack1.Power = 120;
		attack1.Accuracy = 100;
		attack1.Type = AttackType.Damage;

		PlayerAttack attack2 = new PlayerAttack();
		attack2.Name = "Gatorade\u2122 Sports Drink";
		attack2.Description = "Real athletes literally sweat this substance.  Restores health.";
		attack2.Power = MaxHitPoints;
		attack2.Accuracy = 100;
		attack2.Type = AttackType.Heal;

		Attacks.Add (attack1);
		Attacks.Add (attack2);

		originalBasketball = transform.GetChild (0);
		originalBasketballLocalPos = originalBasketball.transform.localPosition;

		attacksketball = Instantiate(originalBasketball) as Transform;
		attacksketball.renderer.enabled = false;
		attacksketball.transform.position = transform.position;
	
	}
コード例 #15
0
    private void Awake()
    {
        _rigidbody = GetComponent<Rigidbody2D>();
        _attack = GetComponent<PlayerAttack>();

        Player.Died += Die;
    }
コード例 #16
0
ファイル: Death.cs プロジェクト: Fenrigus/JQVerticalSlice
 // Use this for initialization
 void Start()
 {
     p = GameObject.Find ("Player");
     pStats = p.GetComponent<PlayerStats> ();
     pMove = p.GetComponent<MoveTest> ();
     pAttack = p.GetComponent<PlayerAttack> ();
     isAlive = true;
 }
コード例 #17
0
	// Use this for initialization
	void Start () {
		//at the beginning, no click action. 
		//set the target position as the current position
		targetPosition = transform.position;
		//get the PlayerWalk.cs component
		playerWalk = this.GetComponent<PlayerWalk> ();
		attack = this.GetComponent<PlayerAttack> ();
	}
コード例 #18
0
ファイル: PlayerAttackTemplate.cs プロジェクト: rbrt/pk
 public void SetWithTemplate(ref PlayerAttack playerAttack)
 {
     playerAttack.Damage = damage;
     playerAttack.BaseAttackTime = baseAttackTime;
     playerAttack.AttackRange = attackRange;
     playerAttack.AttackDuration = attackDuration;
     playerAttack.AttackSprites = attackSprites;
 }
コード例 #19
0
    // Use this for initialization
    void Start ()
    {
        playerManager = GetComponent<PlayerManager>();
        playerAttack = GetComponent<PlayerAttack>();
        playerAnimation = GetComponent<PlayerAnimation>();
        rigidBody = GetComponent<Rigidbody>();
        trans = GetComponent<Transform>();
	}
コード例 #20
0
    void Awake()
    {
        playerAttack = GameObject.FindGameObjectWithTag ("Player").GetComponent<PlayerAttack> ();
        Rigidbody bulletRB = GetComponent<Rigidbody> ();
        Vector3 direction = playerAttack.GetShotDirection ();

        bulletRB.AddForce (direction.normalized * bulletSpeed);
    }
コード例 #21
0
	void Start()
	{
		playerAnimationControll=TranscriptManager._instance.player.GetComponent<PlayerAnimationControll>();
        playerAttack = TranscriptManager._instance.player.GetComponent<PlayerAttack>();
        if(transform.Find("Mask"))
           maskSprite = transform.Find("Mask").GetComponent<UISprite>();  
        btn = this.GetComponent<UIButton>();
    }
コード例 #22
0
 void Start()
 {
     _inputToggle    = GetComponent<ToggleEnableInput>();
     _attack         = GetComponent<PlayerAttack>();
     _block          = GetComponent<PlayerBlock>();
     _movement       = GetComponent<PlayerMovement>();
     _rotation       = GameObject.Find("CameraController").GetComponent<CameraMovement>();
     _dodge          = GetComponent<PlayerRoll>();
 }
コード例 #23
0
    void Awake()
    {
        anim = GetComponent<Animator>();
        playerAudio = GetComponent<AudioSource>();
        playerMove = GetComponent<PlayerMove>();
        playerAttacking = GetComponentInChildren<PlayerAttack>();

        currentHealth = startingHealth;
    }
コード例 #24
0
 // Use this for initialization
 void Awake()
 {
     healthSlider.maxValue = startingHealth;
     healthSlider.value = startingHealth;
     anim = GetComponent<Animator>();
     playerAudio = GetComponent<AudioSource>();
     playerMovement = GetComponent<PlayerMovement>();
     playerAttack = GetComponentInChildren<PlayerAttack>();
     currentHealth = startingHealth;
 }
コード例 #25
0
ファイル: PlayerAnimation.cs プロジェクト: vin120/TaiDou
    private bool isSyncPlayerAnimation = false; //表示是否需要同步动画

	void Start()
    {
        player = GetComponent<Player>();
        if (GameController.Instance.battleType == BattleType.Team && player.roleID == PhotonEngine.Instance.role.ID) //当前角色属于当前客户端
        {
            battleController = GameController.Instance.GetComponent<BattleController>();
            isSyncPlayerAnimation = true;
        }
		anim = this.GetComponent<Animator>();
	    playerAttack = GetComponent<PlayerAttack>();
	}
コード例 #26
0
ファイル: MoveTest.cs プロジェクト: Fenrigus/JQVerticalSlice
    //int IsMoving = Animator.StringToHash("IsMoving");
    //int IsMovingY = Animator.StringToHash("IsMovingY");
    // Use this for initialization
    void Start()
    {
        anim = GetComponent<Animator> ();

        pStats = GetComponent<PlayerStats> ();
        pAttack = GetComponent<PlayerAttack> ();
        controller = GetComponent<CharacterController> ();
        isRight = 1;

        checkpoint = transform.position;
    }
コード例 #27
0
	// other methods
	public void isExhausted(PlayerAttack playerAttack, Text energyGUI) { // is currently exhausted
		energy += 0.25f;

		if (energyPercent < 100) {
			energyGUI.color = Color.red;
			playerAttack.setCanAttack (false);
		} else {
			energyGUI.color = Color.white;
			playerAttack.setCanAttack (true);
		}
	}
コード例 #28
0
ファイル: PlayerMove.cs プロジェクト: vin120/TaiDou
	void Start()
	{
		anim = this.GetComponent<Animator>();
	    playerAttack = this.GetComponent<PlayerAttack>();

	    if (GameController.Instance.battleType == BattleType.Team && isCanControl)
	    {
	        battleController = GameController.Instance.GetComponent<BattleController>();
            InvokeRepeating("SyncPositionAndRotation",0,1f/30f);
            InvokeRepeating("SyncMoveAnimation",0,1f/30f);
	    }
	}
コード例 #29
0
ファイル: PlayerMenu.cs プロジェクト: grasmann/ProjectSanon
 /// <summary>
 /// Start
 /// </summary>
 private void Start()
 {
     //hud = GameObjectTools.GetComponentInChildren<menu_in_game_hud>(FindObjectOfType<menu_in_game>().gameObject);
     //hud = FindObjectOfType<menu_in_game>().gameObject.GetComponentInChildrenB<menu_in_game_hud>();
     //hud = GetComponentsInChildren<menu_in_game_hud>(true)[0];
     //menu_in_game m = FindObjectOfType<menu_in_game>();
     //hud = m.GetComponentsInChildren<menu_in_game_hud>(true)[0];
     pm = GetComponent<PlayerMotor>();
     cam = GetComponent<PlayerCamera>();
     cl = GetComponent<PlayerClimbing>();
     atk = GetComponent<PlayerAttack>();
 }
コード例 #30
0
ファイル: PlayerAttackInspector.cs プロジェクト: rbrt/pk
    public static void CreateChildPlayerAttack(PlayerAttack parent, Action<PlayerAttack> function)
    {
        GameObject attack = new GameObject();
        attack.transform.parent = parent.transform;
        PlayerAttack item = attack.AddComponent<PlayerAttack>();

        item.Init();
        function(item);
        item.AccessAttackHandler = parent.AccessAttackHandler;

        var instance = PrefabUtility.FindPrefabRoot(parent.gameObject);
        PrefabUtility.ReplacePrefab(instance, PrefabUtility.GetPrefabParent(instance), ReplacePrefabOptions.ConnectToPrefab);
    }
コード例 #31
0
 void Start()
 {
     playerAttack = GetComponent <PlayerAttack>();
 }
コード例 #32
0
 public virtual void OnInstantPassive(PlayerAttack attackObj)
 {
     InitAttack(attackObj);
 }
コード例 #33
0
 void Start()
 {
     // 플레이어 게임 오브젝트에 붙어있는 Animator 클래스와 PlayerAttack 클래스를 변수에 할당받습니다.
     avatar       = GetComponent <Animator>();
     playerAttack = GetComponent <PlayerAttack>();
 }
コード例 #34
0
 private void Start()
 {
     pattack  = GameObject.FindWithTag("Player").GetComponent <PlayerAttack>();
     animator = GetComponent <Animator>();
 }
コード例 #35
0
    public void GainArtifact(Artifact.Title title)
    {
        Artifact artifact = new Artifact();

        Artifact.Type type = artifact.GetArtifactType(title);
        int           i    = 6;

        if (type == Artifact.Type.AbilityWeak)
        {
            i = 0;
            if (PlayerAttack.occupied[0])
            {
                artifact.SummonArtifact(PlayerMovement.tilePos, PlayerAttack.title[0]);
            }
        }

        else if (type == Artifact.Type.AbilityStrong)
        {
            i = 1;
            if (PlayerAttack.occupied[1])
            {
                i = 2;
                if (PlayerAttack.occupied[2])
                {
                    i = 1;
                    artifact.SummonArtifact(PlayerMovement.tilePos, PlayerAttack.title[1]);
                }
            }
        }

        else if (type == Artifact.Type.Helmet)
        {
            i = 3;
            if (PlayerAttack.occupied[3])
            {
                artifact.SummonArtifact(PlayerMovement.tilePos, PlayerAttack.title[3]);
            }
        }

        else if (type == Artifact.Type.Armor)
        {
            i = 4;
            if (PlayerAttack.occupied[4])
            {
                artifact.SummonArtifact(PlayerMovement.tilePos, PlayerAttack.title[4]);
            }
        }

        else if (type == Artifact.Type.Gauntlet)
        {
            i = 5;
            if (PlayerAttack.occupied[5])
            {
                artifact.SummonArtifact(PlayerMovement.tilePos, PlayerAttack.title[5]);
            }
        }


        if (i < 6)
        {
            PlayerAttack.title[i] = title;
            PlayerAttack.Abilities[i].GetComponentInChildren <Image>().sprite = Resources.Load <Sprite>("Artifacts/" + title.ToString());
            PlayerAttack.occupied[i]    = true;
            PlayerAttack.description[i] = artifact.GetDescription(title, i);

            AbilityStat abilityStat = new AbilityStat();
            abilityStat.UpdateStat(title, i);

            PlayerAttack attack = new PlayerAttack();
            attack.DisplayAbility(i);
        }
    }
コード例 #36
0
 // Use this for initialization
 void Start()
 {
     player       = GameObject.FindGameObjectWithTag("Player");
     attackScript = player.GetComponent <PlayerAttack>();
 }
コード例 #37
0
 // THis probably needs to be split into two different classes for Player/Enemy projectiles
 void Awake()
 {
     playerHealth = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerHealth>();
     enemyAttack  = GameObject.FindGameObjectWithTag("Enemy").GetComponent <EnemyAttack>();
     playerAttack = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerAttack>();
 }
コード例 #38
0
    WaitForSeconds turnDuration;                     //Will count down the turn duration.


    void Awake()
    {
        //Fill references
        playerAttack   = FindObjectOfType <PlayerAttack>();
        playerMovement = FindObjectOfType <PlayerMovement>();
    }
コード例 #39
0
 protected override void Start()
 {
     base.Start();
     attack = player.GetComponent <PlayerAttack>();
 }
コード例 #40
0
    void OnTriggerEnter2D(Collider2D col)
    {
        if (col.tag == "Attack")
        {
            PlayerAttack        attacker = col.transform.parent.GetComponent <PlayerAttack>();
            PlayerAttack.Attack attack;
            if (col.name.Equals("Bair"))
            {
                attack = attacker.Bair;
            }
            else if (col.name.Equals("Fair"))
            {
                attack = attacker.Fair;
            }
            else if (col.name.Equals("Uair"))
            {
                attack = attacker.Uair;
            }
            else if (col.name.Equals("Dair"))
            {
                attack = attacker.Dair;
            }
            else if (col.name.Equals("Nair"))
            {
                attack = attacker.Nair;
            }
            else if (col.name.Equals("Ftilt"))
            {
                attack = attacker.Ftilt;
            }
            else if (col.name.Equals("Utilt"))
            {
                attack = attacker.Utilt;
            }
            else if (col.name.Equals("Dtilt"))
            {
                attack = attacker.Dtilt;
            }
            else if (col.name.Equals("Jab"))
            {
                attack = attacker.Jab;
            }
            else
            {
                Debug.Log("UNKNOWN ATTACK: " + col.name);
                Debug.Log("Defaulting to attacker's jab");
                attack = attacker.Jab;
            }
            //If attacking player is flipped, flip attack knockback direction as well
            if (!col.transform.parent.GetComponent <Player>().facingRight)
            {
                attack.knockbackDirection = new Vector2(attack.knockbackDirection.x * -1, attack.knockbackDirection.y);
            }

            p.PlayerStagger(attack);
        }

        if (col.tag == "Projectile")
        {
            PlayerAttack        attacker = col.GetComponent <ProjectileScript>().shooter.GetComponent <PlayerAttack>();
            PlayerAttack.Attack attack   = new PlayerAttack.Attack();
            attack.hitbox             = col.gameObject;
            attack.attackDamage       = attacker.projectileDamage;
            attack.knockbackAmount    = attacker.projectileKnockback;
            attack.knockbackDirection = col.GetComponent <Rigidbody2D>().velocity.normalized;
            p.PlayerStagger(attack);
        }

        if (col.tag == "Grab")
        {
            Debug.Log("Player Grabbed!");
            this.transform.parent.parent = col.transform.parent;
            col.transform.parent.GetComponent <Animator>().SetTrigger("Grab Success");
            col.transform.parent.GetComponent <Animator>().ResetTrigger("Grab Release");
            anim.SetTrigger("Grabbed");
            p.rb.simulated = false;
            Invoke("EscapeGrab", 5); //HOW DO CANCEL INVOKE?
            return;
        }
    }
コード例 #41
0
 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     PlayerAttack.GetInstance().NormalAttack();
 }
コード例 #42
0
 // Start is called before the first frame update
 void Start()
 {
     ps = GameObject.FindGameObjectWithTag(Tags.player).GetComponent <PlayerStatus>();
     pa = GameObject.FindGameObjectWithTag(Tags.player).GetComponent <PlayerAttack>();
 }
コード例 #43
0
 void Start()
 {
     avatar          = GetComponent <Animator>();
     playerAttack    = GetComponent <PlayerAttack> ();
     Physics.gravity = new Vector3(0, -25, 0);
 }
コード例 #44
0
ファイル: Inventory.cs プロジェクト: medmor/RPGGame
 public void Start()
 {
     playerAttack = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerAttack>();
 }
コード例 #45
0
 void Start()
 {
     player = FindObjectOfType <PlayerAttack> ();
 }
コード例 #46
0
    // Set which action of the selected unit is currently being used
    public void SelectAction(int actionIndex)
    {
        RemoveHighlightedTiles();


        currentRuleset = selectedUnit.GetAction(actionIndex).ruleset;

        if (currentAttack == PlayerAttack.lightningSpecial && actionIndex != 2)
        {
            lightningAttackHex1 = null;
        }

        // set the current attack
        if (selectedUnit == earthUnit)
        {
            if (actionIndex == 1)
            {
                currentAttack = PlayerAttack.earthBasic;
            }
            else if (actionIndex == 2)
            {
                currentAttack = PlayerAttack.earthSpecial;
            }
        }
        else if (selectedUnit == lightningUnit)
        {
            if (actionIndex == 1)
            {
                currentAttack = PlayerAttack.lightningBasic;
            }
            else if (actionIndex == 2)
            {
                currentAttack = PlayerAttack.lightningSpecial;
            }
        }

        if (threatHeightlightTiles)
        {
            HighlightEnemiesThreatTiles(enemiesAlive, enemyThreatColor);
        }

        // Highlight area in range to walk
        if (currentRuleset.actionType == ActionType.movement)
        {
            HighlightTilesInRange(selectedUnit.MoveRange, null, true, true);
        }

        // Highlight area in range to attack
        if (currentRuleset.actionType == ActionType.attack)
        {
            if (selectedUnit == earthUnit)
            {
                HighlightTilesInRange(selectedUnit.AttackRange, null, false, true, true);
            }
            else if (selectedUnit == lightningUnit)
            {
                HighlightTilesInRange(selectedUnit.AttackRange, null, false, true, false);
            }
        }

        // Highlight area in range to special attack
        if (currentRuleset.actionType == ActionType.specialAttack)
        {
            HighlightTilesInRange(selectedUnit.SpecialAttackRange, null, false, true);
        }
    }
コード例 #47
0
 // Start is called before the first frame update
 void Start()
 {
     targetPosition = transform.position;
     playerMove     = GetComponent <PlayerMove>();
     playerAttack   = GetComponent <PlayerAttack>();
 }
コード例 #48
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.name.Equals("Sphere"))
        {
            int otherPlayerId = other.GetComponentInParent <Player>().id;

            if (otherPlayerId != id)
            {
                bool isOnShip = GameServer.clients[otherPlayerId].player.data.is_on_ship;

                /*if (isOnShip)
                 * {
                 *  ServerSend.DestroyPlayerCharacter(id, otherPlayerId);
                 * }*/
                ServerSend.ActivateShip(id, otherPlayerId);
                ServerSend.Stats(otherPlayerId, id);
                ServerSend.Buffs(otherPlayerId, id);
            }
        }
        else if (other.name.Equals("PlayerSphere"))
        {
            int otherPlayerId = other.GetComponentInParent <PlayerCharacter>().id;

            if (otherPlayerId != id)
            {
                ServerSend.ActivatePlayerCharacter(id, otherPlayerId);
                ServerSend.Stats(otherPlayerId, id);
                ServerSend.Buffs(otherPlayerId, id);
                Player player = GameServer.clients[otherPlayerId].player;
                if (player.playerMovement.agent.enabled)
                {
                    ServerSend.DeactivatePlayerMovement(otherPlayerId, player.playerInstance.transform.position);
                }
                else
                {
                    ServerSend.ActivatePlayerMovement(otherPlayerId, player.playerInstance.transform.position);
                }
            }
        }
        else if (other.tag.Equals("Resource"))
        {
            gatheringEnabled = true;
            currentResource  = other.gameObject;
        }
        else if (other.tag.Equals("Dock"))
        {
            dock     = other.gameObject;
            isOnDock = true;
        }
        else if (other.tag.Equals("CraftingSpot"))
        {
            craftingEnabled = true;
            craftingSpot    = other.GetComponent <CraftingSpot>();
        }
        else if (other.tag == "Trader")
        {
            tradingEnabled = true;
            trader         = other.gameObject.GetComponent <Trader>();
        }
        else if (other.tag == "TradeBroker")
        {
            tradeBrokerEnabled = true;
        }
        else if (other.tag == "Weapon")
        {
            PlayerAttack.OnPlayerAttack(this, other);
        }
        else if (other.name.Equals("NPCSphere"))
        {
            int npcId = other.GetComponentInParent <NPC>().id;
            ServerSend.NPCStats(npcId, id);
            ServerSend.ActivateNPC(id, npcId);
        }
        else if (other.name.Equals("DamageCollider"))
        {
            NPC npc = other.GetComponentInParent <NPC>();
            DamageColliderInfo info = other.GetComponent <DamageColliderInfo>();
            NPCAttack.OnNPCAttack(info, npc, this);
        }
    }
コード例 #49
0
 // Use this for initialization
 void Start()
 {
     instance = this;
 }
コード例 #50
0
 void Start()
 {
     move         = GetComponent <PlayerMove>();
     anima        = GetComponent <Animation>();
     playerAttack = GetComponent <PlayerAttack>();
 }
コード例 #51
0
 // Start is called before the first frame update
 void Start()
 {
     Player = GetComponent <PlayerAttack>();                 //on fait réference au script PlayerAttack pour pouvoir accéder les variables qu'elle contient
 }
コード例 #52
0
 public PlayerAttack()
 {
     Current = this;
 }
コード例 #53
0
 void Awake()
 {
     m_playerAttack    = GameComponents.Player.GetComponent <PlayerAttack>();
     m_momentumManager = GameComponents.Player.GetComponent <MomentumManager>();
 }
コード例 #54
0
 // Use this for initialization
 void Start()
 {
     anim   = gameObject.GetComponent <Animator>();
     attack = gameObject.GetComponentInChildren <PlayerAttack>();
 }
コード例 #55
0
 private void Awake()
 {
     anim         = GetComponent <Animator>();
     playerAttack = GetComponentInChildren <PlayerAttack>();
 }
コード例 #56
0
ファイル: Hp.cs プロジェクト: Ceeeeed/Esus
 // Use this for initialization
 void Start()
 {
     pa = GameObject.Find("Player").GetComponent <PlayerAttack>();
 }
コード例 #57
0
 public virtual void OnDelayedPassive(PlayerAttack attackObj)
 {
     InitAttack(attackObj);
 }
コード例 #58
0
 private void Start()
 {
     _playerAttack = GetComponent <PlayerAttack>();
     _playerJump   = GetComponent <PlayerJump>();
 }
コード例 #59
0
 // Use this for initialization
 void Start()
 {
     playerMovement = GetComponent <PlayerMovement>();
     playerHealth   = GetComponent <PlayerHealth>();
     playerAttack   = GetComponent <PlayerAttack>();
 }
コード例 #60
0
 void Start()
 {
     avatar       = GetComponent <Animator>();
     playerAttack = GetComponent <PlayerAttack>();
 }