Beispiel #1
0
        private void FireRocket(GameObject skyRocket, Vector2 target, PlayerController player1)
        {
            PlayerController player    = player1;
            SkyRocket        component = SpawnManager.SpawnProjectile(skyRocket, target, Quaternion.identity, true).GetComponent <SkyRocket>();

            component.TargetVector2 = target;
            tk2dSprite componentInChildren = component.GetComponentInChildren <tk2dSprite>();

            component.transform.position = component.transform.position.WithY(component.transform.position.y - componentInChildren.transform.localPosition.y);
            component.ExplosionData.ignoreList.Add(player.specRigidbody);
        }
        private void FireRocket(AIActor enemy)
        {
            var cm = UnityEngine.Object.Instantiate <GameObject>((GameObject)BraveResources.Load("Global Prefabs/_ChallengeManager", ".prefab"));

            this.Rocket = (cm.GetComponent <ChallengeManager>().PossibleChallenges.Where(c => c.challenge is SkyRocketChallengeModifier).First().challenge as SkyRocketChallengeModifier).Rocket;
            UnityEngine.Object.Destroy(cm);
            if (BossKillCam.BossDeathCamRunning)
            {
                return;
            }
            if (GameManager.Instance.PreventPausing)
            {
                return;
            }
            SkyRocket component = SpawnManager.SpawnProjectile(this.Rocket, Vector3.zero, Quaternion.identity, true).GetComponent <SkyRocket>();

            component.Target = enemy.specRigidbody;
            tk2dSprite componentInChildren = component.GetComponentInChildren <tk2dSprite>();

            component.transform.position = component.transform.position.WithY(component.transform.position.y - componentInChildren.transform.localPosition.y);
            this.m_spawnedRockets++;
        }