コード例 #1
0
 private void Awake()
 {
     _rigidbody2D      = GetComponent <Rigidbody2D>();
     _jump             = GetComponent <Jump>();
     _launchProjectile = GetComponent <LaunchProjectile>();
     _audioSource      = GetComponent <AudioSource>();
     _input            = new PcInputController();
 }
コード例 #2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        LaunchProjectile myScript = (LaunchProjectile)target;

        if (GUILayout.Button("Launch Projectile"))
        {
            myScript.Launch();
        }
    }
コード例 #3
0
ファイル: Attack.cs プロジェクト: megamen32/ARexamples
    public void Setup()
    {
        // Default values
        canAttack       = true;
        shieldActivated = false;

        // Set up projectile launcher
        projectileLauncher = GetComponentInChildren <LaunchProjectile>();
        projectileLauncher.projectileTrailColor  = team.color;
        projectileLauncher.projectileOwnerPeerId = GetComponent <PlayerManager>().peerId;

        // Attach a random wand based on the team that this player is in
        AttachRandomWand();
    }
コード例 #4
0
 //Start function gets the enemy players and player along with setting up camera related stuff
 void Start()
 {
     timer   = 500;
     aM      = GameObject.FindObjectOfType <AudioManager>();
     player  = GameObject.FindGameObjectWithTag("Player");
     enemies = GameObject.FindGameObjectsWithTag("Enemy");
     lP      = GameObject.FindObjectOfType <LaunchProjectile>();
     uM      = GameObject.FindObjectOfType <UiManager>();
     if (camera != null)
     {
         startingCameraPosition = camera.transform.position;
         pauseButton.GetComponent <Button>().onClick.AddListener(PauseUnpause);
     }
     else
     {
         Debug.LogError("Camera reference missing");
     }
 }
コード例 #5
0
 // Start is called before the first frame update
 void Start()
 {
     playerController    = GetComponentInParent <PlayerController>();
     enemySpawnerScript  = enemySpawner.GetComponent <EnemySpawnManager>();
     Launcher            = GetComponentInChildren <LaunchProjectile>();
     rotateTurret        = GetComponentInChildren <RotateTurret>();
     medkitSpawnerScript = medkitSpawner.GetComponent <MedkitSpawnManager>();
     healthText          = healthDisplay.GetComponent <Text>();
     Health                   = maxHealth;
     healthText.text          = $"Structural Integrity: {Health}%";
     finalScoreDisplayer      = finalScoreDisplay.GetComponent <FinalScoreDisplay>();
     hitSound                 = GetComponent <AudioSource>();
     gameOver                 = false;
     lowHealthNoise           = healthDisplay.GetComponent <AudioSource>();
     repairNoise              = medkitSpawner.GetComponent <AudioSource>();
     powerupSpawnerScript     = powerupSpawner.GetComponent <PowerupSpawnManager>();
     tankMaterial.mainTexture = greenTankTexture;
     engineNoise              = tankParent.GetComponent <AudioSource>();
 }
コード例 #6
0
 // Start is called before the first frame update
 void Start()
 {
     playerController    = GetComponentInParent <PlayerController>();
     enemySpawnerScript  = enemySpawner.GetComponent <EnemySpawnManager>();
     Launcher            = GetComponentInChildren <LaunchProjectile>();
     rotateTurret        = GetComponentInChildren <RotateTurret>();
     medkitSpawnerScript = medkitSpawner.GetComponent <MedkitSpawnManager>();
     healthText          = healthDisplay.GetComponent <Text>();
     Health              = maxHealth;
     healthText.text     = $"Structural Integrity: {Health}%";
     finalScoreDisplayer = finalScoreDisplay.GetComponent <FinalScoreDisplay>();
     finalTimeDisplayer  = finalTimeDisplay.GetComponent <FinalTimeDisplay>();
     hitSound            = GetComponent <AudioSource>();
     gameOver            = false;
     lowHealthNoise      = healthDisplay.GetComponent <AudioSource>();
     repairNoise         = medkitSpawner.GetComponent <AudioSource>();
     engineNoise         = tankParent.GetComponent <AudioSource>();
     totalsTrackerObject = GameObject.FindGameObjectWithTag("TotalsTracker");
     totalsTracker       = totalsTrackerObject.GetComponent <TotalsTracker>();
     meshRenderer        = GetComponent <MeshRenderer>();
     turretMeshRenderer  = turret.GetComponent <MeshRenderer>();
     MakeTankGreen();
     musicManager = musicManagerObject.GetComponent <MusicManager>();
 }
コード例 #7
0
 void Start()
 {
     rb           = GetComponent <Rigidbody>();
     launchScript = GetComponent <LaunchProjectile>();
 }
コード例 #8
0
        public override object Evaluate(List <string> args, ExpressionEvaluator evaluator, Creature player, Target target, CastedSpell spell, RollResults dice = null)
        {
            ExpectingArguments(args, 3, 11);
            if (player == null || spell == null)
            {
                return(null);
            }
            string               effectName               = Expressions.GetStr(args[0]);
            ProjectileKind       projectileKind           = ProjectileKind.EachTarget;
            int                  projectileCount          = 1;
            float                speed                    = 20;
            FireCollisionEventOn fireCollisionEventOn     = FireCollisionEventOn.EachImpact;
            float                launchTimeVariance       = 0;
            float                targetVariance           = 0;
            ProjectileSizeOption projectileSize           = ProjectileSizeOption.ConstantSize;
            float                projectileSizeMultiplier = 1;
            float                bezierPathMultiplier     = 1;

            if (args.Count > 1)
            {
                projectileKind = Expressions.Get <ProjectileKind>(args[1]);
                if (args.Count > 2)
                {
                    int.TryParse(args[2], out projectileCount);
                    if (args.Count > 3)
                    {
                        float.TryParse(args[3], out speed);

                        if (args.Count > 4)
                        {
                            fireCollisionEventOn = Expressions.Get <FireCollisionEventOn>(args[4]);
                            if (args.Count > 5)
                            {
                                float.TryParse(args[5], out launchTimeVariance);
                                if (args.Count > 6)
                                {
                                    float.TryParse(args[6], out targetVariance);
                                    if (args.Count > 7)
                                    {
                                        projectileSize = Expressions.Get <ProjectileSizeOption>(args[7]);
                                        if (args.Count > 8)
                                        {
                                            float.TryParse(args[8], out projectileSizeMultiplier);
                                            if (args.Count > 9)
                                            {
                                                float.TryParse(args[9], out bezierPathMultiplier);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            ProjectileEffectEventArgs ea = new ProjectileEffectEventArgs(effectName, spell.ID, player.taleSpireId, speed, projectileCount, projectileKind, fireCollisionEventOn, launchTimeVariance, targetVariance, target, projectileSize, projectileSizeMultiplier, bezierPathMultiplier);

            LaunchProjectile?.Invoke(null, ea);

            return(null);
        }