コード例 #1
0
ファイル: BulletSpawner.cs プロジェクト: thejosh223/GGJ2016
	public void Update() {

		// Used for debugging the emitters
//		if (Input.GetKeyDown(KeyCode.D)) {
//			debugMode = !debugMode;
//		}
//		for (int i = 1; i <= 9; i++) {
//			if (Input.GetKeyDown("" + i)) {
//				emitterSets[i - 1].gameObject.SetActive(true);
//			}
//		}
//		if (debugMode) {
//			return;
//		}

		// Shooting Control

		if (!isFiring) {
			return;
		}

		if (Time.time > timeToFireNextEmitter) {

			_currentEmitterSet = GetRandomEmitter();
			if (_currentEmitterSet == null) {
				return;
			}

			if (!_currentEmitterSet.gameObject.activeInHierarchy && enabled) {
				_currentEmitterSet.gameObject.SetActive(true);
				timeToFireNextEmitter = Time.time + _currentEmitterSet.spawningDuration + _currentEmitterSet.travelDurationEstimate * intervalRatio;
			}
		}
	}
コード例 #2
0
ファイル: PTCL_3DS.cs プロジェクト: lanvas2008/Switch-Toolbox
            public void Read(FileReader reader, PTCL pctl)
            {
                uint Position = (uint)reader.Position; //Offsets are relative to this

                reader.ByteOrder = Syroot.BinaryData.ByteOrder.LittleEndian;
                string Signature = reader.ReadString(4, Encoding.ASCII);

                if (Signature == "SPBD")
                {
                    IsSPBD = true;
                }

                Version = reader.ReadUInt32();
                uint EmitterCount = reader.ReadUInt32();
                uint Padding      = reader.ReadUInt32();

                EffectNameTableOffset   = reader.ReadUInt32();
                TextureBlockTableOffset = reader.ReadUInt32();
                TextureBlockTableSize   = reader.ReadUInt32();

                if (Version > 11)
                {
                    ShaderGtxTableOffset = reader.ReadUInt32();
                    ShaderGtxTableSize   = reader.ReadUInt32();
                    uint KeyAnimationTableOffset = reader.ReadUInt32();
                    uint KeyAnimationTableSize   = reader.ReadUInt32();
                    uint PrimativeTableOffset    = reader.ReadUInt32();
                    uint PrimativeTableSize      = reader.ReadUInt32();
                    uint ShaderParamTableOffset  = reader.ReadUInt32();
                    uint ShaderParamTableSize    = reader.ReadUInt32();
                    uint TotalTextureTableSize   = reader.ReadUInt32();
                    uint Unknown1 = reader.ReadUInt32();
                    uint Unknown2 = reader.ReadUInt32();
                }


                var groupEmitterSets = new TreeNode("Emitter Sets");
                var textureFolder    = new TreeNode("Textures");

                pctl.Nodes.Add(textureFolder);
                pctl.Nodes.Add(groupEmitterSets);

                for (int i = 0; i < EmitterCount; i++)
                {
                    EmitterSet emitterSet = new EmitterSet();
                    emitterSet.Read(reader, this);
                    emitterSets.Add(emitterSet);
                    groupEmitterSets.Nodes.Add(emitterSet);
                }

                int index = 0;

                foreach (var tex in Textures)
                {
                    tex.Text = $"Texture{index++}";
                    textureFolder.Nodes.Add(tex);
                }
            }
コード例 #3
0
ファイル: BulletSpawner.cs プロジェクト: holycattle/GGJ2016
    public void Update()
    {
        // Used for debugging the emitters
//		if (Input.GetKeyDown(KeyCode.D)) {
//			debugMode = !debugMode;
//		}
//		for (int i = 1; i <= 9; i++) {
//			if (Input.GetKeyDown("" + i)) {
//				emitterSets[i - 1].gameObject.SetActive(true);
//			}
//		}
//		if (debugMode) {
//			return;
//		}

        // Shooting Control

        if (!isFiring)
        {
            return;
        }

        if (Time.time > timeToFireNextEmitter)
        {
            _currentEmitterSet = GetRandomEmitter();
            if (_currentEmitterSet == null)
            {
                return;
            }

            if (!_currentEmitterSet.gameObject.activeInHierarchy && enabled)
            {
                _currentEmitterSet.gameObject.SetActive(true);
                timeToFireNextEmitter = Time.time + _currentEmitterSet.spawningDuration + _currentEmitterSet.travelDurationEstimate * intervalRatio;
            }
        }
    }