Esempio n. 1
0
    void Start()
    {
        EventManager.resetObjects += Reset;

        if (!Projectile.GetComponent <SpriteRenderer> ())
        {
            Projectile.AddComponent <SpriteRenderer> ();
        }

        SuperScript = gameObject.AddComponent <NewObjectSpawner> ();
        Target      = new Vector3(Xdirection, Ydirection);

        SuperScript.EnablePooling = EnablePooling;
        SuperScript.SetProjectile(0, Projectile);
        SuperScript.SetDeathTimer(0, DeathTimer);
        SuperScript.SetKinematicObjects(0, IsKinematic);

        if (RandomColor)
        {
            SuperScript.SetColor_Random(0);
        }

        TimeToSpawnObjects = ObjectAmount * ObjectDelay;

        if (IsEnabled)
        {
            StartCoroutine("C_StartCoroutine");
        }
    }
Esempio n. 2
0
    void Start()
    {
        NewObjectSpawner Object1 = CreateNewObjectSpawner();

        Object1.SetProjectile(0, Projectile1);
        Object1.SetColor(0, Color.red);

        NewObjectSpawner Object2 = CreateNewObjectSpawner();

        Object2.SetProjectile(0, Projectile1);
        Object2.SetColor(0, Color.blue);

        NewObjectSpawner Object3 = CreateNewObjectSpawner();

        Object3.SetProjectile(0, Projectile1);
        Object3.SetColor(0, Color.green);

        NewObjectSpawner Object4 = CreateNewObjectSpawner();

        Object4.SetProjectile(0, Projectile1);
        Object4.SetColor(0, Color.yellow);

        NewObjectSpawner Object5 = CreateNewObjectSpawner();

        Object5.SetProjectile(0, Projectile1);
        Object5.SetColor(0, Color.gray);



        Object1.CreateCircle(0, 0.1f, 12, 1, 1, 1);
        Object1.MoveToPosition_Player_X(2, 1);
        Object1.MoveToPosition_Player_Y(2, 1);
    }
Esempio n. 3
0
    void Awake()
    {
        if (RestartOnReset)
        {
            EventManager.resetObjects += Reset;
        }

        startingColor = GetComponent <SpriteRenderer> ().color;

        if (!gameObject.GetComponent <NewObjectSpawner> ())
        {
            SuperScript = gameObject.AddComponent <NewObjectSpawner> ();
        }
        else
        {
            SuperScript = gameObject.GetComponent <NewObjectSpawner> ();
        }
        // Cannot allow speed changes of 0 or less
        if (SpeedChange <= 0)
        {
            SpeedChange = 1;
        }

//		if(IsEnabled && gameObject.GetComponent<SpriteRenderer>() != null)
//			StartCoroutine ("C_ChangingColor");
    }
Esempio n. 4
0
    void OnEnable()
    {
        if (!gameObject.GetComponent <NewObjectSpawner> ())
        {
            SuperScript = gameObject.AddComponent <NewObjectSpawner> ();
        }

        StartCoroutine("C_ChangingColor");
    }
Esempio n. 5
0
    // This creates a pinwheel type object
    void Action1()
    {
        NewObjectSpawner Object1 = CreateNewObjectSpawner();

        Object1.SetProjectile(0, Projectile1);

//		Object1.MoveObjectToPoint (0, Object1.gameObject, UpperLeftCorner.position, 0);
        Object1.CreateMultiLines_World(1, 0.1f, 5, 2, 10);
        Object1.RotateDegrees(1, null, 1, 360, true);
    }
Esempio n. 6
0
    // Outward circular spiral - enlarge as it is built
    void Action2()
    {
        NewObjectSpawner Object1 = CreateNewObjectSpawner();

        Object1.SetProjectile(0, Projectile1);

        Object1.CreateCircle_World(1, 0.1f, 25, 0.5f, 0.5f, 1f);
        Object1.RotateToDegree(1, null, 0.75f, 180, true);
        Object1.ChangeScale(1, 3.5f, 1f, false);

        Object1.ChangeColor_Children(5, 1f);
    }
Esempio n. 7
0
    void OnEnable()             // Create all of the objects
    {
//		Instantiate (BossMusic_Controller);
//		MusicController.control.Fade_Play_Unfade (BossMusic);
        MusicController.control.PlayNewClip(BossMusic);

        NewObjectSpawner TEMP;

        CenterHead.SetColor(0, Color.white);
        BackgroundSpin.SetActive(true);
        CenterHead.UnfadeObject(0, BackgroundSpin, 1f);

        TEMP = BackgroundSpin.GetComponent <NewObjectSpawner> ();
        TEMP.RotateDegrees(0, 0.1f, 0, false);

        TEMP = LeftEar.GetComponent <NewObjectSpawner> ();
        TEMP.CreateTriangle(0, 0.1f, 9, 0.25f, 0.25f);
        CenterHead.TESTCOMBINE(3, TEMP);

        TEMP = RightEar.GetComponent <NewObjectSpawner> ();
        TEMP.CreateTriangle(0, 0.1f, 9, 0.25f, 0.25f);
        CenterHead.TESTCOMBINE(3, TEMP);

        LeftEye = LeftEyeObject.GetComponent <NewObjectSpawner> ();
        LeftEye.CreateLineInDirection(0, 0, 1, new Vector2(0, 0), 0);
        LeftEye.RotateDegrees(0, 0, 315, true);
//		LeftEye.RotateTwordsObject_Player (0, 5, false);

        RightEye = RightEyeObject.GetComponent <NewObjectSpawner> ();
        RightEye.CreateLineInDirection(0, 0, 1, new Vector2(0, 0), 0);
        RightEye.RotateDegrees(0, 0, 315, true);
//		RightEye.RotateTwordsObject_Player (0, 5, false);

        TEMP = Mouth.GetComponent <NewObjectSpawner> ();
        TEMP.CreateCircle(0, 0.1f, 7, 0.5f, 0.5f, 2);
        TEMP.CreateCircle(0, 0.1f, 5, 0.05f, 0.05f, 1);
        TEMP.CreateLineInDirection_World(0, 0.1f, 2, new Vector2(0, -1), 0.5f);

        CenterHead.TESTCOMBINE(3, TEMP);
        LeftArm.SetColor(0, Color.white);
        RightArm.SetColor(0, Color.white);

        CenterHead.CreateCircle(0, 0.05f, 30, 1, 1, 1);
        LeftArm.CreateSquare(0, 0.1f, 16, 0.5f, 0.4f);
        RightArm.CreateSquare(0, 0.1f, 16, 0.5f, 0.4f);
        LeftArm.SetColor_Random(3);
        RightArm.SetColor_Random(3);

        StartCoroutine(C_StartBattle());
    }
Esempio n. 8
0
    void Start()
    {
        if (GetComponent <HPModule>())
        {
            HPModule TEMP = GetComponent <HPModule>();
            TEMP.On_HPModule_Death += MonsterDeath;
        }

        EventManager.resetObjects += Reset;
        startingPosition           = gameObject.transform.position;

        if (JumpPower == 0)
        {
            JumpSpeed = 0;
        }

        anim = GetComponent <Animator>();
        if (DefaultFacingRight)
        {
            Vector3 theScale = transform.localScale;
            theScale.x          *= -1;
            transform.localScale = theScale;
//			BackupScale = theScale;

            Canvas[] childCanvases = GetComponentsInChildren <Canvas> ();
            foreach (Canvas child in childCanvases)
            {
                theScale    = child.transform.localScale;
                theScale.x *= -1;
                child.transform.localScale = theScale;
            }
        }

        MonsterManipulation = gameObject.AddComponent <NewObjectSpawner> ();
        MonsterManipulation.SetProjectile(0, MonsterProjectile);
        MonsterManipulation.SetToEnablePooling(0, false);

        if (GetComponent <CalculateChecks> ())
        {
            calculateChecks = GetComponent <CalculateChecks> ();
        }
        else
        {
            calculateChecks = gameObject.AddComponent <CalculateChecks> ();
        }
        calculateChecks.ChangeLayerMask(whatIsGround);
        calculateChecks.Set_ColliderIndent(ColliderIndent);

        StartCoroutine(C_StartAI());
    }
    void Start()
    {
        EventManager.resetObjects += Reset;
        startingPosition           = gameObject.transform.position;

        anim = GetComponent <Animator>();
        if (DefaultFacingRight)
        {
            Vector3 theScale = transform.localScale;
            theScale.x          *= -1;
            transform.localScale = theScale;

            Canvas[] childCanvases = GetComponentsInChildren <Canvas> ();
            foreach (Canvas child in childCanvases)
            {
                theScale    = child.transform.localScale;
                theScale.x *= -1;
                child.transform.localScale = theScale;
            }
        }

        MonsterManipulation = gameObject.AddComponent <NewObjectSpawner> ();
        MonsterManipulation.SetProjectile(0, MonsterProjectile);
        MonsterManipulation.SetToEnablePooling(0, false);

//		MonsterManipulation.AddSelfToList (0);
//		MonsterManipulation.ChangeColor_Children (0, 1f);
//		MonsterManipulation.SetColor_Random (0);
//		MonsterManipulation.SetKinematicObjects (0, false);
//		ScaleModifier = gameObject.transform.localScale.x;

        if (GetComponent <CalculateChecks> ())
        {
            calculateChecks = GetComponent <CalculateChecks> ();
        }
        else
        {
            calculateChecks = gameObject.AddComponent <CalculateChecks> ();
        }
        calculateChecks.ChangeLayerMask(whatIsGround);

        StartCoroutine(C_StartAI());
    }
Esempio n. 10
0
    void Awake()
    {
        EventManager.resetObjects += Reset;

        RoomPosition       = EntireRoom.transform.position;
        LeftSpawnPosition  = LeftSpawner.transform.position;
        RightSpawnPosition = RightSpawner.transform.position;

        BlockToSpawn = new GameObject("CustomBlock");
        BlockToSpawn.AddComponent <SpriteRenderer> ().sprite = BlockSpawner_Sprite;
        BlockToSpawn.tag = "Ground";
        BlockToSpawn.transform.position = new Vector2(-8, -8);
        BlockToSpawn.layer = LayerMask.NameToLayer("SolidObjects");
        BlockToSpawn.AddComponent <BoxCollider2D> ();
        BlockToSpawn.transform.localScale *= 2;
        BlockToSpawn.GetComponent <SpriteRenderer> ().material = EntireRoom.GetComponent <SpriteRenderer> ().material;

        Manipluation = GetComponent <NewObjectSpawner> ();

        O_LeftSpawner = LeftSpawner.AddComponent <NewObjectSpawner> ();
        O_LeftSpawner.EnablePooling = false;
        O_LeftSpawner.SetProjectile(0, MedusaHead_Right);
        O_LeftSpawner.SetDeathTimer(0, 10);
        O_LeftSpawner.SetColor(0, Color.white);

        O_RightSpawner = RightSpawner.AddComponent <NewObjectSpawner> ();
        O_RightSpawner.EnablePooling = false;
        O_RightSpawner.SetProjectile(0, MedusaHead_Left);
        O_RightSpawner.SetDeathTimer(0, 10);
        O_RightSpawner.SetColor(0, Color.white);

        O_EndPathSpawner = EndPathSpawner.AddComponent <NewObjectSpawner> ();
        O_EndPathSpawner.SetProjectile(0, BlockToSpawn);
        O_EndPathSpawner.SetColor(0, Color.white);

//		StartCoroutine (C_StartRoomActions (0));
    }
Esempio n. 11
0
    // Testing multiple objects doing stuff
    void Action3()
    {
        NewObjectSpawner Object1 = CreateNewObjectSpawner();

        Object1.SetProjectile(0, Projectile1);
        Object1.SetColor(0, Color.blue);

        NewObjectSpawner Object2 = CreateNewObjectSpawner();

        Object2.SetProjectile(0, Projectile1);
        Object2.SetColor(0, Color.red);

        NewObjectSpawner Object3 = CreateNewObjectSpawner();

        Object3.SetProjectile(0, Projectile1);
        Object3.SetColor(0, Color.green);


        Object1.CreateCircle(1, 0.1f, 25, 1, 1, 2f);
        Object2.RotateToDegree(0, null, 0, 180, true);
        Object2.CreateCircle(3.7f, 0.1f, 25, 1, 1, 2f);

        Object1.RotateDegrees(7, null, 2, 180, true);
        Object2.RotateDegrees(7, null, 2, 180, true);

        Object1.LaunchAtTarget(9, UpperLeftCorner, 2);
        Object1.StopMovement(10);
        Object2.LaunchAtTarget(9, UpperRightCorner, 2);
        Object2.StopMovement(10);

        Object1.MorphToSquare(9, 1, 1, 0f, 2.5f);
        Object2.MorphToCircle(9, 1, 1, 0f, 2.5f);

        Object1.ChangeColor_Children(10, Color.red, 1);
        Object2.ChangeColor_Children(10, Color.blue, 1);

        Object1.MorphToCircle(12, 1, 1, 0f, 2);
        Object2.MorphToSquare(12, 1, 1, 0f, 2);

        Object2.MorphToCircle(14, 1, 1, 0f, 2);
        Object1.MoveToPosition(14, CenterOfScreen, 2);
        Object2.MoveToPosition(14, CenterOfScreen, 2);

        Object1.ChangeScale(16, 2, 1, false);

        Object1.RotateDegrees(18, null, 1, 0, true);
        Object2.RotateDegrees(18, null, -1, 0, true);

        Object1.StopRotation(21);
        Object2.StopRotation(21);

        Object3.MoveToPosition(0, BottomLeftCorner, 0);
        Object3.CreateLineToTarget(21, 0.002f, 30, UpperRightCorner);

        Object1.ChangeColor_Children(21, 1);
        Object2.ChangeColor_Children(21, 1);

        Object3.BreakRandomly(22, 0.02f, 4);

        Object1.ChangeScale(24, 0.5f, 3, false);
        Object2.ChangeScale(24, 0.5f, 1, false);

        Object1.RotateDegrees(25, null, 1, 0, true);
        Object2.RotateDegrees(25, null, -1, 0, true);
        Object1.BreakRandomly(26, 0.1f, 2);
        Object2.BreakRandomly(26, 0.1f, 2);
        Object1.ChangeScale(26f, 3f, 1f, false);
        Object2.ChangeScale(26f, 3f, 1f, false);

        Object1.StopColorChangeEffect(28);
        Object2.StopColorChangeEffect(28);

        Object1.SprayInDirection(30, 40, new Vector3(-0.25f, 1), 0.1f, 3);
        Object2.SprayInDirection(30, 40, new Vector3(0.25f, 1), 0.1f, 3);
        Object3.SprayInDirection(30, 80, new Vector3(0.5f, 1f), 0.05f, 7);

        Object1.EnableObject(33, Exit);
        Object1.PlayClip(33, ExitClip);
    }
Esempio n. 12
0
    void Awake()                // Setup all of the objects
    {
        EventManager.resetObjects += Reset;
        LeftArmStartingPosition    = LeftArmObject.transform.localPosition;
        RightArmStartingPosition   = RightArmObject.transform.localPosition;
        CenterStartingPosition     = gameObject.transform.localPosition;

        StartingMusic = MusicController.control.musicclip;

        Rigidbody2D      TEMPBODY;
        NewObjectSpawner TEMP;

        BottomLeftSpawn = BottomLeft.AddComponent <NewObjectSpawner> ();
        BottomLeftSpawn.SetProjectile(0, Projectile);
        BottomLeftSpawn.SetColor_Random(0);
        BottomLeftSpawn.SetDeathTimer(0, 10);
        BottomRightSpawn = BottomRight.AddComponent <NewObjectSpawner> ();
        BottomRightSpawn.SetProjectile(0, Projectile);
        BottomRightSpawn.SetColor_Random(0);
        BottomRightSpawn.SetDeathTimer(0, 10);

        if (!BackgroundSpin.GetComponent <NewObjectSpawner>())
        {
            BackgroundSpin.AddComponent <NewObjectSpawner> ();
        }
        CenterHead = gameObject.AddComponent <NewObjectSpawner> ();
        CenterHead.SetProjectile(0, Projectile);
        CenterHead.SetColor(0, Color.white);
        TEMPBODY             = gameObject.AddComponent <Rigidbody2D> ();
        TEMPBODY.isKinematic = true;

        TEMP = LeftEar.AddComponent <NewObjectSpawner> ();
        TEMP.SetProjectile(0, Projectile);
        TEMP.SetColor(0, Color.white);
        TEMP.RotateDegrees(0, 0, 45, true);

        TEMP = RightEar.AddComponent <NewObjectSpawner> ();
        TEMP.SetProjectile(0, Projectile);
        TEMP.SetColor(0, Color.white);
        TEMP.RotateDegrees(0, 0, 315, true);

        LeftEye = LeftEyeObject.AddComponent <NewObjectSpawner> ();
        LeftEye.SetProjectile(0, EyeballPrefab);
        LeftEye.SetColor(0, Color.white);

        RightEye = RightEyeObject.AddComponent <NewObjectSpawner> ();
        RightEye.SetProjectile(0, EyeballPrefab);
        RightEye.SetColor(0, Color.white);

        TEMP = Mouth.AddComponent <NewObjectSpawner> ();
        TEMP.SetProjectile(0, Projectile);
        TEMP.SetColor(0, Color.white);
        TEMP.RotateDegrees(0, 0, 260, true);

        LeftArm = LeftArmObject.AddComponent <NewObjectSpawner> ();
        LeftArm.SetProjectile(0, Projectile);
        LeftArm.SetColor(0, Color.white);
        TEMPBODY             = LeftArmObject.AddComponent <Rigidbody2D> ();
        TEMPBODY.isKinematic = true;

        RightArm = RightArmObject.AddComponent <NewObjectSpawner> ();
        RightArm.SetProjectile(0, Projectile);
        RightArm.SetColor(0, Color.white);
        TEMPBODY             = RightArmObject.AddComponent <Rigidbody2D> ();
        TEMPBODY.isKinematic = true;
    }