Example #1
0
	// Use this for initialization
	void Start () {
		combo = new Combo();

		if (comboIndicator == null)
		{
			var gameObject = GameObject.FindWithTag("Player Combo Indicator");
			comboIndicator = gameObject.GetComponent<ComboIndicator>();
		}
		if (comboIndicator != null)
		{
			comboIndicator.SetCombo(combo);
		}
		else
		{
			Debug.LogWarning("Cannot find 'Player Combo Indicator'. Did you add a UI?");
		}

		bulletSpawner = GetComponent<RespawnBullet>();
		comboDb = FindObjectOfType<ComboDatabase>();

		invalidComboEffect = FindObjectOfType<InvalidComboEffect>();

		string[] joystickNames = Input.GetJoystickNames();

		foreach (string str in joystickNames)
		{
			print("Joystick:" + str);
		}
	}
Example #2
0
	// Use this for initialization
	void Start () {
		comboIndicator = Instantiate(comboIndicatorPrefab) as ComboIndicator;
		comboIndicator.transform.SetParent(transform);
		comboIndicator.transform.localPosition = comboIndicatorOffset;

		comboIndicator.Initialize(id);

		if (castIndicatorPrefab != null)
		{
			castIndicator = Instantiate(castIndicatorPrefab) as EnemyCastIndicator;
			castIndicator.transform.SetParent(transform);
			castIndicator.transform.localPosition = castIndicatorOffset;

			castIndicator.gameObject.SetActive(false);
		}

		if (spawnPoint != null)
		{
			spawnPoint.occupied = true;
		}

		castSpeed = RandomCastSpeed();
		castFactor = 0.0f;

		castDelay = Random.Range(castDelayMin, castDelayMax);

		hasBeenFiredAt = false;
		currentState = State.Startup;

		particleSpawner = FindObjectOfType<ParticleSpawner>();
		eggEffect = FindObjectOfType<EggEffect>();
	}
Example #3
0
    public void Kill()
    {
        if (!dead)
        {
            dead = true;
            if (anim)
            {
                anim.SetTrigger("Die");
            }
            if (superEnemy)
            {
                Combo.Color[] colors = { Combo.Color.Color0, Combo.Color.Color1, Combo.Color.Color2 };
                Combo.Shape[] shapes = { Combo.Shape.Shape0, Combo.Shape.Shape1, Combo.Shape.Shape2 };
                Combo         newCombo;
                newCombo.color = colors[Random.Range(0, colors.Length)];
                newCombo.shape = shapes[Random.Range(0, shapes.Length)];
                Debug.Log(string.Format("Creating new combo: {0} / {1}", newCombo.color, newCombo.shape));
                swordGame.postComboEventPassed(newCombo);

                ComboIndicator newComboIndicator = Instantiate(comboIndicator) as ComboIndicator;
                newComboIndicator.SetCombo(newCombo);
                newComboIndicator.transform.parent   = transform.parent;
                newComboIndicator.transform.position = transform.position + new Vector3(0f, 3f, 0f);
                newComboIndicator.pickedUp           = true;
            }
        }
    }